From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#11325: 24.1.50; regression: bad order for `substitute-command-keys' with keymap Date: Wed, 20 Oct 2021 14:32:58 -0700 Message-ID: References: <87a9dza7gl.fsf@building.gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29526"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 11325@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 20 23:34:42 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdJEP-0007U0-VR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Oct 2021 23:34:41 +0200 Original-Received: from localhost ([::1]:46838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdJEN-0003nE-Pg for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Oct 2021 17:34:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdJDm-0003n5-LX for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2021 17:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdJDm-0005PA-9I for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2021 17:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mdJDm-00040x-4r for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2021 17:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Oct 2021 21:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11325 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 11325-submit@debbugs.gnu.org id=B11325.163476558615364 (code B ref 11325); Wed, 20 Oct 2021 21:34:02 +0000 Original-Received: (at 11325) by debbugs.gnu.org; 20 Oct 2021 21:33:06 +0000 Original-Received: from localhost ([127.0.0.1]:55634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdJCs-0003zk-2y for submit@debbugs.gnu.org; Wed, 20 Oct 2021 17:33:06 -0400 Original-Received: from mail-pg1-f177.google.com ([209.85.215.177]:40904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdJCq-0003zG-L0 for 11325@debbugs.gnu.org; Wed, 20 Oct 2021 17:33:05 -0400 Original-Received: by mail-pg1-f177.google.com with SMTP id q5so23683999pgr.7 for <11325@debbugs.gnu.org>; Wed, 20 Oct 2021 14:33:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=3wzcuYFc0hHtB2l5O940Hi1MIKoiW/p/C9BsZzlKPCc=; b=5dV/RSHwaQLlBR417LSeMnJA7zZLslO1kJwnJnoQUVr2S5K+R6ph5Z82VR/5W77wRI 0UH3tLyUfNxkBEdUbRG1e70mHmdAILTTDPHsXFmQi1enh6IZv3KI2UvrlZgCvVbjzPvO H83a0sDY8KgsnOeyrADLuEVJRUZIvpETlT1AXYa5sBWxI6j7K4FRpZNMwtT2nvt5kG6e vgsG/FppyQ0437mmKLxgxMEsfCBrhO8Bbxxa6jGWMgnY5A3SbuVwWggR+0SYwYWRk228 SXJu1bbUosyYrP2V+IOmGq2cOVLi5CmEQaJc3CGAAB7zl7gX0LTEe45jFNHdZ42NJ/q4 oQpA== X-Gm-Message-State: AOAM531P7Xcea9sonXsFejsooyy6sT43LquyP9spcGIMjmEDBLqmrk9z mDCSb+OqdJu9XGbxGvW/QkGRn/atRp3eJ47nWoI= X-Google-Smtp-Source: ABdhPJxGRUCX7Z24hkrVPCI/kgNwNsCIw0kII4r5E7xHy7mMjEmWotf5MnCzC0hyh+afnHRhvZFHWn6zKjXRH6DAi6k= X-Received: by 2002:a63:370c:: with SMTP id e12mr1317936pga.359.1634765578820; Wed, 20 Oct 2021 14:32:58 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 20 Oct 2021 14:32:58 -0700 In-Reply-To: <87a9dza7gl.fsf@building.gnus.org> (Lars Ingebrigtsen's message of "Sun, 09 Feb 2014 20:59:38 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:217724 Archived-At: Lars Ingebrigtsen writes: > "Drew Adams" 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