[Top][All Lists]

[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))
  ;; 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))
   (get-buffer-create "*foo*")
     (window-min-width . full-width)
     (lru-time . ,use-time)
   (get-buffer-create "*bar*")
     (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*.


Attachment: Gillespie.diff
Description: Text Data

reply via email to

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