diff options
| author | Richard M. Stallman | 1999-09-08 05:14:39 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-09-08 05:14:39 +0000 |
| commit | 61684f41fc15f3f68d3f9858e5b57217dca6d530 (patch) | |
| tree | 1f448a4496505b3704d10026c66241d798ac36fb /src/keymap.c | |
| parent | 01ba5cc0c16872c5eb4c6e6a1fe6822f4e4273b4 (diff) | |
| download | emacs-61684f41fc15f3f68d3f9858e5b57217dca6d530.tar.gz emacs-61684f41fc15f3f68d3f9858e5b57217dca6d530.zip | |
(fix_submap_inheritance): Do nothing if the proper parent is an
ancestor of SUBMAP; otherwise, add it as the ultimate ancestor.
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/keymap.c b/src/keymap.c index 1b673384806..c209a690226 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -426,7 +426,23 @@ fix_submap_inheritance (map, event, submap) | |||
| 426 | parent_entry = Qnil; | 426 | parent_entry = Qnil; |
| 427 | 427 | ||
| 428 | if (! EQ (parent_entry, submap)) | 428 | if (! EQ (parent_entry, submap)) |
| 429 | Fset_keymap_parent (submap, parent_entry); | 429 | { |
| 430 | Lisp_Object submap_parent; | ||
| 431 | submap_parent = submap; | ||
| 432 | while (1) | ||
| 433 | { | ||
| 434 | Lisp_Object tem; | ||
| 435 | tem = Fkeymap_parent (submap_parent); | ||
| 436 | if (EQ (tem, parent_entry)) | ||
| 437 | return; | ||
| 438 | if (CONSP (tem) | ||
| 439 | && EQ (XCONS (tem)->car, Qkeymap)) | ||
| 440 | submap_parent = tem; | ||
| 441 | else | ||
| 442 | break; | ||
| 443 | } | ||
| 444 | Fset_keymap_parent (submap_parent, parent_entry); | ||
| 445 | } | ||
| 430 | } | 446 | } |
| 431 | 447 | ||
| 432 | /* Look up IDX in MAP. IDX may be any sort of event. | 448 | /* Look up IDX in MAP. IDX may be any sort of event. |