unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "gliao.tw@pm.me" <gliao.tw@pm.me>
Cc: emacs-devel@gnu.org
Subject: Re: face-attribute and face-remapping-alist
Date: Thu, 01 Apr 2021 10:08:04 +0300	[thread overview]
Message-ID: <83sg4ah48b.fsf@gnu.org> (raw)
In-Reply-To: <XksHpET9pecTRk9aZLUfE-0UzU1bHPgAQacS23G2qmn_ojqdG4eaqZpo4eTUAjWOid_qARkdKTcxnTtCNnDJ9yUsx047nKVvWQ2ReMfdDbg=@pm.me> (gliao.tw@pm.me)

> Date: Wed, 31 Mar 2021 22:41:24 +0000
> From: "gliao.tw@pm.me" <gliao.tw@pm.me>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> 
>   Therefore, to make `ansi-term' receive correct face information,
>   we need to
> 
>   1. change 'face-attribute' to make it aware of `face-remapping-alist'
>      in a way that is similar to my earlier proposal; or
> 
>   2. do not change any existing face-related functions but define new
>      functions to retrieve buffer-local face settings such like

    3. do not change any existing face-related functions but look up
       the relevant face in face-remapping-alist before calling
       face-attribute.

> So my question here is that which of the following options
> 
> 1. make `face-attribute' return buffer-local face attributes if the face has been
>    customized (via `face-remapping-alist) in that buffer otherwise return
>    frame-local face attributes
> 2. Introducing new face attribute getting/setting APIs to Emacs code base;
>    these new APIs  are `face-remapping-alist' aware and use unchanged
>    `face-attribute' as the fallback dispatch option
> 3.  Do nothing to Emacs code base: let the library/package developer to decide
>     whether buffer local face settings should be accommodated or not
> 
> is the most economical one?

"Economical" in what sense?

Changing long-standing default behavior of face-attribute is out of
the question: we cannot make such changes in such old APIs.  Item 3 is
so easy to implement in those packages that really want to cater to
buffer-local face customizations is so easy that I see no need for any
change in core.  Which then makes option 3 "the most economical" from
my POV.

And that's even before we discussed whether sensitivity to
buffer-local face changes is at all a good idea in general, something
that I'm not at all convinced in.  Faces are more often than not
related to major and minor modes, so having them change depending on
buffer-local customizations would mean 2 buffers under the same mode
will look differently.  Why is that a good idea?



      reply	other threads:[~2021-04-01  7:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 18:53 face-attribute and face-remapping-alist gliao.tw
2021-03-30 19:05 ` Eli Zaretskii
2021-03-30 19:13   ` Eli Zaretskii
2021-03-31  3:05     ` gliao.tw
2021-03-31  3:34       ` gliao.tw
2021-03-31  6:58       ` Eli Zaretskii
2021-03-31 13:00         ` Clément Pit-Claudel
2021-03-31 13:27           ` Eli Zaretskii
2021-03-31 22:41         ` gliao.tw
2021-04-01  7:08           ` Eli Zaretskii [this message]

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=83sg4ah48b.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=gliao.tw@pm.me \
    /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).