emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add-hook sets hook globally if buffer-local hook is nil


From: Richard Stallman
Subject: Re: add-hook sets hook globally if buffer-local hook is nil
Date: Thu, 23 Oct 2003 14:37:52 -0400

    Indeed, I think it's a bug.  It's introduced by the change below
    which I think should be reverted.  What was the reason for the change ?


            Stefan


    @@ -856,9 +870,7 @@
                  (set (make-local-variable hook) (list t)))
         ;; Detect the case where make-local-variable was used on a hook
         ;; and do what we used to do.
    -    (when (and (local-variable-p hook)
    -          (not (and (consp (symbol-value hook))
    -                    (memq t (symbol-value hook)))))
    +    (unless (and (consp (symbol-value hook)) (memq t (symbol-value hook)))
           (setq local t)))
       (let ((hook-value (if local (symbol-value hook) (default-value hook))))
         ;; If the hook value is a single function, turn it into a list.

i dont think this change causes the problem.
this code detects case where hook var has a local binding
and it wasnt made with add-hook.
i think thye change makes it safer.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]