unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* kill-buffer-hook permanent-local
@ 2003-06-01 18:35 Stefan Monnier
  2003-06-03  4:07 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2003-06-01 18:35 UTC (permalink / raw)



Shouldn't kill-buffer-hook be permanent-local ?

After all, if you want to be told when the buffer gets killed,
you probably don't want that to be defeated by a mere change
of major-mode.
More specifically, either you want to be told both when the buffer is killed
and when the mode changes, or you want to be told when the buffer is killed
whether or not the mode ever changes.

Looking at the various cases when kill-buffer-hook is used:

- gnus mml-destroy-buffers: called by change-major-mode-hook as well,
  so permanent-localness is irrelevant.
- MH-E uses it for mh-tidy-draft-buffer (kill auxiliary buffer) and
  mh-mime-cleanup (remove MIME info from a global hash table).  It seems
  that in both cases it would be better if the kill-buffer-hook were
  permanent-local and it would at least not hurt.
- game-grid-kill-timer: also needs permanent-local.
- pong-quit: basically the same as game-grid-kill-timer.
- idlwave-kill-buffer-update: not clear which way is best, but since
  the hook checks the major-mode, it probably doesn't make much of
  a difference.
- idlwave-shell-delete-temp-files: here also permanentness would help.
- idlwave-shell-kill-shell-buffer-confirm: doesn't make much of a difference
  either way.
- register-swap-out: this turns markers into filename+offset and would
  also benefit from permanentness.
- server-kill-buffer: again, making it permanent-local would help.

uniquify.el used to use it locally but stopped because it needed it
to be permanent-local.  The code now uses a global hook instead
and checks whether the hook should be run using a permanent-local
variable ;-)

I suspect a few other global uses could be made buffer-local if the
hook was permanent-local.

Any objection ?


	Stefan

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

* Re: kill-buffer-hook permanent-local
  2003-06-01 18:35 kill-buffer-hook permanent-local Stefan Monnier
@ 2003-06-03  4:07 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2003-06-03  4:07 UTC (permalink / raw)
  Cc: emacs-devel

    Shouldn't kill-buffer-hook be permanent-local ?

I think it is ok to make this change.
If a certain major mode wants to set up a hook value
that should not remain if you change the mode, it could
use change-major-mode-hook to remove that hook.

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

end of thread, other threads:[~2003-06-03  4:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-01 18:35 kill-buffer-hook permanent-local Stefan Monnier
2003-06-03  4:07 ` Richard Stallman

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