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

Add global minor mode with autoloads #11

Open
haxney opened this issue May 3, 2012 · 4 comments
Open

Add global minor mode with autoloads #11

haxney opened this issue May 3, 2012 · 4 comments

Comments

@haxney
Copy link
Contributor

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
Copy link
Contributor Author

haxney commented May 3, 2012

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

@milkypostman
Copy link

/bump

I would really like this.

@milkypostman
Copy link

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

@jgeerds
Copy link

jgeerds commented Jul 19, 2013

@nonsequitur Any news here?

DarwinAwardWinner referenced this issue in DarwinAwardWinner/amx Mar 12, 2017
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
"smex-major-mode-commands".
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

3 participants