Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I save my mini-buffer history in Emacs?

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.

like image 842
Jonathon Watney Avatar asked Aug 04 '09 18:08

Jonathon Watney


People also ask

How do I close Mini Buffer Emacs?

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).

What is Emacs buffer?

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.

How do I select all Emacs?

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.


1 Answers

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") 
like image 166
genehack Avatar answered Sep 20 '22 20:09

genehack