From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#42872: [PATCH] Add all-frames as arg for count windows. Date: Sun, 16 Aug 2020 07:50:15 -0700 (PDT) Message-ID: <26ea8566-867b-4cc0-9499-cbe0b5ce0934@default> References: <87v9hivkph.fsf@gnus.org> <1f1a9efc-6961-4dd4-91ba-e8529dcb8465@default> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22791"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42872@debbugs.gnu.org To: Lars Ingebrigtsen , Jen-Chieh Shen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 16 16:51:10 2020 Return-path: Envelope-to: geb-bug-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 1k7K05-0005na-W1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Aug 2020 16:51:09 +0200 Original-Received: from localhost ([::1]:36442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7K05-000089-0K for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Aug 2020 10:51:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7Jzx-00006s-T1 for bug-gnu-emacs@gnu.org; Sun, 16 Aug 2020 10:51:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7Jzx-0006EK-Jp for bug-gnu-emacs@gnu.org; Sun, 16 Aug 2020 10:51:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k7Jzx-0000RP-IO for bug-gnu-emacs@gnu.org; Sun, 16 Aug 2020 10:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Aug 2020 14:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42872 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo patch Original-Received: via spool by 42872-submit@debbugs.gnu.org id=B42872.15975894261652 (code B ref 42872); Sun, 16 Aug 2020 14:51:01 +0000 Original-Received: (at 42872) by debbugs.gnu.org; 16 Aug 2020 14:50:26 +0000 Original-Received: from localhost ([127.0.0.1]:58153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k7JzN-0000Qa-Mp for submit@debbugs.gnu.org; Sun, 16 Aug 2020 10:50:25 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:53884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k7JzL-0000QN-UZ for 42872@debbugs.gnu.org; Sun, 16 Aug 2020 10:50:24 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07GElhdC039268; Sun, 16 Aug 2020 14:50:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=9O7d9fVg6bh7GPRMCWJ3V2t+hVdeWkd3pm/Mh+lD8H8=; b=eYtbb0P8r/Cf9RLrBE89BnnmVpRelYEjHimIsq+Xuhlzq1ylI5VtGQ5FHwHyAb6oC/oD mSVQ/on0kVQVZNW1woLSzoEmRCDoim4MjatkU3jpiiH69Ono8Wu/PosCl5wDJiGLgDXb kKgyjZjNh/txuGNHqmJx3omUDN2U//x9e/ezXYkzeZtnfsDfy9D7N0eeGcO77LeWR0N4 yPiMYopDVZzW6LR6KnRE8sktb86rBhqsevGQYPbCqiyGp5S9YurlH1/C/N43zz4lZxGO xxSq/oR7C/VRy5hQe+F0fCZFTJ9Cbp6jy6GD7p/S/ZxU8KAkuqVU51Lxdw6LhW8cAftC wQ== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 32x8bmu3vd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 16 Aug 2020 14:50:17 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07GEi6Fu047323; Sun, 16 Aug 2020 14:50:17 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 32xs9jvs22-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Aug 2020 14:50:16 +0000 Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 07GEoGg6030477; Sun, 16 Aug 2020 14:50:16 GMT In-Reply-To: <1f1a9efc-6961-4dd4-91ba-e8529dcb8465@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5017.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9715 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008160121 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9715 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008160121 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185293 Archived-At: 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 =3D t means count the minibuffer window even if *not* active. MINIBUF =3D 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=20 (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))