Exploring Emacs packages25 Jan 2015
Currently, MELPA hosts over
2250 packages. That's
quite a large number, although it's still feasible to try most of the
popular ones. In comparison,
apt-cache pkgnames | wc
gives me the number
50250. I don't recall calling
pkgnames ever before, while I call
package-list-packages all the
time. I suppose that this will have to change when the number of
packages grows further.
I usually explore packages just as they show up as new in
I'll share the two tools that I use for exploring them.
Smex is an M-x enhancement for Emacs. In addition to executing commands faster, it gives you an option to jump to the current command's definition with M-..
Here's how I bind
(require 'smex) (global-set-key "\C-t" 'smex) (defun smex-prepare-ido-bindings () (define-key ido-completion-map (kbd "C-,") 'smex-describe-function) (define-key ido-completion-map (kbd "C-w") 'smex-where-is) (define-key ido-completion-map (kbd "C-.") 'smex-find-function) (define-key ido-completion-map (kbd "C-a") 'move-beginning-of-line) ;; (define-key ido-completion-map "\C-i" 'smex-helm) ;; (define-key ido-completion-map " " 'smex-helm) )
I don't feel bad at all for unbinding
C-t is such a prime binding, that only the best commands
can deserve it. And since I touch-type, it's easier for me to hit
M-DEL and retype the word when I notice a mistake, than to
carefully navigate to the mistake location and call
with surgical precision. On the other hand, the number of Emacs
packages is only going to grow, so it becomes less and less feasible
to bind everything. Instead, seldom used stuff can be called though
smex. For instance, I don't bind
speed-type and call them via
Back to the point, C-t ... C-.
smex-find-function) allows me to quickly jump to the source of the
package that I want to explore.
Once I'm in the source code, I can quickly get an overview with
lispy. It uses CEDET's semantic
module to get a list of tags in current directory with
helm for completion. In my
opinion, it's much prettier than
helm-semantic. It also
explores more tags for Emacs Lisp, for instance it will capture
A new cute feature that I added recently is a different background for
user-visible functions, i.e. the ones that are callable by
smex. Here's how it looks like, for the
speed-type package (interactive functions have a purple background):
If the image text looks too small, you can right click / view image in
your browser. Here, I can see at a glance, that there are three
commands that I can call. I can also see a few variables, two of them
--, so they're probably customizable.