# HG changeset patch # User Richard M. Stallman # Date 788559253 0 # Node ID b53a669d24135a3f672fff4af32fa6d14fe63af9 # Parent f4c81ad4471919f0e09f8b632c5ceafc575c05c4 (run-hook-with-args-until-failure): Return non-nil if no hook functions. diff -r f4c81ad44719 -r b53a669d2413 lisp/subr.el --- a/lisp/subr.el Tue Dec 27 04:01:02 1994 +0000 +++ b/lisp/subr.el Tue Dec 27 20:14:13 1994 +0000 @@ -598,21 +598,22 @@ To make a hook variable buffer-local, use `make-local-hook', not `make-local-variable'." - (and (boundp hook) - (symbol-value hook) - (let ((value (symbol-value hook)) - (success t)) - (while (and value success) - (if (eq (car value) t) - ;; t indicates this hook has a local binding; - ;; it means to run the global binding too. - (let ((functions (default-value hook))) - (while (and functions success) - (setq success (apply (car functions) args)) - (setq functions (cdr functions)))) - (setq success (apply (car value) args))) - (setq value (cdr value))) - success))) + ;; We must return non-nil if there are no hook functions! + (or (not (boundp hook)) + (not (symbol-value hook)) + (let ((value (symbol-value hook)) + (success t)) + (while (and value success) + (if (eq (car value) t) + ;; t indicates this hook has a local binding; + ;; it means to run the global binding too. + (let ((functions (default-value hook))) + (while (and functions success) + (setq success (apply (car functions) args)) + (setq functions (cdr functions)))) + (setq success (apply (car value) args))) + (setq value (cdr value))) + success))) ;; Tell C code how to call this function. (defconst run-hooks 'run-hooks