[emacs-berlin] Suggested way to unset/undef/unalias stuff with emacsclient?

Abby Henríquez Tejera paradoja at gmail.com
Wed Jul 16 10:24:27 UTC 2025


Hi,

I usually use +name/variables or +name/functions liberally, but also
restart if I need the emacs server.

Still, for variables you have makunbound and for functions fmaunbound.
I think (not an expert) that the symbol is still internalized (that
is, the symbol, the name itself*, still occupies a bit of space in a
table of symbols), and to remove that you can use unintern.

\* Elisp, similar to other lisps (e.g. common lisps) has a table of
names that map to variables and functions separately (so the table has
a pointer to the variable, or the value itself if it makes sense, and
a pointer to the function, I think). The actual structure is an
obarray, but it's not inspectable from the Emacs help system, or I
don't know how to.

El mar, 15 jul 2025 a las 23:05, jman (<emacs-berlin at city17.xyz>) escribió:
>
> 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?
>
> _______________________________________________
> emacs-berlin mailing list
> emacs-berlin at emacs-berlin.org
> https://mailb.org/mailman/listinfo/emacs-berlin


More information about the emacs-berlin mailing list