[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RE: Checking if frame has only one visible buffer
From: |
Christopher Dimech |
Subject: |
Re: RE: Checking if frame has only one visible buffer |
Date: |
Sun, 22 Nov 2020 00:07:04 +0100 |
> Sent: Saturday, November 21, 2020 at 11:29 PM
> From: "Drew Adams" <drew.adams@oracle.com>
> To: "Christopher Dimech" <dimech@gmx.com>, "Help Gnu Emacs"
> <help-gnu-emacs@gnu.org>
> Subject: RE: Checking if frame has only one visible buffer
>
> > Am writing some elisp code and want to check if there is just one
> > visible buffer in frame.
>
> Does `one-window-p' do what you want?
It does. How can I improve on the code below?
(defun fullscr-cycle ()
"Toggles Fullscreen Mode for a Gungadin Buffer"
(interactive)
(if (eq (frame-parameter nil 'fullscreen) 'fullboth)
(progn
(if (one-window-p)
(progn (gungadin-buffer 0)
(disable-fullscr))
(disable-fullscr)))
(progn
(if (one-window-p)
(progn (gungadin-buffer)
(enable-fullscr))
(enable-fullscr))) ) )
> ___
>
> For discovery purposes (and other understanding),
> it helps to assimilate the Emacs jargon. A buffer
> need not be displayed. If displayed, it's shown
> in a window. And a window is in a frame.
>
> If you know you're looking for a function that
> involves windows, then `M-x apropos window' will
> help. If you're thinking of a buffer then it
> won't help you find `one-window-p'.
>