GNU bug report logs - #21305
25.0.50; `get-buffer-window-list' doc - what order?

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Thu, 20 Aug 2015 23:29:02 UTC

Severity: wishlist

Found in version 25.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #64 received at 21305 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>,
 21305 <at> debbugs.gnu.org
Subject: RE: bug#21305: 25.0.50; `get-buffer-window-list' doc - what order?
Date: Sat, 22 Aug 2015 10:23:22 -0700 (PDT)
> >> `get-buffer-window-list' is in window.el.  Couldn't you try
> >> giving it a fourth argument, say SORT, which, if `lru-first'
> >> or `mru-first', would cause it to return the windows in the 
> >> corresponding order?
> >
> > Patch attached.
> 
> FWIW, I think adding an argument for that is a bad idea.  If the
> caller needs the windows sorted in a particular way, then *he*
> should sort them.

(S?he should know whether the return value of `get-buffer-window-list'
is a new list (it is), so that `sort' can be applied to it without
causing problems elsewhere.  For that, s?he will want to consult the
code of `get-buffer-window-list'.)

> It would make sense to provide sorting directly in the function if
> the sorting can't be done, or not as efficiently, after the fact.
> But that is not the case here.

I don't disagree.  What was not obvious was how you might sort
windows wrt last-use time.  But IIUC, Martin has now updated the
manual to mention `window-use-time', of which I was unaware.

What I suggested was not to add a SORT arg to `get-buffer-window-list'
but to add functions such as `(mru|lru)-window-for-buffer'.  (It was
for the latter that I was interested in `get-buffer-window-list'.)




This bug report was last modified 9 years and 276 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.