Minor enhancements to the excellent Selectrum package
The one thing that I miss from the Counsel package is how keybindings are displayed next to the functions when you run M-x
. Another thing that I want is for every active or inactive minor mode to be colored red or green.
If you’re anything like me, you’ll like this package.
NOTE: Emacs 28 should include most (if not all) of these keybinding annotations by default, so this package will most likely no longer be that relevant. (It does still offer minor mode highlighting.) As of writing, I’m running Emacs 27.1, so I needed to write a package to add these annotations for me.
Until I get this package up on Melpa, you’ll have to install from source.
If you’re using straight.el, this incantation should work:
(straight-use-package '(gilded-select :type git :host github :repo "ashton314/gilded-select"))
(gilded-select-mode +1)
Otherwise, follow the installation instructions for Selectrum, clone this repository, put gilded-select.el into your load path, and then add
(require 'gilded-select)
(gilded-select-mode +1)
into your .emacs
file.
Turning on gilded-select-mode
will automatically turn on selectrum-mode
as well.
Run M-x gilded-rehash-keybindings
when switching to a new major mode to index the keybindings for that mode.a
I’m still figuring out the best way to gather up all the keybindings. Right now, Gilded-Select rather stupidly maps over the obarray
[fn:1] and builds up a hash table so running M-x
is fast. If you have any suggestions on how this can be improved, please drop me a line or submit a pull request.
This is my very first published package; I’m struggling to find a good set of best-practices for creating and distributing packages, so any pull requests or suggestions are welcome.
Ashton Wiersdorf
[fn:1] obarray
variable documentation: (run C-h v obarray RET
)
Symbol table for use by ‘intern’ and ‘read’. It is a vector whose length ought to be prime for best results. The vector’s contents don’t make sense if examined from Lisp programs; to find all the symbols in an obarray, use ‘mapatoms’.