[Top][All Lists]

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

bug#23933: 25.1.50; Run a buffer-local hook with mapc

From: Stefan Monnier
Subject: bug#23933: 25.1.50; Run a buffer-local hook with mapc
Date: Sun, 10 Jul 2016 17:12:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> (defun ediff-really-quit (reverse-default-keep-variants)
>   ...
>    (let (...
>          (after-quit-hook-internal ediff-after-quit-hook-internal)

> And as mentioned in the patch, ediff-filegroup-action calls add-hook
> with non-nil LOCAL on ediff-after-quit-hook-internal.

And there we have a problem.  When t is encountered in the buffer-local
part of ediff-after-quit-hook-internal, it means to run the global part
of ediff-after-quit-hook-internal, but when we copy the list to
after-quit-hook-internal, this link is broken and run-hooks can't know
that a t in after-quit-hook-internal means to run the functions found in
the global part of ediff-after-quit-hook-internal.

Or looked at it another way, this let-binding does not copy the whole
content of the hook, only the buffer-local part of it which is not
sufficient when the hook has a buffer-local value as well as a non-nil
global value.

Most likely it works OK in practice because
ediff-after-quit-hook-internal typically has a nil global binding.

It might make sense to use something like:

          ;; FIXME: Here we ignore the global part of the
          ;; ediff-after-quit-hook-internal hook.
          (after-quit-hook-internal (remq t ediff-after-quit-hook-internal))

-- Stefan

reply via email to

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