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.devel Subject: Re: [PATCH] ffap.el: Exclude angle brackets from file names in XML Date: Sun, 10 Mar 2024 07:48:27 +0200 Message-ID: <86ttlewsb8.fsf@gnu.org> References: <874jdfkrno.fsf@strawberrytea.xyz> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16310"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: StrawberryTea Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 10 06:49:09 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rjC3Z-00040f-71 for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Mar 2024 06:49:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjC2z-00061A-Ag; Sun, 10 Mar 2024 00:48:33 -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 1rjC2u-00060v-Lm for emacs-devel@gnu.org; Sun, 10 Mar 2024 00:48:28 -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 1rjC2u-0007xl-CD; Sun, 10 Mar 2024 00:48:28 -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=5ECyfZa+jttKOOBo/dcogqTCzy7M9mWRvp6tApr+Gdk=; b=hgygAD5mdw1b zEuHUWjhijrqUjyQ5ZRzgIk03tJAnoQGCUK7RejOJApd2SPTx8lNP3oITap04+JHb6G9ezwqBvMFx mkikdo9g49E9nGO8mOfKhhBnnsat2RMvlqO+6h3y9NVY9YtGuXwcUUS2eFd13tQ7VEOn6uk93xWdJ M8CGN9Fffbm5KW8dVV//45/kH5odEB5Cgolkfuu9NrntDDfPKUouso+M64pR9CPGgAjIEy7wqgy2n yTIEVb4t54TGnSZswHDQ2l36grYk1ycEd2gB/CA9fxx1vcZCxR03IClwi81uW7DzuZr24ocSswPyA Z/JDnG9wOOMnoz30iE+KKQ==; In-Reply-To: <874jdfkrno.fsf@strawberrytea.xyz> (message from StrawberryTea on Sat, 9 Mar 2024 15:37:44 -0600) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316960 Archived-At: > From: StrawberryTea > Date: Sat, 9 Mar 2024 15:37:44 -0600 > > In my company's code base, we have a lot of XML files that contain file > names in tags. For example: > > foo/bar.txt > > Currently, ffap.el does not recognize these file names as such, because > it recognizes the angle brackets as part of the file name. This patch > fixes that. > --- > lisp/ffap.el | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lisp/ffap.el b/lisp/ffap.el > index 5383f743878..b2b681b7c44 100644 > --- a/lisp/ffap.el > +++ b/lisp/ffap.el > @@ -1065,6 +1065,9 @@ ffap-string-at-point-mode-alist > ;; (La)TeX: don't allow braces > (latex-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:") > (tex-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:") > + ;; XML: don't allow angle brackets > + (xml-mode "--:\\\\${}+@-Z_[:alpha:]~*?#" "{<@" "@>;.,!:}") > + (nxml-mode "--:\\\\${}+@-Z_[:alpha:]~*?#" "{<@" "@>;.,!:}") > ) Wouldn't it be better to teach ffap.el to use the ... markup directly in XML? XML actually tells us this is a file name, so why do we need to guess using regexps? Thanks.