No matter how many times I reload the file .emacs,
M-x load-file RET ~/.emacs RET
I want the results to be the same as the first time. I want to make an .emacs idempotent file .
Motivation
I know that I can surgically evaluate a region ( C-c C-r), defun ( C-M-x), or the latest sexp ( C-x C-e). I often take this more advanced approach when making small changes. However, when I work with the file again, .emacsI sometimes want to finally check the results of the change by reloading the entire file .emacs. Restarting emacs gets old quickly every time, especially when doing the main .emacshousehold.
Specific steps
What specific steps need to be taken to update my file .emacsto replace non-idempotent operations with idempotent ones?
For instance,
- Find the "-hook" and replace the direct additions with hooks with calls
add-hookthat will not re-add the function to the hook if it already exists. - Replace the switching of any flags with a direct set or clear. Beware ?? in particular.
- ...
A complete checklist would be ideal, but any key individual checks that happen to you will also be helpful.
source
share