Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Allow smex to work with command-frequency #24

Closed
wants to merge 1 commit into from

2 participants

@gvol

Right now when I use smex with command-frequency it ends up keeping track of how many times I call smex instead of the commands that I execute.  Command-frequency uses real-last-command, and works with execute-extended-command'.  The comment inexecute-extended-command' mentions that real-this-command' should be set so thatrepeat' will work.

@gvol gvol Allow smex to work with command-frequency
Right now when I use smex with command-frequency it ends up keeping track of how many times I call smex instead of the commands that I execute.  Command-frequency uses real-last-command, and works with `execute-extended-command'.  The comment in `execute-extended-command' mentions that `real-this-command' should be set so that `repeat' will work.
a1a11f4
@nonsequitur
Owner

Thanks!

I've commited a slightly refined version.

@gvol

Thanks.

@gvol gvol deleted the unknown repository branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 13, 2012
  1. @gvol

    Allow smex to work with command-frequency

    gvol authored
    Right now when I use smex with command-frequency it ends up keeping track of how many times I call smex instead of the commands that I execute.  Command-frequency uses real-last-command, and works with `execute-extended-command'.  The comment in `execute-extended-command' mentions that `real-this-command' should be set so that `repeat' will work.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  smex.el
View
3  smex.el
@@ -109,6 +109,9 @@ Set this to nil to disable fuzzy matching."
(unwind-protect
(progn (setq prefix-arg current-prefix-arg)
(setq this-command chosen-item)
+ ;; Normally setting real-this-command is very bad, but in this case we really want it.
+ ;; See the comment in execute-extended-command (which does the same thing).
+ (setq real-this-command chosen-item)
(command-execute chosen-item 'record))
(smex-rank chosen-item)
(smex-show-key-advice chosen-item)
Something went wrong with that request. Please try again.