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

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

bug#11325: 24.1.50; regression: bad order for `substitute-command-keys'


From: Stefan Kangas
Subject: bug#11325: 24.1.50; regression: bad order for `substitute-command-keys' with keymap
Date: Wed, 20 Oct 2021 14:32:58 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> "Drew Adams" <drew.adams@oracle.com> writes:
>
>> Then it was broken differently in Emacs 24, which puts `e..f'
>> first in the list, but restores `0..9' to its rightful place.
>
> Isn't the main problem here that it even tries to do a two-letter range?
> Seems awfully odd to me:

This could be easily fixed using:

diff --git a/src/keymap.c b/src/keymap.c
index ca1dbe368e..1c6f75a767 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3101,10 +3101,13 @@ describe_vector (Lisp_Object vector,
Lisp_Object prefix, Lisp_Object args,
            }
        }

-      /* If we have a range of more than one character,
-        print where the range reaches to.  */
+      /* If we have a range of more than two characters, print where
+        the range reaches to.  We specifically avoid printing two
+        character ranges, as they aren't very easy on the reader.  */

-      if (i != starting_i)
+      if ((i - starting_i) < 2)
+       i = starting_i;
+      else
        {
          insert (" .. ", 4);

> (substitute-command-keys "\\{dired-mode-map}")
> "key             binding
> ---             -------
>
> e .. f                dired-find-file
>
> C-c           Prefix Command
> RET           dired-find-file
> C-o           dired-display-file
> C-t           Prefix Command
> ESC           Prefix Command
> SPC           dired-next-line
> !             dired-do-shell-command
> #             dired-flag-auto-save-files
> $             dired-hide-subdir
> %             Prefix Command
> &             dired-do-async-shell-command
> (             dired-hide-details-mode
> *             Prefix Command
> +             dired-create-directory
> -             negative-argument
> .             dired-clean-directory
> 0 .. 9                digit-argument





reply via email to

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