Hello,
On Mon 19 Sep 2022 at 12:00AM GMT, Protesilaos Stavrou: Coding blog: <author> wrote:
> I have just pushed the first commits to the `notmuch-indicator` Git> repository: <https://git.sr.ht/~protesilaos/notmuch-indicator>. This> provides a global minor mode—`notmuch-indicator-mode`—that puts the> return value of `notmuch count` commands on the Emacs mode line.> Technically, it appends it to the `global-mode-string`, so it also works> with the built-in `tab-bar-mode`.
How about using mode-line-misc-info instead of global-mode-string?
--
Sean Whitton
> From: Sean Whitton <spwhitton@spwhitton.name>> Date: Mon, 19 Sep 2022 09:22:36 -0700>> Hello,
Hi Sean,
> On Mon 19 Sep 2022 at 12:00AM GMT, Protesilaos Stavrou: Coding blog: <author> wrote:>>> I have just pushed the first commits to the `notmuch-indicator` Git>> repository: <https://git.sr.ht/~protesilaos/notmuch-indicator>. This>> provides a global minor mode—`notmuch-indicator-mode`—that puts the>> return value of `notmuch count` commands on the Emacs mode line.>> Technically, it appends it to the `global-mode-string`, so it also works>> with the built-in `tab-bar-mode`.>> How about using mode-line-misc-info instead of global-mode-string?
What is the difference between them? I have encountered them before but
their doc strings do not clarify which one we should use. I went with
the latter because it sounds more important. But I have no problem
switching to the former.
All the best,
Prot
--
Protesilaos Stavrou
https://protesilaos.com
Hello,
On Mon 19 Sep 2022 at 08:15PM +03, Protesilaos Stavrou wrote:
>> From: Sean Whitton <spwhitton@spwhitton.name>>> Date: Mon, 19 Sep 2022 09:22:36 -0700>>>> Hello,>> Hi Sean,>>> On Mon 19 Sep 2022 at 12:00AM GMT, Protesilaos Stavrou: Coding blog: <author> wrote:>>>>> I have just pushed the first commits to the `notmuch-indicator` Git>>> repository: <https://git.sr.ht/~protesilaos/notmuch-indicator>. This>>> provides a global minor mode—`notmuch-indicator-mode`—that puts the>>> return value of `notmuch count` commands on the Emacs mode line.>>> Technically, it appends it to the `global-mode-string`, so it also works>>> with the built-in `tab-bar-mode`.>>>> How about using mode-line-misc-info instead of global-mode-string?>> What is the difference between them? I have encountered them before but> their doc strings do not clarify which one we should use. I went with> the latter because it sounds more important. But I have no problem> switching to the former.
mode-line-misc-info is for collecting small status indicators just like
your new one for notmuch-count(1), aiui. Its semantics mean that
someone could do a major rework of global-mode-line and include
mode-line-misc-info somewhere in their rework, and then they would get
to keep all their indicators without clashing with any code in packages.
Another package that uses mode-line-misc-info is redtick.el.
--
Sean Whitton
> From: Sean Whitton <spwhitton@spwhitton.name>> Date: Mon, 19 Sep 2022 10:28:56 -0700> [... 14 lines elided]>>>> I have just pushed the first commits to the `notmuch-indicator` Git>>>> repository: <https://git.sr.ht/~protesilaos/notmuch-indicator>. This>>>> provides a global minor mode—`notmuch-indicator-mode`—that puts the>>>> return value of `notmuch count` commands on the Emacs mode line.>>>> Technically, it appends it to the `global-mode-string`, so it also works>>>> with the built-in `tab-bar-mode`.>>>>>> How about using mode-line-misc-info instead of global-mode-string?>>>> What is the difference between them? I have encountered them before but>> their doc strings do not clarify which one we should use. I went with>> the latter because it sounds more important. But I have no problem>> switching to the former.>> mode-line-misc-info is for collecting small status indicators just like> your new one for notmuch-count(1), aiui. Its semantics mean that> someone could do a major rework of global-mode-line and include> mode-line-misc-info somewhere in their rework, and then they would get> to keep all their indicators without clashing with any code in packages.>> Another package that uses mode-line-misc-info is redtick.el.
I tried it. It works. However, it does not get captured by the
tab-bar, which reminded me why I picked global-mode-string in the first
place. Here is the relevant snippet from tab-bar.el:
(defun tab-bar-format-global ()
"Produce display of `global-mode-string' in the tab bar.
When `tab-bar-format-global' is added to `tab-bar-format'
(possibly appended after `tab-bar-format-align-right'),
then modes that display information on the mode line
using `global-mode-string' will display the same text
on the tab bar instead."
`((global menu-item ,(format-mode-line global-mode-string) ignore)))
This way I get a single counter in the tab-bar instead of duplicates for
each mode line.
--
Protesilaos Stavrou
https://protesilaos.com
Hello,
On Tue 20 Sep 2022 at 05:15AM +03, Protesilaos Stavrou wrote:
> I tried it. It works. However, it does not get captured by the> tab-bar, which reminded me why I picked global-mode-string in the first> place.
Maybe upstream Emacs should be changed to include it in the tar bar.
--
Sean Whitton
> From: Sean Whitton <spwhitton@spwhitton.name>> Date: Tue, 20 Sep 2022 13:26:30 -0700>> Hello,>> On Tue 20 Sep 2022 at 05:15AM +03, Protesilaos Stavrou wrote:>>> I tried it. It works. However, it does not get captured by the>> tab-bar, which reminded me why I picked global-mode-string in the first>> place.>> Maybe upstream Emacs should be changed to include it in the tar bar.
Sure. I think Juri Linkov is the one dealing with the tab bar.
--
Protesilaos Stavrou
https://protesilaos.com