all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: theodor thornhill <theo@thornhill.no>,
	62429-done@debbugs.gnu.org,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#62429: 30.0.50; Add jsx faces to typescript-ts-mode
Date: Thu, 30 Mar 2023 01:11:48 -0700	[thread overview]
Message-ID: <FF2FDBE4-94AA-4E97-9EBC-301994B9D655@gmail.com> (raw)
In-Reply-To: <83wn2y6caq.fsf@gnu.org>



> On Mar 29, 2023, at 10:25 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Wed, 29 Mar 2023 17:28:40 -0700
>> Cc: monnier@iro.umontreal.ca,
>> 62429@debbugs.gnu.org,
>> theo@thornhill.no
>> 
>>>> 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?
>> 
>> At level 3 for tsx-ts-mode, under the “jsx” feature. So they are enabled by default. Though it’s true that it’s not immediately obvious what face to customize. At the very least these faces appear in the customize group of typescript. We can add something to the docstring of the major mode, too.
>> 
>>> 
>>> 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.
> 
> Then it is fine by me, as long as those measures you mentioned are
> taken to make sure users know how to customize font-lock with these
> faces.

Cool. I pushed the change.

Yuan




  reply	other threads:[~2023-03-30  8:11 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
2023-03-30  0:28       ` Yuan Fu
2023-03-30  5:25         ` Eli Zaretskii
2023-03-30  8:11           ` Yuan Fu [this message]
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

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

  git send-email \
    --in-reply-to=FF2FDBE4-94AA-4E97-9EBC-301994B9D655@gmail.com \
    --to=casouri@gmail.com \
    --cc=62429-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --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 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.