aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-08-03 07:39:00 +0000
committerRichard M. Stallman1994-08-03 07:39:00 +0000
commit44a4a59b6055ecfe398a0232a84731b227394b1d (patch)
tree2e8a6ab6dd9c88496c354485a1d9cf4bdb713f62 /src
parent23faf38f995d7f6fbdbc91a73ec862dd063eb8ce (diff)
downloademacs-44a4a59b6055ecfe398a0232a84731b227394b1d.tar.gz
emacs-44a4a59b6055ecfe398a0232a84731b227394b1d.zip
(Faccessible_keymaps): Use PREFIX to set loop starting
point; don't even consider maps except those reached via prefix.
Diffstat (limited to 'src')
-rw-r--r--src/keymap.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 3ae7d7e3608..dea8f883f6f 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1164,9 +1164,23 @@ then the value includes only maps for prefixes that start with PREFIX.")
1164 if (!NILP (prefix)) 1164 if (!NILP (prefix))
1165 prefixlen = XINT (Flength (prefix)); 1165 prefixlen = XINT (Flength (prefix));
1166 1166
1167 maps = Fcons (Fcons (Fmake_vector (make_number (0), Qnil), 1167 if (!NILP (prefix))
1168 get_keymap (startmap)), 1168 {
1169 Qnil); 1169 /* If a prefix was specified, start with the keymap (if any) for
1170 that prefix, so we don't waste time considering other prefixes. */
1171 Lisp_Object tem;
1172 tem = Flookup_key (startmap, prefix, Qt);
1173 /* If PREFIX is reasonable, Flookup_key should give a keymap or nil.
1174 For any other value it is ok to get an error here. */
1175 if (!NILP (tem))
1176 maps = Fcons (Fcons (prefix, get_keymap (tem)), Qnil);
1177 else
1178 return Qnil;
1179 }
1180 else
1181 maps = Fcons (Fcons (Fmake_vector (make_number (0), Qnil),
1182 get_keymap (startmap)),
1183 Qnil);
1170 1184
1171 /* For each map in the list maps, 1185 /* For each map in the list maps,
1172 look at any other maps it points to, 1186 look at any other maps it points to,