unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	Christoph Scholtes <cschol2112@googlemail.com>
Cc: 9867@debbugs.gnu.org
Subject: bug#9867: 24.0.90; quit-window should provide quit-window-hook
Date: Tue, 20 Aug 2019 10:19:29 +0200	[thread overview]
Message-ID: <761cfbbf-88ef-d161-fb7b-a906c12e5307@gmx.at> (raw)
In-Reply-To: <87d0h01sqf.fsf@mouse.gnus.org>

 > It seems like Chong OK'd this hook at the time, but it was never added
 > to Emacs.  I've now added it to Emacs 27, because it seems like a useful
 > addition to have -- now modes that need to do some clean-up thing before
 > doing whatever `quit-window' does can just add that to the hook
 > (buffer-locally).

'quit-restore-window' can quit _any_ window not just the selected one.
This means that if a user puts something on a normal hook run by that
function, that something can only guess at which window is really quit
by that function.  Also, running a buffer-local value of that hook is
meaningless given the current implementation.  See the tribulations
run_window_configuration_change_hook runs into when trying to overcome
a similar problem (and note the unwind-protection overhead it incurs).

If people really need such a hook at all, please

- Make it either an abnormal hook run with the window quit as argument
   or run it from 'quit-window' but then only if it quits the selected
   window.

- Make sure to call any buffer-local value of that hook for the buffer
   of the window that is quit.

- Prefix it with 'quit-restore-' if you intend to run it from
   'quit-restore-window' (that function may be called by other
   functions as well).

- Fix the reference to the non-existent function 'quit-buffer'.

Thanks, martin





  reply	other threads:[~2019-08-20  8:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25  4:04 bug#9867: 24.0.90; quit-window should provide quit-window-hook Christoph Scholtes
2019-08-20  2:22 ` Lars Ingebrigtsen
2019-08-20  8:19   ` martin rudalics [this message]
2019-08-20 14:25     ` Eli Zaretskii
2019-08-21 20:23       ` Lars Ingebrigtsen
2019-08-21 20:18     ` Lars Ingebrigtsen
2019-08-22  8:08       ` martin rudalics
2019-08-23  0:08         ` Lars Ingebrigtsen
2019-08-23  7:46           ` martin rudalics
2019-08-23  8:05             ` Lars Ingebrigtsen
2019-08-23  8:42               ` martin rudalics
2019-08-25  5:24                 ` Lars Ingebrigtsen
2019-08-25  8:11                   ` martin rudalics
2019-08-30  9:40                     ` Lars Ingebrigtsen

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=761cfbbf-88ef-d161-fb7b-a906c12e5307@gmx.at \
    --to=rudalics@gmx.at \
    --cc=9867@debbugs.gnu.org \
    --cc=cschol2112@googlemail.com \
    --cc=larsi@gnus.org \
    /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).