GNU bug report logs -
#42872
[PATCH] Add all-frames as arg for count windows.
Previous Next
Reported by: Jen-Chieh Shen <jcs090218 <at> gmail.com>
Date: Sat, 15 Aug 2020 15:14:01 UTC
Severity: normal
Tags: fixed, moreinfo, patch
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
In addition, you might consider this improvement, for
the current-frame behavior (which should remain the
default behavior): use arg MINIBUF only if the current
frame has a minibuffer.
I've had that in my version of `count-windows' since
1996, if not before that. This is the code I have:
(defun count-windows (&optional minibuf)
"Return the number of visible windows in selected frame.
Optional arg MINIBUF is used only if selected frame has a minibuffer.
MINIBUF = t means count the minibuffer window even if *not* active.
MINIBUF = nil or omitted means count the minibuffer iff it is active.
If MINIBUF is neither t nor nil it means not to count the minibuffer
even if it is active. (See function `walk-windows'.)"
(let ((count 0))
(walk-windows
(function (lambda (w) (setq count (+ count 1))))
(and (memq (cdr (assoc 'minibuffer (frame-parameters)))
'(only t)) ; If this frame has a minibuffer,
minibuf)) ; pass the arg. (Else pass nil.)
count))
This bug report was last modified 4 years and 279 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.