From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wilhelm Kirschbaum Newsgroups: gmane.emacs.bugs Subject: bug#64275: 30.0.50; [PATCH] Improve sigil font-lock match for elixir-ts-mode Date: Sat, 07 Oct 2023 11:59:36 +0200 Message-ID: <87jzryg370.fsf@gmail.com> References: <87zg4od38w.fsf@gmail.com> <87ttuvorbw.fsf@epfl.ch> <87y1k7j4ov.fsf@gmail.com> <68d19873-5c5f-894a-080f-b2e1bacc449a@gutov.dev> <87cz0995eq.fsf@gmail.com> <77c5df43-6a3f-b99b-ed33-2094376e16e7@gutov.dev> <87leew7d7u.fsf@gmail.com> <9c5eb888-f2df-5243-53d4-95d1d1b2e2f4@gutov.dev> <87leeuvtft.fsf@gmail.com> <87edi6reyf.fsf@gmail.com> 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="15144"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.3; emacs 30.0.50 Cc: Basil Contovounesios , 64275@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 07 12:04:03 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 1qp4AF-0003kn-6P for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Oct 2023 12:04:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qp49x-0004p0-Bs; Sat, 07 Oct 2023 06:03:45 -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 1qp49v-0004oh-Ek for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 06:03:43 -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 1qp49v-0004xX-71 for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 06:03:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qp4AE-0008Js-1y for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 06:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wilhelm Kirschbaum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Oct 2023 10:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64275 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64275-submit@debbugs.gnu.org id=B64275.169667301331944 (code B ref 64275); Sat, 07 Oct 2023 10:04:02 +0000 Original-Received: (at 64275) by debbugs.gnu.org; 7 Oct 2023 10:03:33 +0000 Original-Received: from localhost ([127.0.0.1]:53344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp49l-0008JA-9h for submit@debbugs.gnu.org; Sat, 07 Oct 2023 06:03:33 -0400 Original-Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:56602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp49j-0008Iw-1d for 64275@debbugs.gnu.org; Sat, 07 Oct 2023 06:03:31 -0400 Original-Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3248e90f032so2861925f8f.1 for <64275@debbugs.gnu.org>; Sat, 07 Oct 2023 03:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696672985; x=1697277785; darn=debbugs.gnu.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=LyYSngtl3C8EONmocC/Aho8lDxq1iP1yQRqt4tcLEbs=; b=WnJuLtzLtHIFVHQA9rrg8d3sIMA9VhnyGDjsuNfAv4SEAq9DxDiVRTnKE+0TOLHAcL 1HLBSA9BLMWNhSxvnA7HfWG7KWtJ/z53ppsL5YqsKWSzoLwu/UrvHOs8UmgTmwiYxWku IjtL1E1873IVr77oXlKF3eU2fBnGXp/5G8lXmiJ0VwB8wGFVqWlHIY8CLu900uJ1z7Dv HHcRvUR79Z20ogXixkf7JhJSZQMmRIYsK1xOk+cjMuxhWPtAwY0dCQQf00L37PMjzuDo Yp8yPRm4RAMK91gIaob2PBbWTmuY550gxDCdvb2Xzkc1Ir/FEcM/smpboNEM4p4OQztU w82g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696672985; x=1697277785; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LyYSngtl3C8EONmocC/Aho8lDxq1iP1yQRqt4tcLEbs=; b=ml3DxqfwpGNe2nGI9jH5J6NCc0AxQK8dpQaM3rrBWY3OWcsaQJHn8uUBNMk4JqBCei aQdj0IesBvRgknFjnLePSnRuD8Eg+gWegY9A+sgwZ+/8C8Ovd2d3/95mcUX7WC6Nezon Px8t34JWl7XQueS985lV5TXXP63GnT6NhJfsTReKf2wRy48wkEx4+jGh6tHMAePfT3jq 8h0d22e0PKkyN7xcrALb6EaUDCd7sM5194w+5N3TmFZDOqmmoLySjcUr6Omu7ODdu1/I Kq6WDUTk1trIYx1en3706TRaJ9tKYRMPZfsCTO963WwI7fmBLyihGFpApwOjgJPZjYqr SqvA== X-Gm-Message-State: AOJu0YyjTut8ujNcgNFTX59dCyiA5MkAwxguvmIvVxPIxbVf4kwHuypb /VbwcuOYWNkImWyu/yrtgu+BGvz6JbdaorPc X-Google-Smtp-Source: AGHT+IES354Q7Y+cUZY+bIBz+TZV9xFoM+REiXwVzswkbZMh3qd9k83tvOjwwT5nbIF+cslOinEDJw== X-Received: by 2002:adf:e9d0:0:b0:313:e8b6:1699 with SMTP id l16-20020adfe9d0000000b00313e8b61699mr8815099wrn.55.1696672984824; Sat, 07 Oct 2023 03:03:04 -0700 (PDT) Original-Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id e18-20020adffd12000000b0031980783d78sm3824284wrr.54.2023.10.07.03.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 03:03:03 -0700 (PDT) In-reply-to: <87edi6reyf.fsf@gmail.com> 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:271987 Archived-At: --=-=-= Content-Type: text/plain; format=flowed >> >> I'm not sure what you meant by the last sentence, sorry. What >> do you >> think about the below? >> >> (sigil (sigil_name) @elixir-ts-font-sigil-name-face) >> @font-lock-string-face) > > Sorry for the late reply. I believe the following patch is more > appropriate as it will apply the sigil font to the entire sigil, > but > also respect the regex face. We can add string specific matches > later, > but happy just to simplify what we have and fix apply > appropriate font > to previously unmatched sigils. > > [2. text/x-patch; > 0001-Simplify-sigil-font-lock-match-for-elixir-ts-mode.patch]... Actually, the above patch breaks the embedded HEEx sigils' font. We have to exclude it when doing a general match. Attached works with ~H sigils as well. Please ignore the previous patch and install this one. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename="0001-Simplify-sigil-font-lock-match-for-elixir-ts-mode(1).patch" >From 12b7227185e22923d1e67e3f5a47af97879e2ad2 Mon Sep 17 00:00:00 2001 From: Wilhelm H Kirschbaum Date: Sat, 7 Oct 2023 10:37:49 +0200 Subject: [PATCH] Simplify sigil font-lock match for elixir-ts-mode There is no need to match on specific sigils, except for regex. * lisp/progmodes/elixir-ts-mode.el (elixir-ts--font-lock-settings): Update sigil match. --- lisp/progmodes/elixir-ts-mode.el | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 2ddce3de105..de078454463 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -466,23 +466,19 @@ elixir-ts--font-lock-settings :language 'elixir :feature 'elixir-sigil - :override t `((sigil - (sigil_name) @elixir-ts-font-sigil-name-face - (:match "^[sSwWpPUD]$" @elixir-ts-font-sigil-name-face)) - @font-lock-string-face + (sigil_name) @font-lock-regexp-face + (:match "^[rR]$" @font-lock-regexp-face)) + @font-lock-regexp-face (sigil - "~" @font-lock-string-face (sigil_name) @elixir-ts-font-sigil-name-face - (:match "^[rR]$" @elixir-ts-font-sigil-name-face)) - @font-lock-regexp-face + (:match "^[^HF]$" @elixir-ts-font-sigil-name-face)) + @elixir-ts-font-sigil-name-face (sigil "~" @font-lock-string-face (sigil_name) @elixir-ts-font-sigil-name-face quoted_start: _ @font-lock-string-face - quoted_end: _ @font-lock-string-face - (:match "^[HF]$" @elixir-ts-font-sigil-name-face))) - + quoted_end: _ @font-lock-string-face)) :language 'elixir :feature 'elixir-string-escape :override t -- 2.42.0 --=-=-=--