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

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

bug#27502: 25.2; auto-revert adds lambda to find-file-hook


From: Michael Albinus
Subject: bug#27502: 25.2; auto-revert adds lambda to find-file-hook
Date: Sun, 02 Jul 2017 11:45:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Version: 26.1 
Pierre Neidhardt <ambrevar@gmail.com> writes:

Hi Pierre,

> It seems that autorevert.el:316 adds a lambda to `find-file-hook':
>
> (add-hook 'find-file-hook
>         (lambda ()
>           (setq-local auto-revert-tail-pos
>                         (nth 7 (file-attributes buffer-file-name)))))
>
> It's bad practice to add lambdas to hooks as it makes it harder to remove 
> them.
> We should use a named function instead.

I've fixed this (and a similar problem with `kill-buffer-hook') in the trunk.

Best regards, Michael.





reply via email to

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