[emacs-berlin] Suggested way to unset/undef/unalias stuff with emacsclient?
jman
emacs-berlin at city17.xyz
Tue Jul 15 22:05:39 UTC 2025
Michael Heerdegen <michael_heerdegen at web.de> writes:
> You describe a thing that has a psychological nature. In twenty years I
> never heard of anyone where what you describe had a practical
> consequence. It's more about a feeling that the environment has to be
> cleaned.
>
> If you want to experiment, use a new separate session. And inside your
> session use the prefix "my-..." for definitions.
Ok, so you're suggesting using "throwaway" definitions when playing and testing and then assign the
final name when everything works - correct?
Yes, that's certainly a way to workaround the issue, but I find it a bit inelegant.
Let me provide some examples of disadvantages of never restarting emacs:
- I change my mind about the name of a function. I'd rather undefine the old one and only keep the
new one. Trivial example, I've recently renamed "my/insert-date-YYYYMMDD" to
"my/insert-date-YYYY-MM-DD".
- Some assignments are "additive", example lists. If I make a mistake I can't reset to the original
state unless I restart or figure out how to go back to the original state.
- If I enable a package by evaluating a lisp file, how can I remove all that it defined without
restarting?
- If I want to test another revision of a package from git, how can I go back to the previous one
and be sure there are no leftovers or conflicts?
- How can I test if my init.el is still fine after some changes?
- I want to free up a keymap assignment. Either I unset it or I restart emacs after commenting it
out in my config
- sometimes I use the scratch buffer as a playground, often with variables names set globally. If I
`(setq result ...)` there's a high risk I am overwriting something else?
These are real examples off the top of my head that I had to deal in the past. How do other emacs
users deal with these instead?
More information about the emacs-berlin
mailing list