summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-01-02 06:42:56 +0000
committerRichard M. Stallman <rms@gnu.org>1995-01-02 06:42:56 +0000
commitea79e90c510e68eff743b5f99c4de7e2c812b72c (patch)
tree04c131273ce13a54149d9f6e99aa19c05951a7f4
parentf1389f362bd33fe454bf7fcd205a8e2beb92c8de (diff)
downloademacs-ea79e90c510e68eff743b5f99c4de7e2c812b72c.tar.gz
(store_in_keymap): While dumping, copy DEF if a cons.
-rw-r--r--src/keymap.c9
1 files 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;