From unknown Fri Jun 20 07:22:51 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#66162 <66162@debbugs.gnu.org> To: bug#66162 <66162@debbugs.gnu.org> Subject: Status: [PATCH] Various fixes to lua-ts-mode font-locking Reply-To: bug#66162 <66162@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:22:51 +0000 retitle 66162 [PATCH] Various fixes to lua-ts-mode font-locking reassign 66162 emacs submitter 66162 john muhl severity 66162 normal tag 66162 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 22 20:03:18 2023 Received: (at submit) by debbugs.gnu.org; 23 Sep 2023 00:03:18 +0000 Received: from localhost ([127.0.0.1]:37504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjq78-0000jr-9r for submit@debbugs.gnu.org; Fri, 22 Sep 2023 20:03:18 -0400 Received: from lists.gnu.org ([2001:470:142::17]:57158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjq6r-0000j9-Lu for submit@debbugs.gnu.org; Fri, 22 Sep 2023 20:03:12 -0400 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 1qjq6a-0007G0-FX for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 20:02:40 -0400 Received: from out-196.mta1.migadu.com ([95.215.58.196]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjq6Y-0005oo-1J for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 20:02:40 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; s=key1; t=1695427352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=D+HN7C1o6I15W0LkbAtrKfAZ+w7Ij1m3BdPY9t/B/wA=; b=YmKicL56LQkiTG74teDYsJTdfM0xJoB2XMGI6SwOWaSb6BC+8ez6lYpq5bJbXOfF8QLAST WY0j8/nliul/EAd0BudgbRbYAhFrbDOjHGBRQ2VXPdzYfPGKZxTfkhwXm03dIDQOGnAEIU PmGMbuLbeSHfRsLatbT8oo0gn84W5aY= From: john muhl To: bug-gnu-emacs@gnu.org Subject: [PATCH] Various fixes to lua-ts-mode font-locking Date: Fri, 22 Sep 2023 18:43:43 -0500 Message-ID: <871qepzrhn.fsf@pub.pink> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.196; envelope-from=jm@pub.pink; helo=out-196.mta1.migadu.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Tags: patch Here are some fixes around font-locking mostly to do with functions and assignments; e.g. f1 = function() end now correctly marks f1 as a function name. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Various-fixes-to-lua-ts-mode-font-locking.patch >From df023cab8834477c63adf7fdc88afa1871c0fc96 Mon Sep 17 00:00:00 2001 From: john muhl Date: Fri, 22 Sep 2023 18:36:18 -0500 Subject: [PATCH] Various fixes to lua-ts-mode font-locking * lisp/progmodes/lua-ts-mode.el (lua-ts--font-lock-settings): Identify functions and assignments in more places. Use constant face for goto/labels. --- lisp/progmodes/lua-ts-mode.el | 56 +++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 071953d3d2f..030a3585158 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -121,7 +121,9 @@ lua-ts--font-lock-settings :feature 'constant '((variable_list attribute: (attribute (["<" ">"] (identifier)))) - @font-lock-constant-face) + @font-lock-constant-face + (goto_statement (identifier) @font-lock-constant-face) + (label_statement) @font-lock-constant-face) :language 'lua :feature 'operator @@ -131,12 +133,6 @@ lua-ts--font-lock-settings @font-lock-operator-face (vararg_expression) @font-lock-operator-face) - :language 'lua - :feature 'property - '((field name: (identifier) @font-lock-property-name-face) - (dot_index_expression - field: (identifier) @font-lock-property-use-face)) - :language 'lua :feature 'builtin `(((identifier) @font-lock-builtin-face @@ -150,8 +146,7 @@ lua-ts--font-lock-settings name: (method_index_expression method: (identifier) @font-lock-function-call-face)) (function_call - name: (dot_index_expression - table: (identifier) @font-lock-function-call-face))) + name: (dot_index_expression (identifier) @font-lock-function-call-face))) :language 'lua :feature 'punctuation @@ -164,12 +159,7 @@ lua-ts--font-lock-settings @font-lock-variable-use-face) (function_call name: (method_index_expression - table: (identifier) @font-lock-variable-use-face)) - (goto_statement (identifier) @font-lock-variable-use-face)) - - :language 'lua - :feature 'assignment - '((variable_list (identifier) @font-lock-variable-name-face)) + table: (identifier) @font-lock-variable-use-face))) :language 'lua :feature 'number @@ -199,9 +189,43 @@ lua-ts--font-lock-settings :feature 'definition '((function_declaration name: (identifier) @font-lock-function-name-face) + (assignment_statement + (variable_list name: [(identifier)]) @font-lock-function-name-face + (expression_list value: (function_definition))) + (table_constructor + (field + name: (identifier) @font-lock-function-name-face + value: (function_definition))) + (function_declaration + name: (dot_index_expression (identifier) @font-lock-function-name-face)) + (function_declaration + name: (method_index_expression (identifier) @font-lock-function-name-face)) + (function_declaration + (method_index_expression + (dot_index_expression + table: (identifier) @font-lock-function-name-face + field: (identifier) @font-lock-property-name-face + ))) (parameters name: (identifier) @font-lock-variable-name-face) - (label_statement) @font-lock-variable-name-face) + (for_numeric_clause name: (identifier) @font-lock-variable-name-face)) + + :language 'lua + :feature 'property + '((field name: (identifier) @font-lock-property-name-face) + (dot_index_expression + field: (identifier) @font-lock-property-use-face)) + + :language 'lua + :feature 'assignment + '((variable_list + [(identifier) + (bracket_index_expression)] + @font-lock-variable-name-face) + (variable_list + (dot_index_expression + table: (identifier)) + @font-lock-variable-name-face)) :language 'lua :feature 'error -- 2.41.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 30 19:19:39 2023 Received: (at 66162-done) by debbugs.gnu.org; 30 Sep 2023 23:19:39 +0000 Received: from localhost ([127.0.0.1]:59983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmjFL-0000fE-AI for submit@debbugs.gnu.org; Sat, 30 Sep 2023 19:19:39 -0400 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]:57410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmjFJ-0000ey-94 for 66162-done@debbugs.gnu.org; Sat, 30 Sep 2023 19:19:38 -0400 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2c008042211so247244911fa.2 for <66162-done@debbugs.gnu.org>; Sat, 30 Sep 2023 16:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696115955; x=1696720755; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=VsSdvY9aSPH+qxcDeO96gLYKZcNsSKbJFBjpift9gmk=; b=NJk4B0dqmWnRnmply3hBE+kWHDil6jVbPM9pB0arJ8tKtNQcf5KJr1tst8weMdrX2e YaRkm25pcrS/IUALTR7P1ncaTVKiqlwPrgTrb/0K1OSUefrkCajXRrZgWrv+V4BODknI kPHRXciOoV1AHkqpUt7kZHqRsl5/qnzhb0DBdInmk7iFyQVGYbKAkyAfHeEHtQOPYdn3 KG9dm9zjmUy/HFVD5YFziJxoQSaRgFPlhoLiVGfMz4GVZrGL6tngJpe/Cp61bcC3qJca vDFOYz0Pk8z07hKfSmFyixI+C5cpAKlMyS/4wsuUgLgyU/2tsyAg63Nla+9QveTYv6Q/ uNYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696115955; x=1696720755; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VsSdvY9aSPH+qxcDeO96gLYKZcNsSKbJFBjpift9gmk=; b=dQG+0RC89KtzxwOLvD9Zh1uOU3PQUcIQq8o1uMbdNlJUMPJPxyWGFwqx4ewx1G8G7T ThvTGpnUHAqooVGZAOFh47BHmsxvmlZ0/jBCvsZWu3Wh8i1b2/pnlv5V25CFHykuehoL 5Ydq/ByfazKfRCUaZGEsM7Q1llKBiWdF5he3Xc1Ear9DucRZkoodA5+YLTqFNzGHWDBI FueNnqxt6d6PZwaxEB+gyyVPKgH7LLEjawF5t3Ucgma6uOICF9GdLHOsY0+GiY0eia9U 8QTacmxoUBYlegojRgdkEsj1ujs8OrclisBOva56WMYaimKsPX92aE/K9XiPloJMqmY9 ZoVA== X-Gm-Message-State: AOJu0YxcYDRasDmgAvP8c8eyc31f0jF4eg3K/XUkyHWgTpM6XmTI7+DF 79Ft/B7H/4/zzRnVC0YbPnZ1Ys+KftVyJq2QU2hwko8p X-Google-Smtp-Source: AGHT+IGNr4DLHiRsjSZHQYwujqVw7pnXLFcV9wXsOI5wi9uImWXoJFT6rUEK/gMyh1B7nFUuJ4HftCwhARKghrLDCQ4= X-Received: by 2002:a2e:8884:0:b0:2b9:ea17:558b with SMTP id k4-20020a2e8884000000b002b9ea17558bmr6504318lji.16.1696115955547; Sat, 30 Sep 2023 16:19:15 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 30 Sep 2023 16:19:15 -0700 From: Stefan Kangas In-Reply-To: <871qepzrhn.fsf@pub.pink> (john muhl's message of "Fri, 22 Sep 2023 18:43:43 -0500") References: <871qepzrhn.fsf@pub.pink> MIME-Version: 1.0 Date: Sat, 30 Sep 2023 16:19:15 -0700 Message-ID: Subject: Re: bug#66162: [PATCH] Various fixes to lua-ts-mode font-locking To: john muhl Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66162-done Cc: 66162-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Version: 30.1 john muhl writes: > Here are some fixes around font-locking mostly to do with functions and > assignments; e.g. > > f1 = function() end > > now correctly marks f1 as a function name. Thanks, installed on master. [1: 6dd1565fcf2]: 2023-10-01 01:17:36 +0200 Various fixes to lua-ts-mode font-locking https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=6dd1565fcf2887d4758e8a779f0c9d6320e85385 From unknown Fri Jun 20 07:22:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 29 Oct 2023 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator