emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange key handling on a terminal


From: Stefan Monnier
Subject: Re: strange key handling on a terminal
Date: Fri, 21 Jul 2006 16:14:55 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> I wasn't aware that [(control ?\.)] was XEmacs syntax, I just copied
> it from flyspell.el ...

You could lobby to change define-key so it accepts this syntax for the
third argument as well.  I think it'd make sense.  IIRC the third argument
can only ever contain things like functions and key sequences, so a vector
whose first element is a list should currently always lead to an error.
See sample patch below.

> What is the Emacs way to bind C-. ?

?\C-.

> (kbd "C-.") ? 

That works as well and returns ?\C-.


        Stefan


--- orig/src/keymap.c
+++ mod/src/keymap.c
@@ -1212,6 +1212,20 @@
 
   meta_bit = VECTORP (key) ? meta_modifier : 0x80;
 
+  if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, make_number (0))))
+    { /* DEF is an XEmacs-style keyboard macro.  */
+      Lisp_Object tmp = Fmake_vector (make_number (ASIZE (def)), Qnil);
+      int i = ASIZE (def);
+      while (--i >= 0)
+       {
+         Lisp_Object c = AREF (def, i);
+         if (CONSP (c) && lucid_event_type_list_p (c))
+           c = Fevent_convert_list (c);
+         ASET (tmp, i, c);
+       }
+      def = tmp;
+    }
+
   idx = 0;
   while (1)
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]