From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#68765: 30.0.50; Adding window-tool-bar package. Date: Sat, 10 Feb 2024 10:19:37 +0200 Message-ID: <86fry0vihy.fsf@gnu.org> References: <07df5e8408054bcae5968066b0cebf34@finder.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3360"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68765@debbugs.gnu.org To: Jared Finder , Juri Linkov , Philip Kaludercic , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 10 09:55:59 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 1rYj9T-0000eZ-14 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Feb 2024 09:55:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYj9N-0001Kw-U8; Sat, 10 Feb 2024 03:55:54 -0500 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 1rYj9H-0001Cp-TH for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 03:55:48 -0500 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 1rYj9H-00035l-8q for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 03:55:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYj9W-0007uH-Mr for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 03:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Feb 2024 08:56:02 +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.170755532330306 (code B ref 68765); Sat, 10 Feb 2024 08:56:02 +0000 Original-Received: (at 68765) by debbugs.gnu.org; 10 Feb 2024 08:55:23 +0000 Original-Received: from localhost ([127.0.0.1]:53643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYj8s-0007sc-QS for submit@debbugs.gnu.org; Sat, 10 Feb 2024 03:55:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYj7i-0007mm-4O for 68765@debbugs.gnu.org; Sat, 10 Feb 2024 03:54:10 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYiaL-0005Pd-S5; Sat, 10 Feb 2024 03:19:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Q4WveRDTT+lSZjj+2hK3SG9dpOQe8Q8PeUhW4eY3GU8=; b=okD3oKeXPjQw dh/CwZsAycRZEbFmgbYa/cByZL3icKG2I8Bu6Lwb+foIa7PDHmjBZ+uJD+UmGANnOxdEOopxomPXw z8PQYlJfBlAlunf+iDdzcuwUI0SRtdBZzVHMGWP8t8vnI9MXm4+xSev+prfNpGaYzv3rUk+u72hnR 16I7pqrVqfwd+wmb0Xd26Q1uKUS7H7dFo9cH08Lz/KZ7Aia5UlygZyiKqMZeLizKOvh+OH/zvE8Gg q5LqIEBBM3vSw4IsUOMALZ9WFwHP+VpmXieTztCuLPEf6CqhGZPqCby9H//WBCauIVxXYN1MtKuUT 4gk8kdW3zhx5qRBN+LyV5w==; In-Reply-To: <07df5e8408054bcae5968066b0cebf34@finder.org> (bug-gnu-emacs@gnu.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:279728 Archived-At: > Date: Sat, 27 Jan 2024 15:36:56 -0800 > From: Jared Finder via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > This is a follow-up from bug#68334 where there was interest in adding > support into Emacs core for tool bars in windows. > (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68334#52) I have > attached three changes I authored to accomplish this, two small changes > to tool-bar and tab-line, and then a code drop of my window-tool-bar.el > package. I have not yet put in documentation in NEWS or the manual > about window-tool-bar and was hoping to get a code review done first. Thanks, please find some review comments below. > Subject: [PATCH 1/3] Enable multiple modes to appear in tab line > > This adds space for window-tool-bar-mode, which will be added in an > upcoming commit. > > * lisp/tab-line.el (tab-line-format-template): Add separator space. > (tab-line-display-order): New user variable to control display order. > (tab-line--runtime-display-order, tab-line--cookie): New internal > variables. > (tab-line-set-display): New function for modes to call to enable only > their content. > (tab-line-mode): Call `tab-line-set-display'. Juri, would you please review this part of the changeset? > Subject: [PATCH 2/3] Add user option to only display default tool bar > > This works well with `window-tool-bar-mode', to be added in upcoming > commit. Then the default tool bar is displayed frame-wide and > mode-specific tool bars are displayed in the window that mode is > active in. > > * lisp/tool-bar.el (tool-bar-always-show-default): New user option. > (tool-bar--cache-key, tool-bar-make-keymap-1): Return default tool bar > when option is set. > --- > lisp/tool-bar.el | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el > index 96b61c7b229..685e4dfbb86 100644 > --- a/lisp/tool-bar.el > +++ b/lisp/tool-bar.el > @@ -100,7 +100,9 @@ secondary-tool-bar-map > (defconst tool-bar-keymap-cache (make-hash-table :test #'equal)) > > (defsubst tool-bar--cache-key () > - (cons (frame-terminal) (sxhash-eq tool-bar-map))) > + (cons (frame-terminal) > + (sxhash-eq (if tool-bar-always-show-default (default-value 'tool-bar-map) > + tool-bar-map)))) > > (defsubst tool-bar--secondary-cache-key () > (cons (frame-terminal) (sxhash-eq secondary-tool-bar-map))) > @@ -191,7 +193,9 @@ tool-bar-make-keymap-1 > bind)) > (plist-put plist :image image))) > bind)) > - (or map tool-bar-map))) > + (or map > + (if tool-bar-always-show-default (default-value 'tool-bar-map) > + tool-bar-map)))) > > ;;;###autoload > (defun tool-bar-add-item (icon def key &rest props) > @@ -377,6 +381,15 @@ tool-bar-setup > (modify-all-frames-parameters > (list (cons 'tool-bar-position val)))))) > > +(defcustom tool-bar-always-show-default nil > + "If non-nil, do not show mode-specific tool bars. Double negation alert! > I think it would be good to have window-tool-bar.el also be a package so > that I can keep supporting Emacs 29 as well. I am happy to have this > put on GNU ELPA and would appreciate help in getting that completed. > [...] > From 24ed752ec0bfdded24cba4892426c2c9710126cf Mon Sep 17 00:00:00 2001 > From: Jared Finder > Date: Fri, 26 Jan 2024 15:44:12 -0800 > > --- > lisp/window-tool-bar.el | 488 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 488 insertions(+) > create mode 100644 lisp/window-tool-bar.el Philip and Stefan, would you please review this additional package, which AFAIU is being proposed as a cofre package for ELPA? > +This works well when using `global-window-tool-bar-mode' to > +display the mode-specific tool bars attached to each window." I don't think I understand what you mean by "mode-specific tool bars". The doc string doesn't explain that, so it is not clear enough, IMO. > +(defun window-tool-bar-show-memory-use () > + "Pop up a window showing the memory use metrics." I'm not sure I understand why this package needs to be interested in memory usage. It sounds like a separate feature.