[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Re: Make window-list return windows for all frames
From: |
Drew Adams |
Subject: |
RE: [External] : Re: Make window-list return windows for all frames |
Date: |
Thu, 15 Jun 2023 16:11:52 +0000 |
> (defun window-list-by-mode (mode &optional all-frames)
> (let ((window-list))
> (walk-windows
> (lambda (w)
> (with-current-buffer (window-buffer w)
> (when (eq major-mode mode)
> (push (cons (prin1-to-string w) w) window-list))))
> nil all-frames)
> window-list))
It's also possible to filter the buffers first.
(defun windows-with-mode (mode &optional minibuf all-frames)
(let ((wins ()))
(dolist (buf (seq-filter
(lambda (buf)
(with-current-buffer buf
(eq major-mode mode)))
(buffer-list)))
(setq wins (nconc (get-buffer-window-list
buf minibuf all-frames)
wins)))
wins))
(windows-with-mode 'Info-mode nil 'visible)
But it's no doubt faster to filter the `window-list',
just as you've done, because there are typically many
buffers that are not displayed.
- Re: Make window-list return windows for all frames, (continued)
- Re: Make window-list return windows for all frames, Arthur Miller, 2023/06/16
- Re: Make window-list return windows for all frames, Eli Zaretskii, 2023/06/16
- Re: Make window-list return windows for all frames, martin rudalics, 2023/06/16
- Re: Make window-list return windows for all frames, Eli Zaretskii, 2023/06/17
- Re: Make window-list return windows for all frames, martin rudalics, 2023/06/17
- Re: Make window-list return windows for all frames, Eli Zaretskii, 2023/06/17
- Re: Make window-list return windows for all frames, Arthur Miller, 2023/06/18
- Re: Make window-list return windows for all frames, Arthur Miller, 2023/06/19
- Re: Make window-list return windows for all frames, martin rudalics, 2023/06/20
- Re: Make window-list return windows for all frames, Arthur Miller, 2023/06/27
- RE: [External] : Re: Make window-list return windows for all frames,
Drew Adams <=
- Re: [External] : Re: Make window-list return windows for all frames, Arthur Miller, 2023/06/16
- Re: Make window-list return windows for all frames, Gregory Heytings, 2023/06/15
- Re: Make window-list return windows for all frames, Po Lu, 2023/06/15