GNU bug report logs - #23543
25.1.50; Incorrect key binding echoed by `M-x'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 15 May 2016 21:33:02 UTC

Severity: minor

Tags: confirmed

Merged with 42207

Found in versions 25.1.50, 28.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23543 in the body.
You can then email your comments to 23543 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23543; Package emacs. (Sun, 15 May 2016 21:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 15 May 2016 21:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; Incorrect key binding echoed by `M-x'
Date: Sun, 15 May 2016 14:32:30 -0700 (PDT)
emacs -Q

(define-key global-map [remap eval-last-sexp] 'pp-eval-last-sexp)

Put point after a Lisp sexp somewhere, and do `M-x eval-last-sexp'.

You see this echoed:

  You can run the command 'eval-last-sexp' with C-x C-e

But that is incorrect.  You cannot run `eval-last-sexp'
using `C-x C-e', since it has been remapped to command
`pp-eval-last-sexp'.  If you use `C-x C-e' you invoke
the latter, not `eval-last-sexp'.

The code that causes this bugged behavior is the call
to `where-is-internal' in `execute-extended-command'.
It does, in effect:

(where-is-internal 'eval-last-sexp overriding-local-map t)

And that returns [24 5].  I'm no expert on `overriding-local-map',
but should it really be used here?  Seems like this is the cause,
but whatever the cause, the message is incorrect.

In GNU Emacs 25.1.50.1 (i686-pc-mingw32)
 of 2015-12-10
Repository revision: 6148555ee5a3d0139ae517803718b3e0357933c7
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --prefix=/c/Devel/emacs/snapshot/trunk --enable-checking=yes
 --enable-check-lisp-object-type --without-compress-install 'CFLAGS=-Og
 -ggdb3' LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23543; Package emacs. (Sun, 28 Jul 2019 12:40:02 GMT) Full text and rfc822 format available.

Message #8 received at 23543 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 23543 <at> debbugs.gnu.org
Subject: Re: bug#23543: 25.1.50; Incorrect key binding echoed by `M-x'
Date: Sun, 28 Jul 2019 14:39:34 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> emacs -Q
>
> (define-key global-map [remap eval-last-sexp] 'pp-eval-last-sexp)
>
> Put point after a Lisp sexp somewhere, and do `M-x eval-last-sexp'.
>
> You see this echoed:
>
>   You can run the command 'eval-last-sexp' with C-x C-e
>
> But that is incorrect.  You cannot run `eval-last-sexp'
> using `C-x C-e', since it has been remapped to command
> `pp-eval-last-sexp'.  If you use `C-x C-e' you invoke
> the latter, not `eval-last-sexp'.

I can confirm that this is still present in Emacs 27.

> The code that causes this bugged behavior is the call
> to `where-is-internal' in `execute-extended-command'.
> It does, in effect:
>
> (where-is-internal 'eval-last-sexp overriding-local-map t)
>
> And that returns [24 5].  I'm no expert on `overriding-local-map',
> but should it really be used here?  Seems like this is the cause,
> but whatever the cause, the message is incorrect.

When I trace this, `overriding-local-map' is nil, and indeed:

(where-is-internal 'eval-last-sexp)
=> ([24 5])

So that doesn't seem to have anything to do with this bug, and it's just
a bug in `where-is-internal'.  The doc string does talk about remapping,
but I'm not sure whether this is the same kind of remapping we have
here?  In any case, it doesn't make a difference:

The optional 5th arg NO-REMAP alters how command remapping is handled:

- If another command OTHER-COMMAND is remapped to DEFINITION, normally
  search for the bindings of OTHER-COMMAND and include them in the
  returned list.  But if NO-REMAP is non-nil, include the vector
  [remap OTHER-COMMAND] in the returned list instead, without
  searching for those other bindings.

- If DEFINITION is remapped to OTHER-COMMAND, normally return the
  bindings for OTHER-COMMAND.  But if NO-REMAP is non-nil, return the
  bindings for DEFINITION instead, ignoring its remapping.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 28 Jul 2019 12:40:02 GMT) Full text and rfc822 format available.

Forcibly Merged 23543 42207. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 20 Oct 2021 00:01:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23543; Package emacs. (Mon, 06 Jun 2022 14:44:01 GMT) Full text and rfc822 format available.

Message #15 received at 23543 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 42207 <at> debbugs.gnu.org, 23543 <at> debbugs.gnu.org
Subject: Re: bug#42207: 28.0.50; (where-is-internal) reports incorrect binding
Date: Mon, 06 Jun 2022 16:43:36 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> (define-key global-map [remap eval-last-sexp] 'pp-eval-last-sexp)
>>
>> Put point after a Lisp sexp somewhere, and do `M-x eval-last-sexp'.
>>
>> You see this echoed:
>>
>>   You can run the command 'eval-last-sexp' with C-x C-e
>>
>> But that is incorrect.  You cannot run `eval-last-sexp'
>> using `C-x C-e', since it has been remapped to command
>> `pp-eval-last-sexp'.  If you use `C-x C-e' you invoke
>> the latter, not `eval-last-sexp'.
>
> I can confirm that this is still present in Emacs 27.

I've now fixed this in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 42207 <at> debbugs.gnu.org and Dima Kogan <dima <at> secretsauce.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 06 Jun 2022 14:44:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 05 Jul 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 363 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.