aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/subr.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index a29d4e177a8..3c4308bf8c2 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -652,7 +652,11 @@ function, it is changed to a list of functions."
652 (let ((old (symbol-value hook))) 652 (let ((old (symbol-value hook)))
653 (if (or (not (listp old)) (eq (car old) 'lambda)) 653 (if (or (not (listp old)) (eq (car old) 'lambda))
654 (set hook (list old)))) 654 (set hook (list old))))
655 (if local 655 (if (or local
656 ;; Detect the case where make-local-variable was used on a hook
657 ;; and do what we used to do.
658 (and (local-variable-p hook)
659 (not (memq t (symbol-value hook)))))
656 ;; Alter the local value only. 660 ;; Alter the local value only.
657 (or (if (consp function) 661 (or (if (consp function)
658 (member function (symbol-value hook)) 662 (member function (symbol-value hook))
@@ -687,7 +691,11 @@ To make a hook variable buffer-local, always use
687 (null (symbol-value hook)) ;value is nil, or 691 (null (symbol-value hook)) ;value is nil, or
688 (null function)) ;function is nil, then 692 (null function)) ;function is nil, then
689 nil ;Do nothing. 693 nil ;Do nothing.
690 (if local 694 (if (or local
695 ;; Detect the case where make-local-variable was used on a hook
696 ;; and do what we used to do.
697 (and (local-variable-p hook)
698 (not (memq t (symbol-value hook)))))
691 (let ((hook-value (symbol-value hook))) 699 (let ((hook-value (symbol-value hook)))
692 (if (consp hook-value) 700 (if (consp hook-value)
693 (if (member function hook-value) 701 (if (member function hook-value)