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

Already on GitHub? Sign in to your account

Add global minor mode with autoloads #11

haxney opened this Issue May 3, 2012 · 4 comments


None yet
3 participants

haxney commented May 3, 2012

Right now, smex needs to be initialized explicitly with smex-initialize in the user's init.el file. This could be eliminated by creating a global minor mode for smex which sets up and tears down the settings. By using define-minor-mode with a non-nil :global keyword, a defcustom will be generated automatically, allowing users to toggle smex on and off through customize. The define-minor-mode should have a ;;;###autoload token to allow it to be activated purely through a user's custom file.

To enable the keybinding, smex should remap execute-extended-command rather than overwriting its global definition. This could be accomplished using the following in the body of define-minor-mode:

(if smex-mode
    (global-set-key [remap execute-extended-command] 'smex)
  (global-unset-key [remap execute-extended-command]))

This way, smex only makes nondestructive changes.


haxney commented May 3, 2012

Actually, I'll probably create a pull request for this. Stay tuned...


I would really like this.

er, at least a minor-mode for smex would be nice.

jgeerds commented Jul 19, 2013

@nonsequitur Any news here?

@DarwinAwardWinner DarwinAwardWinner referenced this issue in DarwinAwardWinner/amx Mar 12, 2017

@DarwinAwardWinner DarwinAwardWinner Add smex-mode, a global minor mode
Fixes #11.

The minor mode currently only remaps "execute-extended-command" to
"smex". It doesn't add bindings for the other smex commands such as
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment