[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
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, Lars Ingebrigtsen, 2022/02/02
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, Juri Linkov, 2022/02/02
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive,
Lars Ingebrigtsen <=
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, José Júnior, 2022/02/03
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, martin rudalics, 2022/02/04
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, José Júnior, 2022/02/04
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, martin rudalics, 2022/02/05
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, Lars Ingebrigtsen, 2022/02/05
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, José Júnior, 2022/02/05
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, Lars Ingebrigtsen, 2022/02/05
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, José Júnior, 2022/02/05
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, Juri Linkov, 2022/02/06
- bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive, Lars Ingebrigtsen, 2022/02/06