From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vincenzo Pupillo Newsgroups: gmane.emacs.bugs Subject: bug#71593: 30.050; [PATCH] php-ts-mode: Fix font lock regex for user defined constant Date: Sun, 16 Jun 2024 16:53:24 +0200 Message-ID: <4882196.OV4Wx5bFTl@fedora> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart26453008.1r3eYUQgxm" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11933"; mail-complaints-to="usenet@ciao.gmane.io" To: 71593@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 16 16:54:16 2024 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 1sIrGo-0002l7-Td for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Jun 2024 16:54:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIrGc-00025s-BF; Sun, 16 Jun 2024 10:54:02 -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 1sIrGa-00025Q-TC for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2024 10:54:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIrGa-0000U0-LK for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2024 10:54:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sIrGb-0005QS-Ux for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2024 10:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vincenzo Pupillo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Jun 2024 14:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71593 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171854961720793 (code B ref -1); Sun, 16 Jun 2024 14:54:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Jun 2024 14:53:37 +0000 Original-Received: from localhost ([127.0.0.1]:35445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIrGC-0005PI-Cx for submit@debbugs.gnu.org; Sun, 16 Jun 2024 10:53:36 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:36998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIrG9-0005P5-Mm for submit@debbugs.gnu.org; Sun, 16 Jun 2024 10:53:34 -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 1sIrG7-00022Y-Dd for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2024 10:53:32 -0400 Original-Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIrG5-0000PR-6y for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2024 10:53:30 -0400 Original-Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-5295eb47b48so4273146e87.1 for ; Sun, 16 Jun 2024 07:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718549607; x=1719154407; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=HhMBoqlL6fqlw7AZmgwxi9gEdFTw8US2fy0ARqad0Ok=; b=RvH6HwkldedJ8ZumJqchI9Zet/5Njw72oz5JF2czZKhxtSbslcEH8SQzo/AR7953mH MCHdDLzg7mmVBWnpJjlv8DkTDXzFtPhOCynxd2e0BcU/rtMGU1b5PuVdgUAB2yCa0Zkh jkBf6uN2glGfFZ/TinYkpp8bIGA2O6NnYCvUskpgcXYbeWkUN3tB5P+WdF/e8oaU+lXC CgLMi2fZLbxZSOSias5fQYRBYdHCNgs2v67fafJsU4e2GGNO6SNsks9Z/meMT/Ey8WWX ID4gIHaI11jWjGhXJWmJwpCYv4sR3PcNcw5dXgmzNWIuufCzBiJ0taAcF0hpxFQ4ySnL tpwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718549607; x=1719154407; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HhMBoqlL6fqlw7AZmgwxi9gEdFTw8US2fy0ARqad0Ok=; b=gj8s4kMXi0WojB8EHkhLEAJ/6+QAMRL6jgqrdSO1EaOBN4cXSJqPEryp3JH4CRrPDD TOWCcNFoEz2CkNIcn9jjkeT/0kSmTnSag53l4n5+lItaIl/hy0O13iUtJ64G8v7+YVYW qVFOyhi42tAK1l1bb4AOM8UEGyTV+eM+P7kNM5MmScZ4FClyYJ8NCaK+DpP2vpcVOVdM YYNv2bt+/vsjq+bjESHEPUmQM3XjVFPFu/ALl1XRnjQLTDHmhtRv7KTMGtGMDrfqLGEb RSoWP1IeavDa62kdutzvHjIStx4giR1bH0+Xyj6+C+Iy++QtCdhp3FJzHIxPNOZXSxwn IqFg== X-Gm-Message-State: AOJu0YyGZdO4B2+z/S0I5UCTbhpgx14IYSMYDzzDidRlnKaC9YlVOLf6 gKB2wQNyAo2sOxxTUjA4wRbEx+u7L1JBnkxhrbfVbZtvP2I5q32vHAlNvi1+ X-Google-Smtp-Source: AGHT+IFLeLiHrF1JEGX4o0EHmZu4eQi/Bt0PuueZCt8w9hc1BR2BcnJCPVHmstksmnuFxJX1rg6NMw== X-Received: by 2002:a05:6512:b10:b0:52c:af5f:8535 with SMTP id 2adb3069b0e04-52caf5f85e7mr4852510e87.18.1718549606531; Sun, 16 Jun 2024 07:53:26 -0700 (PDT) Original-Received: from fedora.localnet (2-230-139-124.ip202.fastwebnet.it. [2.230.139.124]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-422874e73c7sm165102935e9.42.2024.06.16.07.53.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jun 2024 07:53:26 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=v.pupillo@gmail.com; helo=mail-lf1-x12e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:287337 Archived-At: This is a multi-part message in MIME format. --nextPart26453008.1r3eYUQgxm Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Hi, the regex for user-defined constants also matches functions with two or more uppercase characters. This patch fix this. Thanks Vincenzo --nextPart26453008.1r3eYUQgxm Content-Disposition: attachment; filename="0001-Fix-font-lock-regex-for-user-defined-constant.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="x-UTF_8J"; name="0001-Fix-font-lock-regex-for-user-defined-constant.patch" >From ef2bdb4b65e650b3859fea658b4198e37260aff9 Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo Date: Sun, 16 Jun 2024 16:32:53 +0200 Subject: [PATCH] Fix font lock regex for user defined constant The old regex also captured functions with two or more uppercase characters. This new regex fixes that issue. * lisp/progmodes/php-ts-mode.el (php-ts-mode--font-lock-settings): New regex that match only user-defined constants. --- lisp/progmodes/php-ts-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el index 64138db9dc8..29fb2728280 100644 --- a/lisp/progmodes/php-ts-mode.el +++ b/lisp/progmodes/php-ts-mode.el @@ -774,7 +774,7 @@ php-ts-mode--font-lock-settings @font-lock-builtin-face)) ;; user defined constant ((name) @font-lock-constant-face - (:match "_?[A-Z][0-9A-Z_]+" @font-lock-constant-face)) + (:match "\\`_?[A-Z][0-9A-Z_]+\\'" @font-lock-constant-face)) (const_declaration (const_element (name) @font-lock-constant-face)) (relative_scope "self") @font-lock-builtin-face -- 2.45.2 --nextPart26453008.1r3eYUQgxm--