GNU bug report logs - #27502
25.2; auto-revert adds lambda to find-file-hook

Previous Next

Package: emacs;

Reported by: Pierre Neidhardt <ambrevar <at> gmail.com>

Date: Mon, 26 Jun 2017 19:54:01 UTC

Severity: minor

Found in version 25.2

Fixed in version 26.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pierre Neidhardt <ambrevar <at> gmail.com>
To: 27502 <at> debbugs.gnu.org
Subject: bug#27502: 25.2; auto-revert adds lambda to find-file-hook
Date: Mon, 26 Jun 2017 20:53:19 +0100
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




This bug report was last modified 7 years and 329 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.