diff options
| author | Gerd Moellmann | 2000-10-18 14:20:53 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-10-18 14:20:53 +0000 |
| commit | 7396a36c102c34fce487f2bf4883bf4c91f0fd3d (patch) | |
| tree | e7bfad34310a5feeeaa343891f575aa2cafd3e03 /src | |
| parent | 4e217e5069de0bfe49900b79f696f3feec9da6b9 (diff) | |
| download | emacs-7396a36c102c34fce487f2bf4883bf4c91f0fd3d.tar.gz emacs-7396a36c102c34fce487f2bf4883bf4c91f0fd3d.zip | |
(access_keymap): If IDX has a meta prefix, and there's
no map for meta_prefix_char, don't try to use it as a keymap.
Instead, if T_OK is non-zero, look up a default binding, if any,
otherwise, if T_OK is zero, return nil.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keymap.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/keymap.c b/src/keymap.c index fbbbcae3998..72d40d09872 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -483,10 +483,23 @@ access_keymap (map, idx, t_ok, noinherit, autoload) | |||
| 483 | /* Handle the special meta -> esc mapping. */ | 483 | /* Handle the special meta -> esc mapping. */ |
| 484 | if (INTEGERP (idx) && XUINT (idx) & meta_modifier) | 484 | if (INTEGERP (idx) && XUINT (idx) & meta_modifier) |
| 485 | { | 485 | { |
| 486 | map = get_keymap_1 (access_keymap | 486 | Lisp_Object meta_map; |
| 487 | (map, meta_prefix_char, t_ok, noinherit, autoload), | 487 | |
| 488 | 0, autoload); | 488 | /* See if there is a meta-map. If there's none, there is |
| 489 | XSETINT (idx, XFASTINT (idx) & ~meta_modifier); | 489 | no binding for IDX, unless a default binding exists in MAP. */ |
| 490 | meta_map = access_keymap (map, meta_prefix_char, t_ok, noinherit, | ||
| 491 | autoload); | ||
| 492 | if (KEYMAPP (meta_map)) | ||
| 493 | { | ||
| 494 | map = get_keymap_1 (meta_map, 0, autoload); | ||
| 495 | idx = make_number (XUINT (idx) & ~meta_modifier); | ||
| 496 | } | ||
| 497 | else if (t_ok) | ||
| 498 | /* Set IDX to t, so that we only find a default binding. */ | ||
| 499 | idx = Qt; | ||
| 500 | else | ||
| 501 | /* We know there is no binding. */ | ||
| 502 | return Qnil; | ||
| 490 | } | 503 | } |
| 491 | 504 | ||
| 492 | { | 505 | { |
| @@ -495,7 +508,9 @@ access_keymap (map, idx, t_ok, noinherit, autoload) | |||
| 495 | 508 | ||
| 496 | t_binding = Qnil; | 509 | t_binding = Qnil; |
| 497 | for (tail = XCDR (map); | 510 | for (tail = XCDR (map); |
| 498 | CONSP (tail) || (tail = get_keymap_1(tail, 0, autoload), CONSP (tail)); | 511 | (CONSP (tail) |
| 512 | || (tail = get_keymap_1 (tail, 0, autoload), | ||
| 513 | CONSP (tail))); | ||
| 499 | tail = XCDR (tail)) | 514 | tail = XCDR (tail)) |
| 500 | { | 515 | { |
| 501 | Lisp_Object binding; | 516 | Lisp_Object binding; |