From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#11325: 24.1.50; regression: bad order for `substitute-command-keys' with keymap Date: Fri, 29 Apr 2016 18:35:09 +0200 Message-ID: <87mvocz83m.fsf@gnus.org> References: <87a9dza7gl.fsf@building.gnus.org> <87shy5iyjr.fsf@gnus.org> <87oa8tixro.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1461947802 11131 80.91.229.3 (29 Apr 2016 16:36:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Apr 2016 16:36:42 +0000 (UTC) Cc: 11325@debbugs.gnu.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 29 18:36:31 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1awBP4-0003Fn-Fl for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Apr 2016 18:36:30 +0200 Original-Received: from localhost ([::1]:55458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awBP0-0008GV-Ju for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Apr 2016 12:36:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awBOr-00081L-5E for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2016 12:36:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awBOf-0007MF-Eo for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2016 12:36:11 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awBOf-0007Lm-B9 for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2016 12:36:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1awBOb-0004yl-Tg for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2016 12:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Apr 2016 16:36:01 +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.146194771419065 (code B ref 11325); Fri, 29 Apr 2016 16:36:01 +0000 Original-Received: (at 11325) by debbugs.gnu.org; 29 Apr 2016 16:35:14 +0000 Original-Received: from localhost ([127.0.0.1]:55624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awBNp-0004xQ-Uh for submit@debbugs.gnu.org; Fri, 29 Apr 2016 12:35:14 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:46704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awBNo-0004xJ-Lf for 11325@debbugs.gnu.org; Fri, 29 Apr 2016 12:35:13 -0400 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1awBNl-00080j-Rt; Fri, 29 Apr 2016 18:35:11 +0200 In-Reply-To: <87oa8tixro.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 28 Apr 2016 17:00:27 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:117216 Archived-At: Here's a test case that's easier to work with. (defvar foo-map (let ((map (make-keymap))) (define-key map "a" 'left-char) (define-key map "f" 'right-char) (define-key map "g" 'right-char) (define-key map "z" 'left-char) map)) This gives the following wrong output: (insert (substitute-command-keys "\\{foo-map}")) key binding --- ------- f .. g right-char a left-char z left-char If I use a `make-sparse-keymap' instead, I get the following, correct output: key binding --- ------- a left-char f .. g right-char z left-char So in non-sparse keymaps, there's something odd about how consecutive key bindings are represented, and this leaks out in `substitute-command-keys'. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no