all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: TatriX <tatrics@gmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: emacs-devel@gnu.org
Subject: Re: Configuring tabs line format
Date: Thu, 17 Oct 2019 14:34:23 +0200	[thread overview]
Message-ID: <CAG7LdX4gEuJOx-h4HCpimF8+iPxqa_vC=PrhcDwMKtFPLHOycw@mail.gmail.com> (raw)
In-Reply-To: <874l08xrua.fsf@mail.linkov.net>


[-- Attachment #1.1: Type: text/plain, Size: 1704 bytes --]

Thank you very much! It was a bit surprising to learn that appearance of
the tab-bar is controller by the keymap ;)
I was using `header-line` as a panel with EXWM, but it didn't work well
with modes like info which define their own header-line.
Now it's much better!

On Thu, Oct 17, 2019 at 12:15 AM Juri Linkov <juri@linkov.net> wrote:

> > Is it possible to change how tab-bar is formatted?
> > For example I'd like to put display-time-string there.
>
> Yes, everything is possible.  You need just a few lines of code:
>
> (advice-add 'tab-bar-make-keymap-1 :around
>   (lambda (orig-fun)
>     (append `(keymap (display-time menu-item ,(format-time-string "%H:%M")
> ignore))
>             (cdr (funcall orig-fun))))
>   '((name . tab-bar-display-time)))
>
> and if you want also a timer to redraw the tab-bar during idle times.
>
> This has one problem - the clock is located on the left side.  When
> Android moved the status bar clock from the right corner to the left,
> it caused backward-compatibility problems for millions of users, and
> still it's impossible to move the clock back to the right on Android.
>
> But in Emacs everything is extensible and customizable.  So it's easy
> to move the clock to the right on the tab-bar with another few lines:
>
> (advice-add 'tab-bar-make-keymap-1 :around
>   (lambda (orig-fun)
>     (append (funcall orig-fun)
>             `((display-time menu-item
>                ,(concat
>                  (propertize " " 'display '(space :align-to (- right 5)))
>                  (format-time-string "%H:%M"))
>                ignore))))
>   '((name . tab-bar-display-time)))
>
> Now the tab-bar clock looks exactly like the desktop top panel clock:
>
>

[-- Attachment #1.2: Type: text/html, Size: 2254 bytes --]

[-- Attachment #2: emacs.png --]
[-- Type: image/png, Size: 503544 bytes --]

  parent reply	other threads:[~2019-10-17 12:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16 13:18 Configuring tabs line format TatriX
2019-10-16 22:12 ` Juri Linkov
2019-10-16 22:40   ` Ergus
2019-10-16 22:46     ` Ergus
2019-10-17 22:09     ` Juri Linkov
2019-10-18 13:47       ` Ergus
2019-10-17 12:34   ` TatriX [this message]
2019-10-17 22:09     ` Juri Linkov
2019-10-18  8:33       ` TatriX

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG7LdX4gEuJOx-h4HCpimF8+iPxqa_vC=PrhcDwMKtFPLHOycw@mail.gmail.com' \
    --to=tatrics@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.