From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62429: 30.0.50; Add jsx faces to typescript-ts-mode Date: Sun, 26 Mar 2023 07:37:11 +0300 Message-ID: <837cv4b020.fsf@gnu.org> References: <79CDDA5E-421D-4760-B744-F0C661118711@gmail.com> <83lejlc8sy.fsf@gnu.org> <10D725F2-9162-4BC3-B362-1F54719C8313@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26215"; mail-complaints-to="usenet@ciao.gmane.io" Cc: theo@thornhill.no, 62429@debbugs.gnu.org, monnier@iro.umontreal.ca To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 26 06:38:13 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgI8z-0006Ws-0P for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Mar 2023 06:38:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pgI8q-0006Kh-Qj; Sun, 26 Mar 2023 00:38:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pgI8p-0006KN-Es for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 00:38:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pgI8o-0001sZ-Oh for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 00:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pgI8o-0008Js-JU for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 00:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Mar 2023 04:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62429 X-GNU-PR-Package: emacs Original-Received: via spool by 62429-submit@debbugs.gnu.org id=B62429.167980544231930 (code B ref 62429); Sun, 26 Mar 2023 04:38:02 +0000 Original-Received: (at 62429) by debbugs.gnu.org; 26 Mar 2023 04:37:22 +0000 Original-Received: from localhost ([127.0.0.1]:43804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgI89-0008Iw-RH for submit@debbugs.gnu.org; Sun, 26 Mar 2023 00:37:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgI87-0008Ij-Ci for 62429@debbugs.gnu.org; Sun, 26 Mar 2023 00:37:19 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pgI81-0001rg-2K; Sun, 26 Mar 2023 00:37:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=rvJ82hPb/dw1ygfg0AfRX3q+qk5YZ6523S4d+6PJUcI=; b=El4nAIzBU0CU5l42GMtF Tsd7Au0g9vkY7m4cNQM31i55bOQmw+wEJHDVviz4HbqdJWWSf7W8VM1lwxyfmDBIdUpOngWIQLe3s 90eAIeQo4FFqABbq6mm6Ltrilmhp3C7A/nW7Hd6LO2KUtalKvduXVBktmeUIzBx5Q1kIQTEw9raE4 8WfX6SHOnsfswreaOPwXLCUtw6JiYAB0R1g/FLFZO0SgtJazMXjd/StzPzW0q6T2d3useCWwJG5DL FESDjk9O2S/etPDPaai63EN8jRhvV/HK5MdO4FRVLEQ96/KZu20X2hvzqgouvsOr0JKCcGQWzlPi5 ZOJURtl/vtQRtg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pgI80-0006K7-4Z; Sun, 26 Mar 2023 00:37:12 -0400 In-Reply-To: <10D725F2-9162-4BC3-B362-1F54719C8313@gmail.com> (message from Yuan Fu on Sat, 25 Mar 2023 12:45:01 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:258648 Archived-At: > From: Yuan Fu > Date: Sat, 25 Mar 2023 12:45:01 -0700 > Cc: Stefan Monnier , > 62429@debbugs.gnu.org, > theo@thornhill.no > > > On Mar 25, 2023, at 5:30 AM, Eli Zaretskii 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.