From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: RE: Checking if frame has only one visible buffer Date: Sun, 22 Nov 2020 01:16:03 +0100 Message-ID: References: <389a9b58-736d-4b38-a5ba-5921272925ef@default> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21531"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 22 01:18:17 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kgd57-0005WJ-2J for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Nov 2020 01:18:17 +0100 Original-Received: from localhost ([::1]:36728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgd55-0003p3-UK for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 21 Nov 2020 19:18:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgd35-0003op-UY for help-gnu-emacs@gnu.org; Sat, 21 Nov 2020 19:16:11 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:35051) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgd33-0000ap-T5 for help-gnu-emacs@gnu.org; Sat, 21 Nov 2020 19:16:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606004163; bh=bgw3jU6aA+W5/xw7TDEF7N4cmmIqSsoChPJ8u1hNiVA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=TiHcgKw0phcBuAwVe5YJWBw6JhpdIOIReMMIJDkozMgRmtzItUYQ97E1BZT7puXgU vYvdNL0X98PT0j47M1Czf9vAbf6THoXAU/cJUVrmHQ+KekwgiXhXBaGIE3yUNmq2PQ V1R+F/UGY8vdXcbGUGKDunCkky26PBkC75tFoQxQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs11.server.lan [172.19.170.179]) (via HTTP); Sun, 22 Nov 2020 01:16:03 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:N9/PmYzcUUC4pENxisN+XI+Lyrr/Rm2uauPoWuQixTGp9G/0ew6EJ6HDun1LcWHBXcXrD sT1Z3OaxmJ7Cvzrn8oiveV+zBnOpL9uEqv8qhIi8BmjjXJKpA9RGV0ILot4RuHMFNqS8wxQs70CI Oou67uFegmOJWsQdCxrTFHgWAUUte+eCU5Yu3gCcQvn5cLanzQBvga2Mmh/qjqoh17V5l3YBFP2L OjC2ScpIdpJHz4E4DijcHzbnDobma0pktPge9NvF++5MxgD9ac3woP8lniWcsDFlRiLXrdQ0JL8W TM= X-UI-Out-Filterresults: notjunk:1;V03:K0:9/vVYa7xZNw=:1AlN9UG9gPwxuc9psdu4OY XiXJycZmCrOiC9Z2BYpYcJz+ksXhwaClhHnRUM8PdxMFzsuFIqKHZo0Wqclc4Oge8e862FvOv ouCveAMOJpuXomskaZ8KXJwGiEU2hu/cH5N/Pkb3inmKSviN/jxNfbmdKcpKgvVcWpUQlT27O yXVNg4JC+JCk/ruxkMc+1+9yejyc0Ny/huDXKJ2cKv11xfgHTVtdqOuZqhKB0m16JAA06IK0e 1RNG1cE18DioTZk1SUnOUUZsLEcOkmb1wuYdSd+SnkJsIexVZOI2PgvBY+XOauFSyXjcqiV6I M3oriPdqG/GSostdGsTHztn3oHswCvrl0QVa1NJNf0hbII36EaNcNY3qjfY8m++ngRfARKKdm d1+5sMOtNpbS7lgcnLsWLVOEopLqCAnTlEsuezowWgMz+WooiR4enG1aPcG/doqVhCbgJLa0Z 0mf5KHP/+gGCx9/bL+H3VQZ/qH0U/OocV+ex5SfM50gWn4txoKO0n5Df0oeuTjyGBK/b6+oG+ vELp5CF6Q/0ZFsJKl1fUilRruqsdBFxrILBqrkT4DONH3Ll8+jF3Zjfpuyqutk3UZY/Tt0iW6 6wp5JdYQEPM9Y= Received-SPF: pass client-ip=212.227.17.22; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125461 Archived-At: I have now removed the progn and have got to the below. Any more simplifications and improvements? (defun fullscr-cycle () "Toggles Fullscreen Mode for a Gungadin Buffer" (interactive) (if (eq (frame-parameter nil 'fullscreen) 'fullboth) (if (one-window-p) (progn (gungadin-buffer 0) (disable-fullscr)) (disable-fullscr)) (if (one-window-p) (progn (gungadin-buffer) (enable-fullscr)) (enable-fullscr)) )) > Sent: Sunday, November 22, 2020 at 12:07 AM > From: "Christopher Dimech" > To: "Drew Adams" > Cc: "Help Gnu Emacs" > Subject: Re: RE: Checking if frame has only one visible buffer > > > > Sent: Saturday, November 21, 2020 at 11:29 PM > > From: "Drew Adams" > > To: "Christopher Dimech" , "Help Gnu Emacs" > > 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 (margined-window 0) >....................(disable-fullscr)) >.............(disable-fullscr))) >.......(progn >..........(if (one-window-p) >.............(progn (margined-window) ; Defaults to 3 >....................(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'. > > > >