]> git.eshelyaron.com Git - emacs.git/commitdiff
(store_in_keymap): While dumping, copy DEF if a cons.
authorRichard M. Stallman <rms@gnu.org>
Mon, 2 Jan 1995 06:42:56 +0000 (06:42 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 2 Jan 1995 06:42:56 +0000 (06:42 +0000)
src/keymap.c

index 66f05a531354c35dfa16e4d4b9bae8014140b07c..b6a15754b60b31ee0404cb11bfe06900614b6391 100644 (file)
@@ -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;