# HG changeset patch # User Richard M. Stallman # Date 789028976 0 # Node ID ebb2a456a3e85f23340e0c8080f1d6698f578b87 # Parent ce5ab980a14f8a965a8fd0a8115cb27828dc5045 (store_in_keymap): While dumping, copy DEF if a cons. diff -r ce5ab980a14f -r ebb2a456a3e8 src/keymap.c --- 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;