GNU bug report logs - #11606
24.1; Get rid of buffer local hook variables in find-file.el

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Sat, 2 Jun 2012 04:48:02 UTC

Severity: minor

Tags: notabug, wontfix

Found in version 24.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11606 in the body.
You can then email your comments to 11606 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11606; Package emacs. (Sat, 02 Jun 2012 04:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 02 Jun 2012 04:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.1; Get rid of buffer local hook variables in find-file.el
Date: Sat, 02 Jun 2012 12:44:54 +0800
ff-pre-find-hook
ff-pre-load-hook
ff-post-load-hook
ff-not-found-hook
ff-file-created-hook




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11606; Package emacs. (Sat, 02 Jun 2012 18:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 11606 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo <sdl.web <at> gmail.com>
Cc: 11606 <at> debbugs.gnu.org
Subject: Re: bug#11606: 24.1;
	Get rid of buffer local hook variables in find-file.el
Date: Sat, 02 Jun 2012 13:57:18 -0400
> ff-pre-find-hook
> ff-pre-load-hook
> ff-post-load-hook
> ff-not-found-hook
> ff-file-created-hook

I like removing things, but could you expand on why you think we should
remove these?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11606; Package emacs. (Sun, 03 Jun 2012 02:10:02 GMT) Full text and rfc822 format available.

Message #11 received at 11606 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 11606 <at> debbugs.gnu.org
Subject: Re: bug#11606: 24.1;
	Get rid of buffer local hook variables in find-file.el
Date: Sun, 03 Jun 2012 10:07:28 +0800
On 2012-06-03 01:57 +0800, Stefan Monnier wrote:
> I like removing things, but could you expand on why you think we should
> remove these?

Not removing the hooks themselves but the buffer-local bits, i.e.

=== modified file 'lisp/find-file.el'
--- lisp/find-file.el	2012-05-04 05:14:14 +0000
+++ lisp/find-file.el	2012-06-03 02:06:57 +0000
@@ -284,11 +284,6 @@
 ;; No user definable variables beyond this point!
 ;; ==============================================
 
-(make-variable-buffer-local 'ff-pre-find-hook)
-(make-variable-buffer-local 'ff-pre-load-hook)
-(make-variable-buffer-local 'ff-post-load-hook)
-(make-variable-buffer-local 'ff-not-found-hook)
-(make-variable-buffer-local 'ff-file-created-hook)
 (make-variable-buffer-local 'ff-case-fold-search)
 (make-variable-buffer-local 'ff-always-in-other-window)
 (make-variable-buffer-local 'ff-ignore-include)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11606; Package emacs. (Sun, 03 Jun 2012 03:21:02 GMT) Full text and rfc822 format available.

Message #14 received at 11606 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo <sdl.web <at> gmail.com>
Cc: 11606 <at> debbugs.gnu.org
Subject: Re: bug#11606: 24.1;
	Get rid of buffer local hook variables in find-file.el
Date: Sat, 02 Jun 2012 23:18:15 -0400
>> I like removing things, but could you expand on why you think we should
>> remove these?

> Not removing the hooks themselves but the buffer-local bits, i.e.

I also like removing those, but I still don't know why you think these
can be removed safely.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11606; Package emacs. (Sun, 03 Jun 2012 04:09:01 GMT) Full text and rfc822 format available.

Message #17 received at 11606 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 11606 <at> debbugs.gnu.org
Subject: Re: bug#11606: 24.1;
	Get rid of buffer local hook variables in find-file.el
Date: Sun, 03 Jun 2012 12:05:56 +0800
On 2012-06-03 11:18 +0800, Stefan Monnier wrote:
> I also like removing those, but I still don't know why you think these
> can be removed safely.

I was thinking that add-hook supports adding local hooks which might be
better than making those hooks buffer-local. What are your concerns
about their safety?

Leo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11606; Package emacs. (Sun, 03 Jun 2012 15:21:02 GMT) Full text and rfc822 format available.

Message #20 received at 11606 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo <sdl.web <at> gmail.com>
Cc: 11606 <at> debbugs.gnu.org
Subject: Re: bug#11606: 24.1;
	Get rid of buffer local hook variables in find-file.el
Date: Sun, 03 Jun 2012 11:18:23 -0400
>> I also like removing those, but I still don't know why you think these
>> can be removed safely.
> I was thinking that add-hook supports adding local hooks which might be
> better than making those hooks buffer-local.

That's generally true, but (add-hook 'foo 'bar) operates on the local
part if the var is `make-variable-buffer-local', so the removal you
suggest would break code that relies on this detail.

> What are your concerns about their safety?

My concern is that I know nothing about these variables, so I have no
way to judge whether removing those things is safe.


        Stefan




Added tag(s) notabug and wontfix. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 03 Jun 2012 23:35:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11606; Package emacs. (Tue, 05 Jun 2012 16:18:02 GMT) Full text and rfc822 format available.

Message #25 received at 11606 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Leo <sdl.web <at> gmail.com>
Cc: 11606 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#11606: 24.1;
	Get rid of buffer local hook variables in find-file.el
Date: Tue, 5 Jun 2012 18:14:13 +0200
On Sun, Jun 3, 2012 at 6:05 AM, Leo <sdl.web <at> gmail.com> wrote:

> I was thinking that add-hook supports adding local hooks which might be
> better than making those hooks buffer-local.

Most hooks and hook-like variables can be useful as either global or
buffer-local, and for these (add-hook X Y Z t) or (set
(make-local-variable X) Y) is the way to go.

But there are some hooks that make no sense as global variables, or
are never used that way. For these, being automatically buffer-local
is, in fact, less error prone.

A notable example is revert-buffer-function, which strangely we have
not made automatically-buffer local even when the 31 packages in
lisp/** that assign it do convert it to buffer-local first...

    Juanma




bug closed, send any further explanations to 11606 <at> debbugs.gnu.org and Leo <sdl.web <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 01 Feb 2014 08:09:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 01 Mar 2014 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 113 days ago.

Previous Next


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