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

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

[debbugs-tracker] bug#27502: closed (25.2; auto-revert adds lambda to fi


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#27502: closed (25.2; auto-revert adds lambda to find-file-hook)
Date: Sun, 02 Jul 2017 09:46:02 +0000

Your message dated Sun, 02 Jul 2017 11:45:17 +0200
with message-id <address@hidden>
and subject line Re: bug#27502: 25.2; auto-revert adds lambda to find-file-hook
has caused the debbugs.gnu.org bug report #27502,
regarding 25.2; auto-revert adds lambda to find-file-hook
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
27502: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=27502
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 25.2; auto-revert adds lambda to find-file-hook Date: Mon, 26 Jun 2017 20:53:19 +0100 User-agent: Mutt/1.8.3 (2017-05-23)
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.



In GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.10)
 of 2017-04-22 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
System Description:     Arch Linux



--- End Message ---
--- Begin Message --- Subject: Re: 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 <address@hidden> 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.


--- End Message ---

reply via email to

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