unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Pierre Neidhardt <ambrevar@gmail.com>
Cc: 27502-done@debbugs.gnu.org
Subject: bug#27502: 25.2; auto-revert adds lambda to find-file-hook
Date: Sun, 02 Jul 2017 11:45:17 +0200	[thread overview]
Message-ID: <87tw2vw4sy.fsf@detlef> (raw)
In-Reply-To: <20170626195319.GA868@gmail.com> (Pierre Neidhardt's message of "Mon, 26 Jun 2017 20:53:19 +0100")

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	other threads:[~2017-07-02  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 19:53 bug#27502: 25.2; auto-revert adds lambda to find-file-hook Pierre Neidhardt
2017-07-02  9:45 ` Michael Albinus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tw2vw4sy.fsf@detlef \
    --to=michael.albinus@gmx.de \
    --cc=27502-done@debbugs.gnu.org \
    --cc=ambrevar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).