diff options
Diffstat (limited to 'src')
| -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; |