Mercurial > emacs
comparison lisp/subr.el @ 12296:005a5b596618
(add-hook): Use local local-variable-if-set-p.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 17 Jun 1995 19:47:52 +0000 |
parents | 95ebca0a74d8 |
children | 71727759437e |
comparison
equal
deleted
inserted
replaced
12295:b4731504d3ab | 12296:005a5b596618 |
---|---|
610 (if (or (not (listp old)) (eq (car old) 'lambda)) | 610 (if (or (not (listp old)) (eq (car old) 'lambda)) |
611 (set hook (list old)))) | 611 (set hook (list old)))) |
612 (if (or local | 612 (if (or local |
613 ;; Detect the case where make-local-variable was used on a hook | 613 ;; Detect the case where make-local-variable was used on a hook |
614 ;; and do what we used to do. | 614 ;; and do what we used to do. |
615 (and (local-variable-p hook) | 615 (and (local-variable-if-set-p hook) |
616 (not (memq t (symbol-value hook))))) | 616 (not (memq t (symbol-value hook))))) |
617 ;; Alter the local value only. | 617 ;; Alter the local value only. |
618 (or (if (consp function) | 618 (or (if (consp function) |
619 (member function (symbol-value hook)) | 619 (member function (symbol-value hook)) |
620 (memq function (symbol-value hook))) | 620 (memq function (symbol-value hook))) |