emacs-devel
[Top][All Lists]
Advanced

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

Re: where-is only mentions first key in interval


From: Stefan Monnier
Subject: Re: where-is only mentions first key in interval
Date: Mon, 13 Feb 2012 11:00:45 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

>   (key-description [(101 . 102)]) returns just "e".

I've installed the patch below, so it will display as
"dired-find-file is on RET, e..f, <menu-bar>"
It would be better to handle such "trivial" intervals as separate keys,
but that's a larger change (because "C-x e..f" needs to be turned into
"C-x e, C-x f").


        Stefan


=== modified file 'src/keymap.c'
--- src/keymap.c        2012-01-19 07:21:25 +0000
+++ src/keymap.c        2012-02-13 15:52:25 +0000
@@ -2270,9 +2270,15 @@
   if (CONSP (key) && lucid_event_type_list_p (key))
     key = Fevent_convert_list (key);
 
+  if (CONSP (key) && INTEGERP (XCAR (key)) && INTEGERP (XCDR (key)))
+    /* An interval from a map-char-table.  */
+    return concat3 (Fsingle_key_description (XCAR (key), no_angles),
+                   build_string (".."),
+                   Fsingle_key_description (XCDR (key), no_angles));
+
   key = EVENT_HEAD (key);
 
-  if (INTEGERP (key))          /* Normal character */
+  if (INTEGERP (key))          /* Normal character.  */
     {
       char tem[KEY_DESCRIPTION_SIZE], *p;
 
@@ -2280,7 +2286,7 @@
       *p = 0;
       return make_specified_string (tem, -1, p - tem, 1);
     }
-  else if (SYMBOLP (key))      /* Function key or event-symbol */
+  else if (SYMBOLP (key))      /* Function key or event-symbol.  */
     {
       if (NILP (no_angles))
        {




reply via email to

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