From: Richard M. Stallman Date: Tue, 7 Jul 1998 08:24:39 +0000 (+0000) Subject: (add-hook): Use member if FUNCTION is a compiled function. X-Git-Tag: emacs-20.3~371 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a180f6a5441f30c8b563a27ce259ae37c882e3d0;p=emacs.git (add-hook): Use member if FUNCTION is a compiled function. --- diff --git a/lisp/subr.el b/lisp/subr.el index 014217edf89..bf06f6d1699 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -603,7 +603,7 @@ function, it is changed to a list of functions." (and (local-variable-if-set-p hook) (not (memq t (symbol-value hook))))) ;; Alter the local value only. - (or (if (consp function) + (or (if (or (consp function) (compiled-function-p function)) (member function (symbol-value hook)) (memq function (symbol-value hook))) (set hook @@ -612,7 +612,7 @@ function, it is changed to a list of functions." (cons function (symbol-value hook))))) ;; Alter the global value (which is also the only value, ;; if the hook doesn't have a local value). - (or (if (consp function) + (or (if (or (consp function) (compiled-function-p function)) (member function (default-value hook)) (memq function (default-value hook))) (set-default hook