I was wondering if anyone knew of a way or recommend a method to save often use search and replace queries for future use after emacs restarts?

  • 4
    (savehist-mode 1) makes your minibuffer history lists persist between sessions.
    – phils
    Nov 24, 2016 at 11:51

1 Answer 1

  • If you are asking how to save search queries then you need only save the variable search-ring or regexp-search-ring (or both) -- those are your search histories. You can use option savehist-additional-variables for that (and turn on savehist-mode: (savehist-mode 1).

  • If you are how to save the results of searches then this is one way: Use Icicles and search using Icicles search. With that, the search hits for a given search query are completion candidates. And you can save the current completion candidates anytime and restore them later. You can save them persistently or just for the current session (e.g. across any number of different actions, including different searches).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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