[Top][All Lists]

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

Re: quit-window

From: martin rudalics
Subject: Re: quit-window
Date: Sun, 23 Oct 2011 21:00:37 +0200
User-agent: Thunderbird (Windows/20090302)

>> I think this could be fixed by changing `Info-exit' appropriately.  The
>> prefix argument should be passed on to `quit-window'.  (We can't run
>> `quit-window' directly in Info-mode since we have to deal with the
>> Info-standalone case.)
> Yes. You could do that as a short-term solution, but long term that a
> kludge. There are so many of these `exit-wrappers' that could be
> eliminated with a more consistent interface.

W'de have to handle this test

  (if Info-standalone

somehow without creating surprises for people using the standalone

>>> I have identified at least 18 modes that do something similar. Maybe
>>> some special case even needs to, but most of the time it could be
>>> cleaned up, IMO.
>> These were written before I rewrote `quit-window'.  Indeed I shall have
>> to look into these.
> I will provide a list of the ones I have found.

You might also try patching (some of) them right away so we know whether
there are any pitfalls ;-)

> No, `kill-buffer-hook' is too general, IMO. What if the buffer is buried
> and not killed? `quit-window-hook' would be a hook that is mainly used
> internally by modes to do their mode-specific cleanup before calling
> `quit-window'. `window-configuration-change-hook' also seems to be too
> general.
> We have to distinguish between two cases when calling the
> `quit-window-hook':
> 1. quit-window, buffer killed, clean up
> 2. quit-window, buffer buried, maybe do nothing?
> All of this decision making could be moved to the `quit-window-hook' so
> only modes that care implement it.

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


reply via email to

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