# HG changeset patch # User Stefan Monnier # Date 983207267 0 # Node ID 7fe1b8d8fc44a4140bf22837558ab3e6d77fda6c # Parent 5bac9d142978d0d2b4510f004203ed12113df04f *** empty log message *** diff -r 5bac9d142978 -r 7fe1b8d8fc44 src/ChangeLog --- a/src/ChangeLog Mon Feb 26 16:40:46 2001 +0000 +++ b/src/ChangeLog Mon Feb 26 17:07:47 2001 +0000 @@ -1,3 +1,11 @@ +2001-02-26 Stefan Monnier + + * keymap.c (Faccessible_keymaps): Pass `is_metized' to + accessible_keymaps_char_table. + (accessible_keymaps_char_table): Obey `is_metized'. + (where_is_internal, Fwhere_is_internal): Don't confuse int and + Lisp_Object. + 2001-02-26 Gerd Moellmann * dispnew.c: Check HAVE_TERM_H before including term.h. diff -r 5bac9d142978 -r 7fe1b8d8fc44 src/keymap.c --- a/src/keymap.c Mon Feb 26 16:40:46 2001 +0000 +++ b/src/keymap.c Mon Feb 26 17:07:47 2001 +0000 @@ -1438,7 +1438,7 @@ /* Help functions for describing and documenting keymaps. */ -static void accessible_keymaps_char_table (); +static void accessible_keymaps_char_table P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); /* This function cannot GC. */ @@ -1537,7 +1537,8 @@ Lisp_Object indices[3]; map_char_table (accessible_keymaps_char_table, Qnil, - elt, Fcons (maps, Fcons (tail, thisseq)), + elt, Fcons (Fcons (maps, is_metized), + Fcons (tail, thisseq)), 0, indices); } else if (VECTORP (elt)) @@ -1668,12 +1669,14 @@ Lisp_Object args, index, cmd; { Lisp_Object tem; - Lisp_Object maps, tail, thisseq; - + Lisp_Object maps, tail, thisseq, is_metized; + + cmd = get_keyelt (cmd, 0); if (NILP (cmd)) return; - maps = XCAR (args); + maps = XCAR (XCAR (args)); + is_metized = XCDR (XCAR (args)); tail = XCAR (XCDR (args)); thisseq = XCDR (XCDR (args)); @@ -1685,8 +1688,30 @@ tem = Frassq (cmd, maps); if (NILP (tem)) { - tem = append_key (thisseq, index); - nconc2 (tail, Fcons (Fcons (tem, cmd), Qnil)); + /* If the last key in thisseq is meta-prefix-char, + turn it into a meta-ized keystroke. We know + that the event we're about to append is an + ascii keystroke since we're processing a + keymap table. */ + if (is_metized) + { + int meta_bit = meta_modifier; + Lisp_Object last = make_number (XINT (Flength (thisseq)) - 1); + tem = Fcopy_sequence (thisseq); + + Faset (tem, last, make_number (XINT (index) | meta_bit)); + + /* This new sequence is the same length as + thisseq, so stick it in the list right + after this one. */ + XCDR (tail) + = Fcons (Fcons (tem, cmd), XCDR (tail)); + } + else + { + tem = append_key (thisseq, index); + nconc2 (tail, Fcons (Fcons (tem, cmd), Qnil)); + } } } } @@ -2103,7 +2128,8 @@ && EQ (Faref (this, last), meta_prefix_char)); /* if (nomenus && !ascii_sequence_p (this)) */ - if (nomenus && XINT (last) >= 0 && !INTEGERP (Faref (this, 0))) + if (nomenus && XINT (last) >= 0 + && !INTEGERP (Faref (this, make_number (0)))) /* If no menu entries should be returned, skip over the keymaps bound to `menu-bar' and `tool-bar' and other non-ascii prefixes like `C-down-mouse-2'. */ @@ -2294,7 +2320,7 @@ Instead of consing, copy definitions to a vector and step over that vector. */ sequences = Fgethash (definition, where_is_cache, Qnil); - n = Flength (sequences); + n = XINT (Flength (sequences)); defns = (Lisp_Object *) alloca (n * sizeof *defns); for (i = 0; CONSP (sequences); sequences = XCDR (sequences)) defns[i++] = XCAR (sequences);