unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-devel@gnu.org
Subject: Re: [PATCH] tab-line-alternate-colors
Date: Sun, 13 Dec 2020 20:17:28 -0600	[thread overview]
Message-ID: <87lfe1t9l3.fsf@alphapapa.net> (raw)
In-Reply-To: 834kkpenox.fsf@gnu.org

Eli Zaretskii <eliz@gnu.org> writes:

>> +(defface tab-line-tab-inactive-alternate
>> +  (let ((mode-line-bg (face-background 'mode-line nil t)))
>> +    `((t (:inherit tab-line-tab-inactive :background ,mode-line-bg))))
>
> Is this supposed to change the background when that of the mode line
> changes, or is it supposed to keep the original one, recorded when
> this defface is processed?

This is the default definition of the face, so it would not be updated
if the mode-line face changes (e.g. when a theme is loaded).  That's not
ideal, of course.

I know of two alternatives:

1.  Use an anonymous face computed at runtime (e.g. by calling
color-darken-name on the tab-line face's background color).  That would
seem wasteful, considering how often these functions are called.

2.  Define the face with a specific color.  That would work for the
default theme, but when other themes are loaded, the colors would
usually clash, and that would require themes to add support for the new
face.

> More generally, why use such an unusual definition of a face?

In the default theme, the mode-line face has a background color that's
slightly darker than the header-line face's (and therefore the tab-line
face's) background color, so it seems like a suitable color for
alternating tabs' background color.  For themes that follow the pattern
of the header-line and mode-line having different background colors, it
should work without requiring themes to support a new face.  So it
seemed preferable to hard-coding the default for the new face.

AFAIK there's no way to inherit only a certain attribute of a face,
other than using an anonymous face made at runtime.  If there were, it
would be simple to just inherit the mode-line face's background color.

>> +(defface tab-line-tab-special '((t (:slant italic)))
>
> What will this do on terminals that don''t support italic?

Nothing, I suppose.  :)  I don't often use Emacs in a terminal, so I'm
not as familiar with that issue.

I'll be glad to follow whatever guidance you may provide here.  Thanks.




  reply	other threads:[~2020-12-14  2:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-13  6:04 [PATCH] tab-line-alternate-colors Adam Porter
2020-12-13  6:17 ` Adam Porter
2020-12-13  8:45 ` Juri Linkov
2020-12-13 10:06   ` Adam Porter
2020-12-13 11:13     ` Adam Porter
2020-12-13 15:21     ` Eli Zaretskii
2020-12-14  2:17       ` Adam Porter [this message]
2020-12-14 15:34         ` Eli Zaretskii
2020-12-16  2:58           ` Adam Porter
2020-12-16 15:41             ` Eli Zaretskii
2020-12-13 21:25     ` Juri Linkov
2020-12-14  4:33       ` Adam Porter
2020-12-14  9:10         ` Juri Linkov
2020-12-14 10:05           ` Adam Porter
2020-12-14 19:37             ` Juri Linkov
2020-12-16  3:24               ` Adam Porter
2020-12-16  3:55                 ` Adam Porter
2020-12-16  9:03                 ` Juri Linkov
2020-12-16 10:26                   ` Adam Porter
2020-12-16 20:46                     ` Juri Linkov
2020-12-18  3:55                       ` Adam Porter
2020-12-23 21:07                         ` Juri Linkov
2020-12-24 11:26                           ` Adam Porter
2020-12-14  9:14         ` Adam Porter
2020-12-14 19:33           ` Juri Linkov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87lfe1t9l3.fsf@alphapapa.net \
    --to=adam@alphapapa.net \
    --cc=emacs-devel@gnu.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).