Emacs registers are useful but I find remembering the contents of them difficult. Figuring out which register I stored that particular macro in is a pain.

Is there a package that allows registers to be referred to by a meaningful name (rather than a single key)? If not, does anyone know of a different solution?


One certainly could write alternative commands which use named registers (internally registers can be anything comparable with eq), but as of Emacs 24.4 I feel like Emacs already solves your main problems?

Quoting from the NEWS file:

*** All interactive commands that read a register (`copy-to-register', etc.)
now display a temporary window after `register-preview-delay' seconds
that summarizes existing registers.  To disable this, set that option to nil.
Interactive commands that read registers and want to make use of this
should use `register-read-with-preview' to read register names.

So when you can't remember which register you used, just pause a moment before you need to enter it, and Emacs will show you the options with most likely enough of the content to identify what it is you're after.

It's true that in your example case of keyboard macros, the summary register content may be less useful, but there's no need to do what you've asked for when it comes to keyboard macros -- you can already give those names!

See: C-hig (emacs) Save Keyboard Macro

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.