# HG changeset patch # User Stefan Monnier # Date 980954370 0 # Node ID ffdcf20f53f2e68a68dd4ba3817738742770714f # Parent a4119c7b821f1e7f53eec24d37f1a90739a03a4c (Fwhere_is_internal): Use the first valid binding if no ascii binding is found (when firstonly is t). diff -r a4119c7b821f -r ffdcf20f53f2 src/keymap.c --- a/src/keymap.c Wed Jan 31 15:11:07 2001 +0000 +++ b/src/keymap.c Wed Jan 31 15:19:30 2001 +0000 @@ -2267,7 +2267,7 @@ if (nomenus && NILP (noindirect) && NILP (keymap)) { Lisp_Object *defns; - int i, n; + int i, j, n; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; /* Check heuristic-consistency of the cache. */ @@ -2302,12 +2302,17 @@ the following can GC. */ GCPRO2 (definition, keymaps); result = Qnil; + j = -1; for (i = n - 1; i >= 0; --i) - if (EQ (shadow_lookup (keymaps, defns[i], Qnil), definition) - && ascii_sequence_p (defns[i])) - break; - - result = i >= 0 ? defns[i] : Qnil; + if (EQ (shadow_lookup (keymaps, defns[i], Qnil), definition)) + { + if (ascii_sequence_p (defns[i])) + break; + else if (j < 0) + j = i; + } + + result = i >= 0 ? defns[i] : (j >= 0 ? defns[j] : Qnil); UNGCPRO; } else