From unknown Tue Aug 19 02:50:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18233: 24.3.92; Use of (frame-selected-window) in mode-line-format Resent-From: Christopher Schmidt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Aug 2014 21:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18233 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 18233@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.140761912922207 (code B ref -1); Sat, 09 Aug 2014 21:19:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Aug 2014 21:18:49 +0000 Received: from localhost ([127.0.0.1]:36781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGE2K-0005m7-Ta for submit@debbugs.gnu.org; Sat, 09 Aug 2014 17:18:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54583) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGE2G-0005lr-3X for submit@debbugs.gnu.org; Sat, 09 Aug 2014 17:18:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGE25-0004bg-9K for submit@debbugs.gnu.org; Sat, 09 Aug 2014 17:18:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGE25-0004bc-6r for submit@debbugs.gnu.org; Sat, 09 Aug 2014 17:18:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGE20-0004Zq-CN for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 17:18:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGE1t-0004a5-3r for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 17:18:28 -0400 Received: from ristopher.com ([81.4.108.209]:53662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGE1s-0004Zq-VG for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 17:18:21 -0400 Received: by ristopher.com (Postfix, from userid 0) id 96A2420657; Sat, 9 Aug 2014 17:18:17 -0400 (EDT) From: Christopher Schmidt Message-ID: <871tsp7469@ristopher.com> Mail-Followup-To: bug-gnu-emacs@gnu.org MIME-Version: 1.0 Content-Type: text/plain Date: Sat, 9 Aug 2014 17:18:16 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) severity: wishlist emacs -q C-x 2 M-: (push '(:eval (if (eq (frame-selected-window) (selected-window)) "A" "B")) mode-line-format) RET Both mode-lines expose an 'A'-Marker. In Emacs 24.3 the mode-line of the window that is not the user selected one is marked with 'B'. I realise this subtle change is not exactly a bug. The old behaviour is useful and used already, though.[1] [1] https://github.com/milkypostman/highline/blob/1621662e886afa5948e8fccf0037d6c2a718e9a0/highline.el#L326 From unknown Tue Aug 19 02:50:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18233: 24.3.92; Use of (frame-selected-window) in mode-line-format Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Aug 2014 22:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18233 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 18233@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.140762209926932 (code B ref -1); Sat, 09 Aug 2014 22:09:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Aug 2014 22:08:19 +0000 Received: from localhost ([127.0.0.1]:36794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGEoF-00070K-7j for submit@debbugs.gnu.org; Sat, 09 Aug 2014 18:08:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33126) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGEoC-000706-Nx for submit@debbugs.gnu.org; Sat, 09 Aug 2014 18:08:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGEnx-0000u5-Nd for submit@debbugs.gnu.org; Sat, 09 Aug 2014 18:08:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGEnx-0000u1-LD for submit@debbugs.gnu.org; Sat, 09 Aug 2014 18:08:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGEnq-0000OC-4B for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 18:08:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGEng-0000sI-76 for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 18:07:54 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:36602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGEng-0000sE-3a for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 18:07:44 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVPAqyKr/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWKAsLNBIUGA2IKAjSGRePARaEIgSrA4NMIQ X-IPAS-Result: ArYGAIDvNVPAqyKr/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWKAsLNBIUGA2IKAjSGRePARaEIgSrA4NMIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="83196429" Received: from 192-171-34-171.cpe.pppoe.ca (HELO pastel.home) ([192.171.34.171]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Aug 2014 18:07:43 -0400 Received: by pastel.home (Postfix, from userid 20848) id 65DCE61782; Sat, 9 Aug 2014 18:07:43 -0400 (EDT) From: Stefan Monnier Message-ID: References: <871tsp7469@ristopher.com> Date: Sat, 09 Aug 2014 18:07:43 -0400 In-Reply-To: <871tsp7469@ristopher.com> (Christopher Schmidt's message of "Sat, 9 Aug 2014 17:18:16 -0400 (EDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) > I realise this subtle change is not exactly a bug. The old behaviour is > useful and used already, though.[1] Yes, the old behavior was useful but was fundamentally problematic (by breaking the equivalence between (selected-window) and (frame-selected-window), which is otherwise always true). Also it let you distinguish the one window that's the frame-selected-window from the other windows in the same frame, but it did not let you distinguish "the one and only selected-window". For single-frame configs, there's no difference, but for multi-frame configs, this usually isn't what was desired. So we won't go back to the old behavior. Instead we should provide a new feature for that. IIRC you can currently do it by hand with something like: (add-function :before pre-redisplay-function (lambda (_) (setq my-selected-window (selected-window)))) and then compare (deleted-window) to my-selected-window in your mode-line-format. Stefan From unknown Tue Aug 19 02:50:42 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Christopher Schmidt Subject: bug#18233: closed (Re: bug#18233: 24.3.92; Use of (frame-selected-window) in mode-line-format) Message-ID: References: <87sil55mna@ristopher.com> <871tsp7469@ristopher.com> X-Gnu-PR-Message: they-closed 18233 X-Gnu-PR-Package: emacs Reply-To: 18233@debbugs.gnu.org Date: Sat, 09 Aug 2014 22:23:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1407622983-28334-1" This is a multi-part message in MIME format... ------------=_1407622983-28334-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #18233: 24.3.92; Use of (frame-selected-window) in mode-line-format which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 18233@debbugs.gnu.org. --=20 18233: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18233 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1407622983-28334-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 18233-done) by debbugs.gnu.org; 9 Aug 2014 22:22:13 +0000 Received: from localhost ([127.0.0.1]:36799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGF1g-0007Ln-ND for submit@debbugs.gnu.org; Sat, 09 Aug 2014 18:22:12 -0400 Received: from ristopher.com ([81.4.108.209]:38859) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGF1d-0007Le-Nj for 18233-done@debbugs.gnu.org; Sat, 09 Aug 2014 18:22:10 -0400 Received: by ristopher.com (Postfix, from userid 0) id 96EF120657; Sat, 9 Aug 2014 18:22:07 -0400 (EDT) From: Christopher Schmidt To: 18233-done@debbugs.gnu.org Subject: Re: bug#18233: 24.3.92; Use of (frame-selected-window) in mode-line-format In-Reply-To: (Stefan Monnier's message of "Sat, 09 Aug 2014 18:07:43 -0400") Message-ID: <87sil55mna@ristopher.com> References: <871tsp7469@ristopher.com> MIME-Version: 1.0 Content-Type: text/plain Date: Sat, 9 Aug 2014 18:22:06 -0400 (EDT) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18233-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stefan Monnier writes: > So we won't go back to the old behavior. Instead we should provide > a new feature for that. IIRC you can currently do it by hand with > something like: > > (add-function :before pre-redisplay-function > (lambda (_) (setq my-selected-window (selected-window)))) > > and then compare (deleted-window) to my-selected-window in your > mode-line-format. Works great. Thanks a lot! ------------=_1407622983-28334-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Aug 2014 21:18:49 +0000 Received: from localhost ([127.0.0.1]:36781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGE2K-0005m7-Ta for submit@debbugs.gnu.org; Sat, 09 Aug 2014 17:18:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54583) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGE2G-0005lr-3X for submit@debbugs.gnu.org; Sat, 09 Aug 2014 17:18:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGE25-0004bg-9K for submit@debbugs.gnu.org; Sat, 09 Aug 2014 17:18:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGE25-0004bc-6r for submit@debbugs.gnu.org; Sat, 09 Aug 2014 17:18:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGE20-0004Zq-CN for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 17:18:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGE1t-0004a5-3r for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 17:18:28 -0400 Received: from ristopher.com ([81.4.108.209]:53662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGE1s-0004Zq-VG for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 17:18:21 -0400 Received: by ristopher.com (Postfix, from userid 0) id 96A2420657; Sat, 9 Aug 2014 17:18:17 -0400 (EDT) From: Christopher Schmidt To: bug-gnu-emacs@gnu.org Subject: 24.3.92; Use of (frame-selected-window) in mode-line-format Message-ID: <871tsp7469@ristopher.com> Mail-Followup-To: bug-gnu-emacs@gnu.org MIME-Version: 1.0 Content-Type: text/plain Date: Sat, 9 Aug 2014 17:18:16 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) severity: wishlist emacs -q C-x 2 M-: (push '(:eval (if (eq (frame-selected-window) (selected-window)) "A" "B")) mode-line-format) RET Both mode-lines expose an 'A'-Marker. In Emacs 24.3 the mode-line of the window that is not the user selected one is marked with 'B'. I realise this subtle change is not exactly a bug. The old behaviour is useful and used already, though.[1] [1] https://github.com/milkypostman/highline/blob/1621662e886afa5948e8fccf0037d6c2a718e9a0/highline.el#L326 ------------=_1407622983-28334-1--