emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quit-window


From: martin rudalics
Subject: Re: quit-window
Date: Tue, 25 Oct 2011 12:04:03 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

>> W'de have to handle this test
>>
>>   (if Info-standalone
>>       (save-buffers-kill-emacs)
>>     (quit-window)))
>>
>> somehow without creating surprises for people using the standalone
>> version.
>
> What surprises are you thinking of?

If, in info.el we replace

    (define-key map "q" 'Info-exit)

by

    (define-key map "q" 'quit-window)

anyone who reads Info with the standalone reader won't have his emacs
killed when she types "q".  This would be surprising.

>> The problem is that the more hooks we have in one call, the more the
>> order in which these hooks are executed does matter.  For example, I
>> believe that when I run `kill-buffer', `kill-buffer-hook' is called
>> before `window-configuration-change-hook'.  When I run `quit-window'
>> with the first argument t, the order seems
>> `window-configuration-change-hook', `kill-buffer-hook', and possibly
>> another `window-configuration-change-hook' if the buffer was displayed
>> in a second window.  This is already very confusing for me in current
>> Emacs.
>
> That does seem confusing. I wonder why there are differences.

It makes sense to run `kill-buffer-hook' immediately after running the
`kill-buffer-query-functions' with the buffer to be killed current.
Only after that emacs decides that the buffer shall be removed from
display.  That `quit-window' first removes the window and then decides
whether to kill the buffer wouldn't be easy to change (mostly because
people don't like that `kill-buffer' calls `quit-window').

martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]