diff options
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/keymap.c b/src/keymap.c index f5b037ffa43..dea2515890b 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -2267,7 +2267,7 @@ indirect definition itself.") | |||
| 2267 | if (nomenus && NILP (noindirect) && NILP (keymap)) | 2267 | if (nomenus && NILP (noindirect) && NILP (keymap)) |
| 2268 | { | 2268 | { |
| 2269 | Lisp_Object *defns; | 2269 | Lisp_Object *defns; |
| 2270 | int i, n; | 2270 | int i, j, n; |
| 2271 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 2271 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 2272 | 2272 | ||
| 2273 | /* Check heuristic-consistency of the cache. */ | 2273 | /* Check heuristic-consistency of the cache. */ |
| @@ -2302,12 +2302,17 @@ indirect definition itself.") | |||
| 2302 | the following can GC. */ | 2302 | the following can GC. */ |
| 2303 | GCPRO2 (definition, keymaps); | 2303 | GCPRO2 (definition, keymaps); |
| 2304 | result = Qnil; | 2304 | result = Qnil; |
| 2305 | j = -1; | ||
| 2305 | for (i = n - 1; i >= 0; --i) | 2306 | for (i = n - 1; i >= 0; --i) |
| 2306 | if (EQ (shadow_lookup (keymaps, defns[i], Qnil), definition) | 2307 | if (EQ (shadow_lookup (keymaps, defns[i], Qnil), definition)) |
| 2307 | && ascii_sequence_p (defns[i])) | 2308 | { |
| 2308 | break; | 2309 | if (ascii_sequence_p (defns[i])) |
| 2310 | break; | ||
| 2311 | else if (j < 0) | ||
| 2312 | j = i; | ||
| 2313 | } | ||
| 2309 | 2314 | ||
| 2310 | result = i >= 0 ? defns[i] : Qnil; | 2315 | result = i >= 0 ? defns[i] : (j >= 0 ? defns[j] : Qnil); |
| 2311 | UNGCPRO; | 2316 | UNGCPRO; |
| 2312 | } | 2317 | } |
| 2313 | else | 2318 | else |