diff options
| author | Richard M. Stallman | 1995-01-02 06:42:56 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-01-02 06:42:56 +0000 |
| commit | 32ce36ad51e3c0eb7a7c2eabe8ee88cf489dd02d (patch) | |
| tree | 6edfad55ed442278742330ac2b9a2651e8eb751a /src/keymap.c | |
| parent | 95385625ed590b286be55ea3b47790e2cd25e993 (diff) | |
| download | emacs-32ce36ad51e3c0eb7a7c2eabe8ee88cf489dd02d.tar.gz emacs-32ce36ad51e3c0eb7a7c2eabe8ee88cf489dd02d.zip | |
(store_in_keymap): While dumping, copy DEF if a cons.
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 9 |
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) | |||
| 395 | register Lisp_Object idx; | 395 | register Lisp_Object idx; |
| 396 | register Lisp_Object def; | 396 | register Lisp_Object def; |
| 397 | { | 397 | { |
| 398 | /* If we are preparing to dump, and DEF might be pure, | ||
| 399 | copy it to ensure it is not pure. */ | ||
| 400 | if (!NILP (Vpurify_flag) && CONSP (def)) | ||
| 401 | def = Fcons (XCONS (def)->car, XCONS (def)->cdr); | ||
| 402 | |||
| 398 | if (!CONSP (keymap) || ! EQ (XCONS (keymap)->car, Qkeymap)) | 403 | if (!CONSP (keymap) || ! EQ (XCONS (keymap)->car, Qkeymap)) |
| 399 | error ("attempt to define a key in a non-keymap"); | 404 | error ("attempt to define a key in a non-keymap"); |
| 400 | 405 | ||
| @@ -463,8 +468,8 @@ store_in_keymap (keymap, idx, def) | |||
| 463 | keymap_end: | 468 | keymap_end: |
| 464 | /* We have scanned the entire keymap, and not found a binding for | 469 | /* We have scanned the entire keymap, and not found a binding for |
| 465 | IDX. Let's add one. */ | 470 | IDX. Let's add one. */ |
| 466 | XCONS (insertion_point)->cdr = | 471 | XCONS (insertion_point)->cdr |
| 467 | Fcons (Fcons (idx, def), XCONS (insertion_point)->cdr); | 472 | = Fcons (Fcons (idx, def), XCONS (insertion_point)->cdr); |
| 468 | } | 473 | } |
| 469 | 474 | ||
| 470 | return def; | 475 | return def; |