From 32ce36ad51e3c0eb7a7c2eabe8ee88cf489dd02d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 2 Jan 1995 06:42:56 +0000 Subject: [PATCH] (store_in_keymap): While dumping, copy DEF if a cons. --- src/keymap.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/keymap.c b/src/keymap.c index 66f05a53135..b6a15754b60 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -395,6 +395,11 @@ store_in_keymap (keymap, idx, def) register Lisp_Object idx; register Lisp_Object def; { + /* If we are preparing to dump, and DEF might be pure, + copy it to ensure it is not pure. */ + if (!NILP (Vpurify_flag) && CONSP (def)) + def = Fcons (XCONS (def)->car, XCONS (def)->cdr); + if (!CONSP (keymap) || ! EQ (XCONS (keymap)->car, Qkeymap)) error ("attempt to define a key in a non-keymap"); @@ -463,8 +468,8 @@ store_in_keymap (keymap, idx, def) keymap_end: /* We have scanned the entire keymap, and not found a binding for IDX. Let's add one. */ - XCONS (insertion_point)->cdr = - Fcons (Fcons (idx, def), XCONS (insertion_point)->cdr); + XCONS (insertion_point)->cdr + = Fcons (Fcons (idx, def), XCONS (insertion_point)->cdr); } return def; -- 2.39.5