(think)

An online novel about the Source, the Force, the real life and everything in between...

Emacs Tip #6: Remove Variable & Function Definitions

From time to time you might want to void (unbind) a variable or a function definition in Emacs. Most often you’ll probably be dealing with variables created with defvar whose values you’ll want to update. The magic functions you need are the following:

1
2
3
4
5
;; this will make the symbol my-nasty-variable's value void
(makunbound 'my-nasty-variable)
;; this will make the symbol my-nasty-function's
;; function definition void
(fmakunbound 'my-nasty-function)

The names aren’t exactly intuitive and even I happen to forget them from time to time. Now at least I’ll now where to look for them if that happens again. :–)

Comments