Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

counsel-M-x: this-command is incorrect in minibuffer-setup-hook #2874

Open
gexplorer opened this issue May 20, 2021 · 2 comments
Open

counsel-M-x: this-command is incorrect in minibuffer-setup-hook #2874

gexplorer opened this issue May 20, 2021 · 2 comments

Comments

@gexplorer
Copy link
Contributor

When executing the command counsel-M-x, the value of the variable this-command in the hook minibuffer-setup-hook is the previously executed command instead of counsel-M-x.

@basil-conto
Copy link
Collaborator

See #891. Ccing @Wilfred.

@gexplorer
Copy link
Contributor Author

Those two lines are precisely the ones causing the strange behavior I noticed.

I created this snippet to test it easily.

The problem is that even though when executing the target command the values of this-command and last-command are correct, during the hook minibuffer-setup-hook when executing counsel-M-x all values get replaced.

When executing ‘execute-extended-command‘

  • minibuffer-setup-hook
command value real value
this eval-last-sexp eval-last-sexp
last move-end-of-line move-end-of-line
  • gx-debug-commands
command value real value
this gx-debug-commands gx-debug-commands
last self-insert-command self-insert-command

When executing ‘counsel-M-x‘

  • minibuffer-setup-hook
command value real value
this mouse-set-point mouse-set-point
last mouse-set-point mouse-set-point
  • gx-debug-commands
command value real value
this gx-debug-commands gx-debug-commands
last self-insert-command self-insert-command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants