Mercurial > emacs
diff src/keymap.c @ 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 | b83150a8020d |
children | e1c7a3f0c15f |
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;