From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60167: 30.0.50; [PATCH]: Fix wrong capture in typescript-ts-mode Date: Sat, 17 Dec 2022 20:15:17 +0100 Message-ID: <87bko1u9iy.fsf@thornhill.no> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21139"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= , casouri@gmail.com To: 60167@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 17 20:16:17 2022 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 1p6cfQ-0005HO-Ev for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Dec 2022 20:16:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6cfG-0002xi-1j; Sat, 17 Dec 2022 14:16:06 -0500 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 1p6cfE-0002xJ-AA for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 14:16:04 -0500 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 1p6cfE-0004CD-18 for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 14:16:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6cfC-0000hc-N3; Sat, 17 Dec 2022 14:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: jostein@secure.kjonigsen.net, casouri@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Dec 2022 19:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60167 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= , casouri@gmail.com Original-Received: via spool by submit@debbugs.gnu.org id=B.16713045262686 (code B ref -1); Sat, 17 Dec 2022 19:16:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Dec 2022 19:15:26 +0000 Original-Received: from localhost ([127.0.0.1]:57536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6cec-0000hG-7R for submit@debbugs.gnu.org; Sat, 17 Dec 2022 14:15:26 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:39720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6cea-0000hA-WC for submit@debbugs.gnu.org; Sat, 17 Dec 2022 14:15:25 -0500 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 1p6cea-0002qX-KH for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 14:15:24 -0500 Original-Received: from out-79.mta0.migadu.com ([91.218.175.79]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6ceY-0003vp-KB for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 14:15:24 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. Received-SPF: pass client-ip=91.218.175.79; envelope-from=theo@thornhill.no; helo=out-79.mta0.migadu.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:251309 Archived-At: --=-=-= Content-Type: text/plain Hi there! We've had a small regression after fbf0d3b796ac1b891be35b642878a1fd412ee5ea, and this patch fixes that. Yuan, want to apply after Josteins agrees on this fix? There's an example of the currently failing code in the commit message. There's also a small whitespace fix inside - I hope that's ok. Thanks guys :-) Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-wrong-capture-in-typescript-ts-mode.patch >From 931e96cd042aefe2807329de84751aa1a9e45bbb Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sat, 17 Dec 2022 20:07:59 +0100 Subject: [PATCH] Fix wrong capture in typescript-ts-mode An example of the issue could be: {({ active }) => ( link ? {text} : {text} )} Here 'link' as well as a lot of the other constructs inside of the parenthesized expression will be font-locked with 'font-lock-variable-name-face'. We only want to capture the identifier. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Make the variable capture only capture the identifier, and not the whole expression. --- lisp/progmodes/typescript-ts-mode.el | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index e7bd65c5e2..5eb810dd1d 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -231,7 +231,7 @@ typescript-ts-mode--font-lock-settings (arguments (identifier) @font-lock-variable-name-face) (parenthesized_expression (identifier) @font-lock-variable-name-face) - (parenthesized_expression (_ (identifier)) @font-lock-variable-name-face)) + (parenthesized_expression (_ (identifier) @font-lock-variable-name-face))) :language language :override t @@ -316,10 +316,7 @@ typescript-ts-mode--font-lock-settings :language language :feature 'escape-sequence :override t - '((escape_sequence) @font-lock-escape-face) - - - )) + '((escape_sequence) @font-lock-escape-face))) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode)) -- 2.34.1 --=-=-=--