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#74307: 30.0.92; emacs-lisp font-locking word regexp Date: Thu, 14 Nov 2024 10:11:43 +0200 Message-ID: <868qtmkzeo.fsf@gnu.org> References: <87jzdawagd.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29985"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74307@debbugs.gnu.org To: Roland Winkler , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 14 09:12:43 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 1tBUy2-0007b6-JX for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Nov 2024 09:12:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBUxR-0008Aw-Jw; Thu, 14 Nov 2024 03:12:05 -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 1tBUxP-0008Ab-9X for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 03:12:03 -0500 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 1tBUxP-0005TP-0i for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 03:12:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=pK2kVx3VZGQa84INLLoOc+an7Imhamx0pFUdnCJOhDI=; b=bNrgQUj10xuONefM8OrspJjLgEj6t9B/0PYvIGhZO7bN1T+oAb917TvldLWRdy4EEeOP7AQmNrTiPkDgXWuHsD3B5QjKKbu0/KSLQ9DUcyIw5RMuG6PxJreoNZEYEpLRQp2/WRzELO61UiB1oFRes009Bw0bnUj/CFPjqcIP8womzAmmQqyFa5OO36zEPLsE1TgfrKlI6JIwDbn5Y6tN8vNHUKIGTtYyUf8XbjelH0xNN1DPh7WXCjE6jbCBFga2Lc19cFboLQRS5u98TMkMervQjn5XM+MNy4qABooWGj9o9AWEDtjl+hXIbKVQ2djPD+u6HBKPgWjMx7bwmCpcvg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBUxN-00009N-Ub for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 03:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Nov 2024 08:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74307 X-GNU-PR-Package: emacs Original-Received: via spool by 74307-submit@debbugs.gnu.org id=B74307.1731571912560 (code B ref 74307); Thu, 14 Nov 2024 08:12:01 +0000 Original-Received: (at 74307) by debbugs.gnu.org; 14 Nov 2024 08:11:52 +0000 Original-Received: from localhost ([127.0.0.1]:44886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBUxE-00008x-Gm for submit@debbugs.gnu.org; Thu, 14 Nov 2024 03:11:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBUxD-00008j-6T for 74307@debbugs.gnu.org; Thu, 14 Nov 2024 03:11:51 -0500 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 1tBUx7-0005SA-0F; Thu, 14 Nov 2024 03:11:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=pK2kVx3VZGQa84INLLoOc+an7Imhamx0pFUdnCJOhDI=; b=aF30TOxvYPxy viJcoodZ0tNfLT01S3dfqCWHteU0InNKGvwFZBopHiqNWq7lwDA/8gvOjGv77QDb/YBi3jg3s4Ga6 2hUmU3WAI+eN7/qu1whVAeOx1MUFQRas39Q54UqiWw3yGzbVbleZ3DM7sWeOtORZNKUYjniYRQ+B7 Fpb/WzaVZ87WPJ+yVbebE0oOahnRYkqQ76CJETXQK4Xi18hg5EcXKT12D4ansrmaRFVwR9Tp3Z6Oz /xK6RwdjovByLa1J3rI9CFzIwwHf+1W4gdTIB5tILobUd40ODJAey94hqBG0M1NQ3tJa2xwaz4ScM OEhE0wT5//TGRP98MH3SLw==; In-Reply-To: <87jzdawagd.fsf@gnu.org> (message from Roland Winkler on Mon, 11 Nov 2024 00:28:34 -0600) 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:295310 Archived-At: > From: Roland Winkler > Date: Mon, 11 Nov 2024 00:28:34 -0600 > > Starting from emacs -Q, put the following into a buffer with > emacs-lisp-mode > > (setq foo "\\") > > The part "foo\\" of the string "\\" will get > font-lock-variable-name-face, which looks odd. > > I believe, this is due to a clause in lisp-mode.el that says > > ;; Words inside \\[], \\<>, \\{} or \\`' tend to be for > ;; `substitute-command-keys'. > > But this assumption is not always correct, in particular if ">" is > preceded by "\\", which happens when constructing regexps. I believe you are saying that in (,(rx "\\\\" (or (seq "<" (group-n 1 lisp-mode-symbol) ">") (seq "{" (group-n 1 lisp-mode-symbol) "}"))) (1 font-lock-variable-name-face prepend)) we should use something like the below instead? (,(rx "\\\\" (or (seq "<" (group-n 1 lisp-mode-symbol) (not "\\\\") ">") (seq "{" (group-n 1 lisp-mode-symbol) (not "\\\\") "}")) And similarly for \\[] etc.?