]> git.eshelyaron.com Git - emacs.git/commitdiff
(remove-hook): Function deleted.
authorRichard M. Stallman <rms@gnu.org>
Sat, 13 Nov 1993 08:21:16 +0000 (08:21 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 13 Nov 1993 08:21:16 +0000 (08:21 +0000)
lisp/emacs-lisp/lucid.el

index eaa405afd336484a35177e9b9fe4224cd89b91f9..1334505a62b7c8cf8d0f3dbac1e4d375e039ad39 100644 (file)
     (if tail
        (setcdr tail new-parent))))
 
-(defun remove-hook (hook-var function)
-  "Remove a function from a hook, if it is present.
-First argument HOOK-VAR (a symbol) is the name of a hook, second
- argument FUNCTION is the function to remove (compared with `eq')."
-  (if (boundp 'hook-var)
-      (let ((old (symbol-value hook-var)))
-       ;; If the hook value is a single function, turn it into a list.
-       (if (or (not (listp old)) (eq (car old) 'lambda))
-           (set hook-var (list old)))
-       ;; Now delete FUNCTION.
-       (set hook-var (delq function (symbol-value hook-var))))))
-
 (defun remprop (symbol prop)
   (let ((plist (symbol-plist symbol)))
     (while (eq (car plist) prop)