unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Yuan Fu <casouri@gmail.com>
Cc: theo@thornhill.no, 62429@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#62429: 30.0.50; Add jsx faces to typescript-ts-mode
Date: Sun, 26 Mar 2023 07:37:11 +0300	[thread overview]
Message-ID: <837cv4b020.fsf@gnu.org> (raw)
In-Reply-To: <10D725F2-9162-4BC3-B362-1F54719C8313@gmail.com> (message from Yuan Fu on Sat, 25 Mar 2023 12:45:01 -0700)

> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 25 Mar 2023 12:45:01 -0700
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
>  62429@debbugs.gnu.org,
>  theo@thornhill.no
> 
> > On Mar 25, 2023, at 5:30 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> > 
> > We never had any mode-specific faces for font-lock, AFAIK.  Why is
> > this case different?  Why not use one of the existing font-lock faces,
> > or even add new ones (but not specific to JSX)?
> > 
> > (Adding Stefan.)
> 
> IFIAK, css-mode has its own face. These two faces are specific to HTML and not widely applicable to other languages like other font-lock faces do.
> 
> JSX is basically HTML mixed with Javascript, so JSX tags and attributes are just HTML tags and attributes. Normally it’s fine to just use some semi-related font-lock face for them; mhtml.el uses function-call-face and constant-face for tags and attributes. But because in JSX, HTML tags and attribtues appear in the same buffer with Javascript code, if we use function-call-face and constant-face for tags and attributes, it’s impossible to change their appearance and not affect the functions and constants in Javascript code, because we are using the same face for JS functions and HTML tags, and JS constants and HTML attributes.

OK, but then how will these JSX-specific faces fit into the overall
scheme of treesit-font-lock faces?  For example, in what level will
they be used, and how will users know what level to set to see these
faces in their buffers?

These are the downsides of mode-specific faces, and if we think it's
important enough to have them, we should resolve these issues when we
install such faces.





  reply	other threads:[~2023-03-26  4:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 23:49 bug#62429: 30.0.50; Add jsx faces to typescript-ts-mode Yuan Fu
2023-03-25  5:47 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-25 12:30 ` Eli Zaretskii
2023-03-25 19:45   ` Yuan Fu
2023-03-26  4:37     ` Eli Zaretskii [this message]
2023-03-30  0:28       ` Yuan Fu
2023-03-30  5:25         ` Eli Zaretskii
2023-03-30  8:11           ` Yuan Fu
2023-03-30 14:31             ` Eli Zaretskii
2023-04-02 22:10               ` Yuan Fu

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=837cv4b020.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=62429@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=theo@thornhill.no \
    /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).