all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "José Júnior" <jjnilton@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>, Drew Adams <drew.adams@oracle.com>
Cc: 53629@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive
Date: Fri, 4 Feb 2022 00:15:00 -0300	[thread overview]
Message-ID: <CAGD2S5Xmmu0kEtgTuZJQ3jr6rZJy0J_+sY6rcSPfEBwchmKnKA@mail.gmail.com> (raw)
In-Reply-To: <87fsozojw0.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 2745 bytes --]

Thanks, Lars. I tried this approach and it's almost perfect. The only thing
I noticed is that when I use M-x or C-s, and the focus is on the echo area,
the last active buffer (the one I was before pressing M-x or C-s) doesn't
use the `mode-line-buffer-id-active` face.

Example: https://0x0.st/oH5O.png - see that the `mode-line-buffer-id` face
on the right is raised, and I'm not sure where that's coming from, since I
didn't set either to be like that.

```
 '(mode-line ((t (:background "#000000" :foreground "#ffffff"))))
 '(mode-line-buffer-id ((t (:background "white" :foreground "black" :weight
normal))))
 '(mode-line-highlight ((t (:background "yellow" :box nil))))
 '(mode-line-id-inactive ((t (:background "gray10" :foreground "dim
gray"))))
 '(mode-line-inactive ((t (:inherit nil :background "black" :foreground
"dim gray" :inverse-video nil))))
```

Seems the default behavior of emacs is not to change the `mode-line` or
`mode-line-buffer-id` on the buffer that M-x or C-s used, so I think that's
what's missing from this solution.

@Drew Adams <drew.adams@oracle.com> might want to check this too. (not sure
if this is the right way to mention people)

On Thu, Feb 3, 2022 at 4:00 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:

> 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
>

[-- Attachment #2: Type: text/html, Size: 3832 bytes --]

  reply	other threads:[~2022-02-04  3:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-29 20:19 bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive José Júnior
2022-01-30  0:24 ` bug#53629: [External] : " Drew Adams
2022-01-30 16:46   ` José Júnior
2022-01-31 20:09     ` José Júnior
2022-01-31 20:38       ` Drew Adams
2022-01-31 20:49       ` Drew Adams
2022-01-31 20:55       ` Drew Adams
2022-01-30 16:18 ` Lars Ingebrigtsen
2022-01-30 16:48   ` José Júnior
2022-01-30 20:33     ` Lars Ingebrigtsen
2022-01-31 20:07       ` José Júnior
2022-02-02 17:16         ` Lars Ingebrigtsen
2022-02-02 20:00           ` Juri Linkov
2022-02-03 19:00             ` Lars Ingebrigtsen
2022-02-04  3:15               ` José Júnior [this message]
2022-02-04  9:58                 ` martin rudalics
2022-02-05  2:03                   ` José Júnior
2022-02-05  7:47                     ` martin rudalics
2022-02-05  7:52                       ` Lars Ingebrigtsen
2022-02-05 12:10                         ` José Júnior
2022-02-05 21:46                           ` Lars Ingebrigtsen
2022-02-05 22:11                             ` José Júnior
2022-02-06 17:59                             ` Juri Linkov
2022-02-06 22:48                               ` Lars Ingebrigtsen
2022-02-08 11:48                                 ` José Júnior
2022-02-08 18:22                                   ` martin rudalics

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=CAGD2S5Xmmu0kEtgTuZJQ3jr6rZJy0J_+sY6rcSPfEBwchmKnKA@mail.gmail.com \
    --to=jjnilton@gmail.com \
    --cc=53629@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    /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.