Update smex after function calls that are likely to define new commands.#4
Update smex after function calls that are likely to define new commands.#4DarwinAwardWinner wants to merge 5 commits intononsequitur:masterfrom
Conversation
|
For general consumption, it might be best to refactor this into a modifiable custom variable. |
|
Do you have any interest in merging this? I've been using it for a long time (at least a year), and it has completely eliminated the need for periodic auto-updates. |
|
By the way, the two commits in this pull request are completely independent. I probably should have submitted them separately. So feel free to cherry-pick just one or the other. |
|
I just fixed a missing paren on this pull request and rebased on top of your latest master branch. |
|
Thanks! In the early stages, I did some experiments using exact same approach. |
|
With the code in this pull request, I've never run into a case where a new command was defined and smex didn't immediately pick it up. Yes, calls (Yes, I just added Can you provide a method of defining a function that doesn't use one of the five functions listed above? I can't think of any. |
* Add new function `smex-update-if-needed` and use it where appropriate * Rename `update-smex-after` to `smex-auto-update-after` * Advice defined by `smex-auto-update-after` now only works when `smex-auto-update' is set to t. * Other minor cleanups These are all in one commit because they all affect overlapping lines, so separating them out would have been quite difficult.
Since this advice is attached to important emacs functions, it should prefer to just do nothing rather than throw an error.
This is normally bound to "M-S-:".
|
Closing in favor of #67. |
I got tired of periodic smex auto updates, especially since every time I loaded a file or defined a new function, I would have to manually update smex anyway, since I immediately wanted access to the new functions that I just loaded. So I figured out which functions are involved in the definitions of vast majority of commands, and I wrapped them in advice that updates smex immediately after them. Now when you load a file or press C-j in scratch, your new stuff is available with no waiting.