[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help-window-select and info-lookup-symbol
From: |
martin rudalics |
Subject: |
Re: help-window-select and info-lookup-symbol |
Date: |
Tue, 21 Jul 2009 15:27:26 +0200 |
User-agent: |
Thunderbird 2.0.0.21 (Windows/20090302) |
>> A brute force
>> approach (currently used by info or backtrace) simply restores W1 whe
>> you press `q' which all so often drives me mad because it destroys the
>> windows and window-buffer associations I have created in between.
>
> For the debugger it's IMO the best option.
When debugging an application which creates a new buffer I have to
create that buffer before running the application in order to see how it
gets filled. Otherwise, the debugger won't let me see it for long.
Maybe I could show it in another frame, but I don't want to resize my
main frame in order to make another one visible.
>> Now theoretically, I could restore W1 if and only if the configurations
>> W2 and W3 are equal. In practice, however, this approach often failed
>> here. Hence, I tried to base the comparison on a weaker predicate of
>> equality which ignored the identities of buffers displayed in other
>> windows and the relative sizes of windows. I got it to work for help
>> buffers but was not able to make it work realiably with info buffers.
>
> Comparing W2 and W3 per compare-window-configurations would probably
> work as a start, but point should probably not be restored.
My info windows are sometimes open for a couple of minutes, mostly
because I'm to lazy to quit them. Quitting them at last offers me an
interesting albeit chaotic view of my session's archeology.
> (defun slime-close-popup-window ()
> (when slime-popup-restore-data
> (destructuring-bind (popup-window selected-window old-buffer)
> slime-popup-restore-data
> (bury-buffer)
> (when (eq popup-window (selected-window))
> (cond ((and (not old-buffer) (not (one-window-p)))
> (delete-window popup-window))
> ((and old-buffer (buffer-live-p old-buffer))
> (set-window-buffer popup-window old-buffer))))
> (when (window-live-p selected-window)
> (select-window selected-window)))
> (kill-local-variable 'slime-popup-restore-data)))
>
> popup-window is the window that displays the help content at W2.
> selected-window was selected at W1.
> old-buffer was the buffer associated with popup-window at W1.
How do you get the `old-buffer' and `popup-window' values in general?
By comparing window configurations before and after `display-buffer'?
My code included for every window a variable telling whether that window
was split off by `display-buffer' or which buffer the window displayed
before it was "used" by `display-buffer'.
I recall it proved very nasty to save the old buffer value when the
window is re-used again by `display-buffer' because I had to avoid that
a "valuable" non-help content buffer value would get overwritten by the
"uselss" value of a help-content buffer.
martin
- help-window-select and info-lookup-symbol, Helmut Eller, 2009/07/19
- Re: help-window-select and info-lookup-symbol, martin rudalics, 2009/07/20
- Re: help-window-select and info-lookup-symbol, Helmut Eller, 2009/07/21
- Re: help-window-select and info-lookup-symbol,
martin rudalics <=
- Re: help-window-select and info-lookup-symbol, Helmut Eller, 2009/07/21
- Re: help-window-select and info-lookup-symbol, martin rudalics, 2009/07/21
- Re: help-window-select and info-lookup-symbol, Helmut Eller, 2009/07/21
- Re: help-window-select and info-lookup-symbol, martin rudalics, 2009/07/22
- Re: help-window-select and info-lookup-symbol, Helmut Eller, 2009/07/22
- Re: help-window-select and info-lookup-symbol, martin rudalics, 2009/07/26
- Re: help-window-select and info-lookup-symbol, Helmut Eller, 2009/07/26
- Re: help-window-select and info-lookup-symbol, martin rudalics, 2009/07/26
- Re: help-window-select and info-lookup-symbol, Helmut Eller, 2009/07/26
- Re: help-window-select and info-lookup-symbol, martin rudalics, 2009/07/26