aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2001-02-26 17:07:47 +0000
committerStefan Monnier2001-02-26 17:07:47 +0000
commitf58c64946e68b9428c6276d7eda38d22a7d79d6c (patch)
treeaa4a949b48f75fee97d29811cf395cdb1779952e /src
parentbaebd8a5441a32347a5477dba2c7f562505ad893 (diff)
downloademacs-f58c64946e68b9428c6276d7eda38d22a7d79d6c.tar.gz
emacs-f58c64946e68b9428c6276d7eda38d22a7d79d6c.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/keymap.c42
2 files changed, 42 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9d831d091d6..69cdd2894ba 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12001-02-26 Stefan Monnier <monnier@cs.yale.edu>
2
3 * keymap.c (Faccessible_keymaps): Pass `is_metized' to
4 accessible_keymaps_char_table.
5 (accessible_keymaps_char_table): Obey `is_metized'.
6 (where_is_internal, Fwhere_is_internal): Don't confuse int and
7 Lisp_Object.
8
12001-02-26 Gerd Moellmann <gerd@gnu.org> 92001-02-26 Gerd Moellmann <gerd@gnu.org>
2 10
3 * dispnew.c: Check HAVE_TERM_H before including term.h. 11 * dispnew.c: Check HAVE_TERM_H before including term.h.
diff --git a/src/keymap.c b/src/keymap.c
index 5493bc583c8..c44cf09d5b9 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1438,7 +1438,7 @@ DEFUN ("current-minor-mode-maps", Fcurrent_minor_mode_maps, Scurrent_minor_mode_
1438 1438
1439/* Help functions for describing and documenting keymaps. */ 1439/* Help functions for describing and documenting keymaps. */
1440 1440
1441static void accessible_keymaps_char_table (); 1441static void accessible_keymaps_char_table P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
1442 1442
1443/* This function cannot GC. */ 1443/* This function cannot GC. */
1444 1444
@@ -1537,7 +1537,8 @@ then the value includes only maps for prefixes that start with PREFIX.")
1537 Lisp_Object indices[3]; 1537 Lisp_Object indices[3];
1538 1538
1539 map_char_table (accessible_keymaps_char_table, Qnil, 1539 map_char_table (accessible_keymaps_char_table, Qnil,
1540 elt, Fcons (maps, Fcons (tail, thisseq)), 1540 elt, Fcons (Fcons (maps, is_metized),
1541 Fcons (tail, thisseq)),
1541 0, indices); 1542 0, indices);
1542 } 1543 }
1543 else if (VECTORP (elt)) 1544 else if (VECTORP (elt))
@@ -1668,12 +1669,14 @@ accessible_keymaps_char_table (args, index, cmd)
1668 Lisp_Object args, index, cmd; 1669 Lisp_Object args, index, cmd;
1669{ 1670{
1670 Lisp_Object tem; 1671 Lisp_Object tem;
1671 Lisp_Object maps, tail, thisseq; 1672 Lisp_Object maps, tail, thisseq, is_metized;
1672 1673
1674 cmd = get_keyelt (cmd, 0);
1673 if (NILP (cmd)) 1675 if (NILP (cmd))
1674 return; 1676 return;
1675 1677
1676 maps = XCAR (args); 1678 maps = XCAR (XCAR (args));
1679 is_metized = XCDR (XCAR (args));
1677 tail = XCAR (XCDR (args)); 1680 tail = XCAR (XCDR (args));
1678 thisseq = XCDR (XCDR (args)); 1681 thisseq = XCDR (XCDR (args));
1679 1682
@@ -1685,8 +1688,30 @@ accessible_keymaps_char_table (args, index, cmd)
1685 tem = Frassq (cmd, maps); 1688 tem = Frassq (cmd, maps);
1686 if (NILP (tem)) 1689 if (NILP (tem))
1687 { 1690 {
1688 tem = append_key (thisseq, index); 1691 /* If the last key in thisseq is meta-prefix-char,
1689 nconc2 (tail, Fcons (Fcons (tem, cmd), Qnil)); 1692 turn it into a meta-ized keystroke. We know
1693 that the event we're about to append is an
1694 ascii keystroke since we're processing a
1695 keymap table. */
1696 if (is_metized)
1697 {
1698 int meta_bit = meta_modifier;
1699 Lisp_Object last = make_number (XINT (Flength (thisseq)) - 1);
1700 tem = Fcopy_sequence (thisseq);
1701
1702 Faset (tem, last, make_number (XINT (index) | meta_bit));
1703
1704 /* This new sequence is the same length as
1705 thisseq, so stick it in the list right
1706 after this one. */
1707 XCDR (tail)
1708 = Fcons (Fcons (tem, cmd), XCDR (tail));
1709 }
1710 else
1711 {
1712 tem = append_key (thisseq, index);
1713 nconc2 (tail, Fcons (Fcons (tem, cmd), Qnil));
1714 }
1690 } 1715 }
1691 } 1716 }
1692} 1717}
@@ -2103,7 +2128,8 @@ where_is_internal (definition, keymaps, firstonly, noindirect)
2103 && EQ (Faref (this, last), meta_prefix_char)); 2128 && EQ (Faref (this, last), meta_prefix_char));
2104 2129
2105 /* if (nomenus && !ascii_sequence_p (this)) */ 2130 /* if (nomenus && !ascii_sequence_p (this)) */
2106 if (nomenus && XINT (last) >= 0 && !INTEGERP (Faref (this, 0))) 2131 if (nomenus && XINT (last) >= 0
2132 && !INTEGERP (Faref (this, make_number (0))))
2107 /* If no menu entries should be returned, skip over the 2133 /* If no menu entries should be returned, skip over the
2108 keymaps bound to `menu-bar' and `tool-bar' and other 2134 keymaps bound to `menu-bar' and `tool-bar' and other
2109 non-ascii prefixes like `C-down-mouse-2'. */ 2135 non-ascii prefixes like `C-down-mouse-2'. */
@@ -2294,7 +2320,7 @@ indirect definition itself.")
2294 Instead of consing, copy definitions to a vector and step 2320 Instead of consing, copy definitions to a vector and step
2295 over that vector. */ 2321 over that vector. */
2296 sequences = Fgethash (definition, where_is_cache, Qnil); 2322 sequences = Fgethash (definition, where_is_cache, Qnil);
2297 n = Flength (sequences); 2323 n = XINT (Flength (sequences));
2298 defns = (Lisp_Object *) alloca (n * sizeof *defns); 2324 defns = (Lisp_Object *) alloca (n * sizeof *defns);
2299 for (i = 0; CONSP (sequences); sequences = XCDR (sequences)) 2325 for (i = 0; CONSP (sequences); sequences = XCDR (sequences))
2300 defns[i++] = XCAR (sequences); 2326 defns[i++] = XCAR (sequences);