aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-12-27 20:14:13 +0000
committerRichard M. Stallman1994-12-27 20:14:13 +0000
commit3d1743f7e08eafdc689ec38da0fd0d33f1db184e (patch)
tree8324be2767cf8595933f7d7162c6d1ec31ea3d47
parente65a6404e54e6158ea0b6a4a74959dd08cd7b3b3 (diff)
downloademacs-3d1743f7e08eafdc689ec38da0fd0d33f1db184e.tar.gz
emacs-3d1743f7e08eafdc689ec38da0fd0d33f1db184e.zip
(run-hook-with-args-until-failure):
Return non-nil if no hook functions.
-rw-r--r--lisp/subr.el31
1 files changed, 16 insertions, 15 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 261a7b670d9..ffaab475073 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -598,21 +598,22 @@ If all the functions return non-nil, we return non-nil.
598 598
599To make a hook variable buffer-local, use `make-local-hook', not 599To make a hook variable buffer-local, use `make-local-hook', not
600`make-local-variable'." 600`make-local-variable'."
601 (and (boundp hook) 601 ;; We must return non-nil if there are no hook functions!
602 (symbol-value hook) 602 (or (not (boundp hook))
603 (let ((value (symbol-value hook)) 603 (not (symbol-value hook))
604 (success t)) 604 (let ((value (symbol-value hook))
605 (while (and value success) 605 (success t))
606 (if (eq (car value) t) 606 (while (and value success)
607 ;; t indicates this hook has a local binding; 607 (if (eq (car value) t)
608 ;; it means to run the global binding too. 608 ;; t indicates this hook has a local binding;
609 (let ((functions (default-value hook))) 609 ;; it means to run the global binding too.
610 (while (and functions success) 610 (let ((functions (default-value hook)))
611 (setq success (apply (car functions) args)) 611 (while (and functions success)
612 (setq functions (cdr functions)))) 612 (setq success (apply (car functions) args))
613 (setq success (apply (car value) args))) 613 (setq functions (cdr functions))))
614 (setq value (cdr value))) 614 (setq success (apply (car value) args)))
615 success))) 615 (setq value (cdr value)))
616 success)))
616 617
617;; Tell C code how to call this function. 618;; Tell C code how to call this function.
618(defconst run-hooks 'run-hooks 619(defconst run-hooks 'run-hooks