all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el
@ 2012-06-02  4:44 Leo
  2012-06-02 17:57 ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Leo @ 2012-06-02  4:44 UTC (permalink / raw)
  To: 11606

ff-pre-find-hook
ff-pre-load-hook
ff-post-load-hook
ff-not-found-hook
ff-file-created-hook





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el
  2012-06-02  4:44 bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el Leo
@ 2012-06-02 17:57 ` Stefan Monnier
  2012-06-03  2:07   ` Leo
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2012-06-02 17:57 UTC (permalink / raw)
  To: Leo; +Cc: 11606

> 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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el
  2012-06-02 17:57 ` Stefan Monnier
@ 2012-06-03  2:07   ` Leo
  2012-06-03  3:18     ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Leo @ 2012-06-03  2:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 11606

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)






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el
  2012-06-03  2:07   ` Leo
@ 2012-06-03  3:18     ` Stefan Monnier
  2012-06-03  4:05       ` Leo
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2012-06-03  3:18 UTC (permalink / raw)
  To: Leo; +Cc: 11606

>> 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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el
  2012-06-03  3:18     ` Stefan Monnier
@ 2012-06-03  4:05       ` Leo
  2012-06-03 15:18         ` Stefan Monnier
  2012-06-05 16:14         ` Juanma Barranquero
  0 siblings, 2 replies; 7+ messages in thread
From: Leo @ 2012-06-03  4:05 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 11606

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el
  2012-06-03  4:05       ` Leo
@ 2012-06-03 15:18         ` Stefan Monnier
  2012-06-05 16:14         ` Juanma Barranquero
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2012-06-03 15:18 UTC (permalink / raw)
  To: Leo; +Cc: 11606

>> 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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el
  2012-06-03  4:05       ` Leo
  2012-06-03 15:18         ` Stefan Monnier
@ 2012-06-05 16:14         ` Juanma Barranquero
  1 sibling, 0 replies; 7+ messages in thread
From: Juanma Barranquero @ 2012-06-05 16:14 UTC (permalink / raw)
  To: Leo; +Cc: 11606

On Sun, Jun 3, 2012 at 6:05 AM, Leo <sdl.web@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-06-05 16:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-02  4:44 bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el Leo
2012-06-02 17:57 ` Stefan Monnier
2012-06-03  2:07   ` Leo
2012-06-03  3:18     ` Stefan Monnier
2012-06-03  4:05       ` Leo
2012-06-03 15:18         ` Stefan Monnier
2012-06-05 16:14         ` Juanma Barranquero

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.