all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23543: 25.1.50; Incorrect key binding echoed by `M-x'
@ 2016-05-15 21:32 Drew Adams
  2019-07-28 12:39 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2016-05-15 21:32 UTC (permalink / raw)
  To: 23543

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''





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#23543: 25.1.50; Incorrect key binding echoed by `M-x'
  2016-05-15 21:32 bug#23543: 25.1.50; Incorrect key binding echoed by `M-x' Drew Adams
@ 2019-07-28 12:39 ` Lars Ingebrigtsen
  2022-06-06 14:43   ` bug#23543: bug#42207: 28.0.50; (where-is-internal) reports incorrect binding Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-28 12:39 UTC (permalink / raw)
  To: Drew Adams; +Cc: 23543

Drew Adams <drew.adams@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#23543: bug#42207: 28.0.50; (where-is-internal) reports incorrect binding
  2019-07-28 12:39 ` Lars Ingebrigtsen
@ 2022-06-06 14:43   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-06 14:43 UTC (permalink / raw)
  To: Drew Adams; +Cc: 42207, 23543

Lars Ingebrigtsen <larsi@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-06 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-15 21:32 bug#23543: 25.1.50; Incorrect key binding echoed by `M-x' Drew Adams
2019-07-28 12:39 ` Lars Ingebrigtsen
2022-06-06 14:43   ` bug#23543: bug#42207: 28.0.50; (where-is-internal) reports incorrect binding Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.