GNU bug report logs -
#23933
25.1.50; Run a buffer-local hook with mapc
Previous Next
Reported by: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sun, 10 Jul 2016 10:19:02 UTC
Severity: minor
Found in version 25.1.50
Done: Tino Calancha <tino.calancha <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #49 received at 23933 <at> debbugs.gnu.org (full text, mbox):
> (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
This bug report was last modified 8 years and 338 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.