Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun undef--verify (msg sym)
- "Make sure the symbol should be unbound."
- (when (symbolp sym)
- (intern-soft (read-string (concat msg " ") (symbol-name sym)))))
- (defun undef-variable (&optional sym)
- "Unbind the variable of the supllied symbol or the symbol at the point."
- (interactive (list (undef--verify "Unbind variable:" (symbol-at-point))))
- (when (symbolp sym)
- (makunbound sym)))
- (defun undef-function (&optional sym)
- "Unbind the function of the supllied symbol or the symbol at the point."
- (interactive (list (undef--verify "Unbind variable:" (symbol-at-point))))
- (when (symbolp sym)
- (fmakunbound sym)))
- (defun undef-symbol (&optional sym)
- "Unintern the supllied symbol or the symbol at the point."
- (interactive (list (undef--verify "Unbind variable:" (symbol-at-point))))
- (when (symbolp sym)
- (unintern sym obarray)))
- ;; Suggested key bindings.
- (global-set-key (kbd "C-c u v") #'undef-variable)
- (global-set-key (kbd "C-c u f") #'undef-function)
- (global-set-key (kbd "C-c u s") #'undef-symbol)
Advertisement
Add Comment
Please, Sign In to add comment