aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorRichard M. Stallman1995-02-23 09:07:36 +0000
committerRichard M. Stallman1995-02-23 09:07:36 +0000
commit0bc395d481b8b3cb3c8bf6b9a9374982b9d44517 (patch)
tree68d9e64429d1ff3089edc4c7cb548a3d94fbae43 /src/keymap.c
parent9257760577a6fc58af6267dc24234f5a6e6e1645 (diff)
downloademacs-0bc395d481b8b3cb3c8bf6b9a9374982b9d44517.tar.gz
emacs-0bc395d481b8b3cb3c8bf6b9a9374982b9d44517.zip
(Fwhere_is_internal): If FIRSTONLY is not nil or non-ascii,
completely ignore menu bindings.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/keymap.c b/src/keymap.c
index dde720949fb..bfa8b219202 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1592,10 +1592,10 @@ If KEYMAP is nil, search all the currently active keymaps.\n\
1592\n\ 1592\n\
1593If optional 3rd arg FIRSTONLY is non-nil, return the first key sequence found,\n\ 1593If optional 3rd arg FIRSTONLY is non-nil, return the first key sequence found,\n\
1594rather than a list of all possible key sequences.\n\ 1594rather than a list of all possible key sequences.\n\
1595If FIRSTONLY is t, avoid key sequences which use non-ASCII\n\ 1595If FIRSTONLY is the symbol `non-ascii', return the first binding found,\n\
1596keys and therefore may not be usable on ASCII terminals. If FIRSTONLY\n\ 1596no matter what it is.\n\
1597is the symbol `non-ascii', return the first binding found, no matter\n\ 1597If FIRSTONLY has another non-nil value, prefer sequences of ASCII characters,
1598what its components.\n\ 1598and entirely reject menu bindings.\n\
1599\n\ 1599\n\
1600If optional 4th arg NOINDIRECT is non-nil, don't follow indirections\n\ 1600If optional 4th arg NOINDIRECT is non-nil, don't follow indirections\n\
1601to other keymaps or slots. This makes it possible to search for an\n\ 1601to other keymaps or slots. This makes it possible to search for an\n\
@@ -1608,6 +1608,8 @@ indirect definition itself.")
1608 Lisp_Object found, sequence; 1608 Lisp_Object found, sequence;
1609 int keymap_specified = !NILP (keymap); 1609 int keymap_specified = !NILP (keymap);
1610 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 1610 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
1611 /* 1 means ignore all menu bindings entirely. */
1612 int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii);
1611 1613
1612 if (! keymap_specified) 1614 if (! keymap_specified)
1613 { 1615 {
@@ -1716,7 +1718,28 @@ indirect definition itself.")
1716 1718
1717 /* Search through indirections unless that's not wanted. */ 1719 /* Search through indirections unless that's not wanted. */
1718 if (NILP (noindirect)) 1720 if (NILP (noindirect))
1719 binding = get_keyelt (binding, 0); 1721 {
1722 if (nomenus)
1723 {
1724 while (1)
1725 {
1726 Lisp_Object map, tem;
1727 /* If the contents are (KEYMAP . ELEMENT), go indirect. */
1728 map = get_keymap_1 (Fcar_safe (definition), 0, 0);
1729 tem = Fkeymapp (map);
1730 if (!NILP (tem))
1731 definition = access_keymap (map, Fcdr (definition), 0, 0);
1732 else
1733 break;
1734 }
1735 /* If the contents are (STRING ...), reject. */
1736 if (CONSP (definition)
1737 && STRINGP (XCONS (definition)->car))
1738 continue;
1739 }
1740 else
1741 binding = get_keyelt (binding, 0);
1742 }
1720 1743
1721 /* End this iteration if this element does not match 1744 /* End this iteration if this element does not match
1722 the target. */ 1745 the target. */