Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
Is there any function which clears all unnecessary lisp
definitions in the interpreter and leaves a running Emacs in a
state as if just started with -Q?
well, you could try:
(defun those-who-do-not-study-history--- ()
(interactive)
(let ((kill-emacs-hook nil))
(kill-emacs "emacs -Q")))
but that's probably not completely portable, besides being overkill.
I'm tinkering around with my own mode and I'm concerned that
some old remaining definitions might interfere when loading a
modified mode file. So I'd prefer to start with a clean slate
(without quitting Emacs every time).
you can clear out all the functions and variables whose names
begin w/ a prefix using `mapatoms' with a function that recognizes
those names and makes their definitions void via `fmakunbound' and
`makunbound', respectively.