From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jared Finder via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68765: 30.0.50; Adding window-tool-bar package. Date: Mon, 03 Jun 2024 22:24:55 -0700 Message-ID: References: <07df5e8408054bcae5968066b0cebf34@finder.org> Reply-To: Jared Finder Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21989"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, 68765@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 04 07:26:01 2024 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 1sEMgL-0005Vo-9W for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Jun 2024 07:26:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEMgA-0001UC-OR; Tue, 04 Jun 2024 01:25:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEMg9-0001Tw-IP for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 01:25:49 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEMg9-0002ZY-Ab for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 01:25:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sEMgL-0003Gl-SD for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 01:26:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <07df5e8408054bcae5968066b0cebf34@finder.org> Resent-From: Jared Finder Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Jun 2024 05:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68765 X-GNU-PR-Package: emacs Original-Received: via spool by 68765-submit@debbugs.gnu.org id=B68765.171747871512510 (code B ref 68765); Tue, 04 Jun 2024 05:26:01 +0000 Original-Received: (at 68765) by debbugs.gnu.org; 4 Jun 2024 05:25:15 +0000 Original-Received: from localhost ([127.0.0.1]:56151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEMfa-0003Fh-EZ for submit@debbugs.gnu.org; Tue, 04 Jun 2024 01:25:14 -0400 Original-Received: from greenhill.hpalace.com ([192.155.80.58]:59260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEMfW-0003FX-77 for 68765@debbugs.gnu.org; Tue, 04 Jun 2024 01:25:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=finder.org; s=2018; t=1717478695; bh=iVvb/s2nM4zauTbmboBYYTANEAPq9zBAl8sKWLiZBX4=; h=Date:From:To:Cc:Subject:From; b=b3Cp/HQpgg37rLRFUJU60tLuLJo9viXM7aWXML6IH4iT/CDV1d6R1QmfEyLLjg1wT SamesMSqjXUXmfnwTs0Gimwicc9/XLTfWM8F7cW6YnSYrqbRtMOHSOmL84LJu2Fy+q ejblIvGTGSlmD+7oFNeBH+wuCIIK1i72ZtnxErmD+cdV5wZZlYQRbUouwccGkBkrUv zQGLyml4gOdnRJQtLfsLh4B9tkKANQ49K8PT86x4ATo1JnO/UP69jyjyx/Cn0A6l8A 8ClwV4WfSTGN/CCyiLbF2rV0BoSYnR9yBLq1VwxF1ndZ5BYVvSDLO6bQZpnKh9KlnY He1im+UujCSGQ== Original-Received: from mail.finder.org (unknown [192.155.80.58]) by greenhill.hpalace.com (Postfix) with ESMTPSA id CCFA7A02; Tue, 4 Jun 2024 05:24:55 +0000 (UTC) X-Sender: jared@finder.org 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286511 Archived-At: On 2024-06-02 09:46, Eli Zaretskii wrote: >> Date: Sun, 02 Jun 2024 08:57:52 -0700 >> From: Jared Finder >> Cc: juri@linkov.net, 68765@debbugs.gnu.org, philipk@posteo.net, >> monnier@iro.umontreal.ca >> Let me explicitly describe the terms I am using: >> >> When I write "the global (default) tool bar", that refers to the value >> of (default-value 'tool-bar-map). It's the tool bar with New File, >> Open File, Open Directory, Kill Buffer, Save, Undo, Cut, Copy, Paste, >> Isearch. This doesn't change with major mode. As far as I can tell, >> it doesn't change during normal Emacs operations (unless a user >> chooses >> to modify it, of course). >> >> When I write "the frame tool bar", that refers to the tool bar >> displayed at the top of a frame, as controlled by M-x tool-bar-mode. >> There is no change of behavior here except for the new user option >> tool-bar-always-show-default. >> >> When I write "the window tool bar", that refers to the tool bar >> displayed at the top of a window, as controlled by (newly added) M-x >> window-tool-bar-mode or M-x global-window-tool-bar-mode. The window >> tool bar displays the value of tool-bar-map the window's displayed >> buffer. But it only displays that tool bar if it is not the same as >> the global (default) tool bar. It does not pay attention to the frame >> tool bar. Specifically, the test is: >> >> (eq tool-bar-map ;a buffer's tool bar >> (default-value 'tool-bar-map) ;the global (default) tool bar >> ) > > So a window under, say, Info mode will show the Info tool bar even > though the frame also shows that tool bar, just because that tool bar > is different from the default value of tool-bar-map? Why is this > behavior useful? > > How about if we make the behavior simpler and more predictable: > > If a window's buffer has a non-nil value of window-toolbar-mode, > show the window-specific tool bar regardless of what it is and > whether it is the same as the default. > > Why is this not good enough? I want the window-specfic tool bar to never be shown if there are no tool bar buttons, to conserve space. However, if tab-line-format is non nil, the tab line takes up space even if the resulting tab line is nil. This can happen if one sets the default tool bar to nil, while keeping the mode specific tool bars. I think there's also a useful case where the frame tool bar is used to show a "global" tool bar with buttons that do not act on the current buffer (in the current default tool bar: new file, open file, open directory, all the modifier tool bar buttons) and the window tool bar is used to show buttons that act on the buffer. In this case, you don't want the "global" tool bar to change based on frame's selected window. The "tool-bar-always-show-default" variable I added as well as the logic with ignoring the default value of tool-bar-map was to enable this use case. I treat the default value of tool-bar-map as "no tool bar buttons for this window" since all those buttons are for the global tool bar. It'd be fine to limit behavior to only when tool-bar-always-show-default was set. -- MJF