I'd like to save, for instance, my find-file and Meta-X history in Emacs' mini-buffer so I can recall commands later in a different session.
The simplest way to enter a minibuffer argument is to type the text, then RET to submit the argument and exit the minibuffer. Alternatively, you can type C-g to exit the minibuffer by canceling the command asking for the argument (see Quitting and Aborting).
Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special data type. You can think of the contents of a buffer as a string that you can extend; insertions and deletions may occur in any part of the buffer.
C-x h will select the entire buffer. You can search for help within Emacs using the built-in help system. C-h f will look for help for specific functions.
As Trey Jackson said, you want to put this:
(savehist-mode)
in your Emacs start up file, then restart Emacs. (Calling it interactively will stomp on your current mini-buffer history, so you may not want to do that.)
It's also worth pointing out that you can persist other variables across sessions by adding them to savehist-additional-variables
, like so:
(setq savehist-additional-variables '(kill-ring search-ring regexp-search-ring))
You may also want to customize savehist-file
, to pick the location where Emacs saves all this stuff:
(setq savehist-file "~/.emacs.d/tmp/savehist")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With