From: Jared Finder via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: philipk@posteo.net, 68765@debbugs.gnu.org,
monnier@iro.umontreal.ca, juri@linkov.net
Subject: bug#68765: 30.0.50; Adding window-tool-bar package.
Date: Sun, 26 May 2024 09:20:56 -0700 [thread overview]
Message-ID: <65a70df3c5e0edf72fb6d6e1dda99c22@finder.org> (raw)
In-Reply-To: <86o78sx5z4.fsf@gnu.org>
On 2024-05-26 02:44, Eli Zaretskii wrote:
>> Date: Sat, 25 May 2024 12:54:30 -0700
>> From: Jared Finder <jared@finder.org>
>> Cc: juri@linkov.net, 68765@debbugs.gnu.org, philipk@posteo.net,
>> monnier@iro.umontreal.ca
>>
>> Ok, I tried to fit into the existing convention but not use upper case
>> letters with "@cindex mode, window tool bar". Let me know if that's
>> not
>> appropriate.
>
> LGTM, thanks.
>
>> That's what I was concerned about. Please let me know if this updated
>> text is clear enough.
>>
>> > I will wait for the next version to see if my questions are now
>> > answered or we need to discuss them further.
>>
>> New patch attached. Feedback welcome.
>
> Thanks, some comments below.
The questions around current behavior may be clarified by describing how
the internals work.
There's a new function, window-tool-bar-string, which converts the
binding of <tool-bar> to a propertized string containing clickable
buttons for the tool bar. This function depends on the current buffer
but that doesn't result in flickering, see the next paragraph.
window-tool-bar-mode toggles the buffer local value of tab-line-format
between nil, which shows no tab line, and (:eval
(window-tool-bar-string)), which shows tool bar buttons in the tab line.
When "evaluating" tab-line-format for display Emacs already temporarily
sets the current buffer, so this evaluation only shows that buffer's
tool bar, ignoring whatever the user's current buffer is.
And finally, window-tool-bar-mode will keep tab-line-format as nil if
the binding of <tool-bar> is the same as the global binding because
setting tab-line-format to non-nil causes the tab line to take up a row,
even if the result is just an empty string.
Answers also for the questions below follow.
>> +@findex global-window-tool-bar-mode
>> + The command @code{global-window-tool-bar-mode} toggles the display
>> of
>> +a tool bar at the top of each window. When enabled, multiple windows
>> +can display their own tool bar simultaneously. To conserve space, a
>> +window tool bar is only shown if the tool bar for that window's
>> current
>> +buffer is different from the global (default) tool bar. The most
>> common
>> +way a buffer has a different tool bar is due to its major mode, so
>> you
>> +can think of the window tool bar as showing a major mode's tool bar
>> if
>> +it exists.
>
> So, let me understand what happens under this global mode. By
> default, the frame's tool bar changes according to the major mode of
> the buffer shown in the frame's selected window. As a very frequent
> example, entering the minibuffer from a buffer whose mode is, say,
> Dired or Rmail or Info, changes the tool bar. When that happens, some
> windows which previously didn't display their tool bar because it was
> identical to the frame's tool bar will now display their tool bars.
> Right? And when you exit the minibuffer, those window-specific tool
> bars will again disappear, right? Wouldn't that cause annoying
> flickering of the display? (I know that setting
> tool-bar-always-show-default non-nil can prevent that, but I'm asking
> about the default behavior.)
No, this is not the behavior. The window tool bar displays that
buffer's binding of <tool-bar>. The window tool bar is displayed in the
tab line of each window and doesn't pay attention to what the current
buffer or window is.
> Btw, what exactly is the meaning of "the tool bar of the window is
> different from the global tool bar"? How are tool bars compared? For
> example, a button on the tool bar can have the :visible attribute,
> which will cause the icon not to appear under some conditions -- will
> a tool bar with that icon on display be considered "different" from a
> tool bar where the icon is not shown due to :visible conditions?
It's specifically using the following test:
(eq tool-bar-map
(default-value 'tool-bar-map))
This is because the binding for <tool-bar> is actually :filter
tool-bar-make-keymap which generates a keymap based on tool-bar-map.
Other comments all addressed in an upcoming patch except this one:
>> + A window can have a @dfn{tab line} at the top. If both the tab
>> line
>> +and header line are visible, the tab line appears above the header
>> line.
>> +The tab line feature works just like the mode line feature, except
>> that
>> +it's controlled by @code{tab-line-format}:
>> +
>> +@defvar tab-line-format
>> +This variable, local in every buffer, specifies how to display the
>> tab
>> +line, for windows displaying the buffer. The format of the value is
>> the
>> +same as for @code{mode-line-format} (@pxref{Mode Line Data}). It is
>> +normally @code{nil}, so that ordinary buffers have no tab line.
>> +@end defvar
>
> I wonder whether it's a good idea to tell that tab line works "the
> same as mode line", since the purpose is very different, and the
> default value of tab-line-format is very different from the default of
> mode-line-format. At the very least I think we should tell that
> tab-line-format should cause the tab line appear as a row of buttons,
> clicking on which should change the buffer shown in the window.
Perhaps there's some sort of convention we can describe that talks about
the difference between header-line-format and tab-line-format? I'd like
to copy back any changes to header-line-format which I based this text
off of.
It seems to me that really the only difference is conventional. I'm
thinking something along the lines of "header line is usually modified
by major modes to add additional info (examples: EWW, Info) and the tab
line is usually modified by minor modes to add IDE-styled buttons
(examples: tab line mode, window tool bar mode)".
Does that sound right to you? I'd make the text more specific in its
description, I just want to confirm the general intent.
-- MJF
next prev parent reply other threads:[~2024-05-26 16:20 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-27 23:36 bug#68765: 30.0.50; Adding window-tool-bar package Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10 8:19 ` Eli Zaretskii
2024-02-10 17:25 ` Juri Linkov
2024-02-26 22:38 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-26 15:34 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27 7:04 ` Juri Linkov
2024-05-02 6:03 ` Juri Linkov
2024-05-09 8:00 ` Eli Zaretskii
2024-05-10 4:24 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-11 4:33 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-12 16:34 ` Juri Linkov
2024-05-14 4:14 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-14 6:01 ` Juri Linkov
2024-05-18 9:50 ` Eli Zaretskii
2024-05-19 3:55 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-19 6:43 ` Eli Zaretskii
2024-05-20 17:14 ` Juri Linkov
2024-05-21 2:25 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-21 6:12 ` Juri Linkov
2024-05-18 9:45 ` Eli Zaretskii
2024-05-18 9:48 ` Eli Zaretskii
2024-05-19 3:58 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-19 6:48 ` Eli Zaretskii
2024-05-23 4:19 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-23 6:52 ` Eli Zaretskii
2024-05-25 15:49 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-25 17:03 ` Eli Zaretskii
2024-05-25 19:54 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 9:44 ` Eli Zaretskii
2024-05-26 16:20 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-05-26 18:40 ` Eli Zaretskii
2024-06-02 4:17 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-02 5:21 ` Eli Zaretskii
2024-06-02 15:57 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-02 16:46 ` Eli Zaretskii
2024-05-19 14:41 ` Philip Kaludercic
2024-05-20 3:25 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-20 6:39 ` Philip Kaludercic
2024-05-20 9:19 ` Philip Kaludercic
2024-05-21 4:18 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-21 13:40 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-22 16:16 ` Philip Kaludercic
2024-02-11 20:51 ` Philip Kaludercic
2024-02-27 3:02 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-26 15:33 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-13 7:43 ` Eli Zaretskii
2024-04-27 8:25 ` Eli Zaretskii
2024-04-27 10:00 ` Philip Kaludercic
2024-04-28 4:44 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-04 5:24 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-04 15:59 ` Eli Zaretskii
2024-06-05 4:22 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-05 12:10 ` Eli Zaretskii
2024-06-09 0:29 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-09 12:23 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=65a70df3c5e0edf72fb6d6e1dda99c22@finder.org \
--to=bug-gnu-emacs@gnu.org \
--cc=68765@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=jared@finder.org \
--cc=juri@linkov.net \
--cc=monnier@iro.umontreal.ca \
--cc=philipk@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).