I've accidentally run the following:
(unintern variable)
where variable
's value was nil
.
How do I get nil
back without restarting Emacs?
I've accidentally run the following:
(unintern variable)
where variable
's value was nil
.
How do I get nil
back without restarting Emacs?
(defconst nil ())
seems to have the right effect; note that nil
and an empty list are indistinguishable in Emacs Lisp.
I looked at lread.c:4034
to see how nil
is created in an obarray
.
Note the comment at line 3896 in lread.c
:
/* There are plenty of other symbols which will screw up the Emacs
session if we unintern them, as well as even more ways to use
`setq' or `fset' or whatnot to make the Emacs session
unusable. Let's not go down this silly road. --Stef */
/* if (EQ (tem, Qnil) || EQ (tem, Qt))
error ("Attempt to unintern t or nil"); */
This explains why Emacs does not protect against (unintern nil)
and (unintern t)
.