[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames
From: |
martin rudalics |
Subject: |
Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames |
Date: |
Thu, 2 Feb 2023 17:39:44 +0100 |
> And note one thing: When you call 'get-lru-window' twice in a row, it
> will usually _not_ return a window it has internally considered as
> "second best" provided it finds a best one.
>
> Consider a frame with three windows, one of them full width and the
> other two, including the selected one, not full width. In this case
> 'get-lru-window' will always return the full width window even if it has
> a higher use time than the not selected, not full width one.
A tentative solution for this and the other problems mentioned in this
thread is in the attached diff. It should be able to digest the
following form.
(let* ((window (selected-window))
use-time)
;; Make window at bottom mru.
(select-window (split-window))
;; Make window on right mru.
(select-window (split-window window nil t))
;; Make initial window mru so the lru window is the one at bottom.
(select-window window)
(setq use-time (window-use-time))
(display-buffer
(get-buffer-create "*foo*")
`((display-buffer-use-least-recent-window)
(window-min-width . full-width)
(lru-time . ,use-time)
))
(display-buffer
(get-buffer-create "*bar*")
`((display-buffer-use-least-recent-window)
(window-min-width . full-width)
(lru-time . ,use-time)
)))
Note how it uses a non-full-width window for *bar* despite the fact that
we would have preferred a full-width one. And note the settings of
lru-time to the use time of the selected window before the first
'display-buffer' call. Commenting out these lru-time settings will make
it use as window for *bar* the window it previously used for *foo*.
martin
Gillespie.diff
Description: Text Data
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, martin rudalics, 2023/02/01
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, Tom Gillespie, 2023/02/01
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, martin rudalics, 2023/02/01
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames,
martin rudalics <=
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, Tom Gillespie, 2023/02/02
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, martin rudalics, 2023/02/03
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, Eli Zaretskii, 2023/02/11
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, Tom Gillespie, 2023/02/11
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, martin rudalics, 2023/02/12
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, Eli Zaretskii, 2023/02/18
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, martin rudalics, 2023/02/20
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, Eli Zaretskii, 2023/02/20
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, martin rudalics, 2023/02/20
- Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames, Eli Zaretskii, 2023/02/21