aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-03-21 22:48:13 +0000
committerKarl Heuer1994-03-21 22:48:13 +0000
commitd65a13c594f6643ca5dc80163008429c8c080dda (patch)
tree90e3cd104d0e6296a64743c6f3e176368b9c7bb7 /src
parent9c52bf473cf95c2a00fc551f511db09223d68b47 (diff)
downloademacs-d65a13c594f6643ca5dc80163008429c8c080dda.tar.gz
emacs-d65a13c594f6643ca5dc80163008429c8c080dda.zip
(Fcopy_keymap): Account for menus and equiv-key cache.
Diffstat (limited to 'src')
-rw-r--r--src/keymap.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/src/keymap.c b/src/keymap.c
index dec406d2303..1ee65809a74 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -503,10 +503,40 @@ is not copied.")
503 XVECTOR (elt)->contents[i] = 503 XVECTOR (elt)->contents[i] =
504 Fcopy_keymap (XVECTOR (elt)->contents[i]); 504 Fcopy_keymap (XVECTOR (elt)->contents[i]);
505 } 505 }
506 else if (CONSP (elt) 506 else if (CONSP (elt))
507 && XTYPE (XCONS (elt)->cdr) != Lisp_Symbol 507 {
508 && ! NILP (Fkeymapp (XCONS (elt)->cdr))) 508 /* Skip the optional menu string. */
509 XCONS (elt)->cdr = Fcopy_keymap (XCONS (elt)->cdr); 509 if (CONSP (XCONS (elt)->cdr)
510 && STRINGP (XCONS (XCONS (elt)->cdr)->car))
511 {
512 Lisp_Object tem;
513
514 /* Copy the cell, since copy-alist didn't go this deep. */
515 XCONS (elt)->cdr = Fcons (XCONS (XCONS (elt)->cdr)->car,
516 XCONS (XCONS (elt)->cdr)->cdr);
517 elt = XCONS (elt)->cdr;
518
519 /* Also skip the optional menu help string. */
520 if (CONSP (XCONS (elt)->cdr)
521 && STRINGP (XCONS (XCONS (elt)->cdr)->car))
522 {
523 XCONS (elt)->cdr = Fcons (XCONS (XCONS (elt)->cdr)->car,
524 XCONS (XCONS (elt)->cdr)->cdr);
525 elt = XCONS (elt)->cdr;
526 }
527 /* There may also be a list that caches key equivalences.
528 Just delete it for the new keymap. */
529 if (CONSP (XCONS (elt)->cdr)
530 && CONSP (XCONS (XCONS (elt)->cdr)->car)
531 && (NILP (tem = XCONS (XCONS (XCONS (elt)->cdr)->car)->car)
532 || VECTORP (tem)))
533 XCONS (elt)->cdr = XCONS (XCONS (elt)->cdr)->cdr;
534 }
535 if (CONSP (elt)
536 && ! SYMBOLP (XCONS (elt)->cdr)
537 && ! NILP (Fkeymapp (XCONS (elt)->cdr)))
538 XCONS (elt)->cdr = Fcopy_keymap (XCONS (elt)->cdr);
539 }
510 } 540 }
511 541
512 return copy; 542 return copy;