changeset 10305:ebb2a456a3e8

(store_in_keymap): While dumping, copy DEF if a cons.
author Richard M. Stallman <rms@gnu.org>
date Mon, 02 Jan 1995 06:42:56 +0000
parents ce5ab980a14f
children 89f8d7f3bd73
files src/keymap.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/keymap.c	Mon Jan 02 06:36:56 1995 +0000
+++ b/src/keymap.c	Mon Jan 02 06:42:56 1995 +0000
@@ -395,6 +395,11 @@
      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 @@
   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;