bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mo


From: Lars Ingebrigtsen
Subject: bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive
Date: Thu, 03 Feb 2022 20:00:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Juri Linkov <juri@linkov.net> writes:

> tab-line.el uses such trick:
>
>          (face (if (eq buffer (window-buffer))
>                    (if (eq (selected-window) (old-selected-window))
>                        'tab-line-tab-current
>                      'tab-line-tab)
>                  'tab-line-tab-inactive))

Oh, that's smart.

Then we can get the action requested by something like the following:

(progn
  (defun my-buffer-identification (fmt)
    (list (propertize fmt
                      'face (if (eq (selected-window)
                                    (old-selected-window))
                                'mode-line-buffer-id
                              'error)
                      'mouse-face 'mode-line-highlight
                      'local-map mode-line-buffer-identification-keymap)))
  (setq-default mode-line-buffer-identification
                '(:eval (my-buffer-identification "%12b"))))

(Adjust for the face you want to use.)  Seems to work well for me.

José, does this fix the issue for you, too?

We should probably document this better -- perhaps add some cross
referencing between the selected-window and old-selected-window doc
strings to allow discovery.  And perhaps mention this in the mode line
section, too.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]