From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: StrawberryTea Newsgroups: gmane.emacs.devel Subject: [PATCH] ffap.el: Exclude angle brackets from file names in XML Date: Sat, 9 Mar 2024 15:37:44 -0600 Message-ID: <874jdfkrno.fsf@strawberrytea.xyz> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27501"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.0; emacs 30.0.50 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 09 22:44:28 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 1rj4UP-0006xU-6e for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Mar 2024 22:44:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj4Tg-0003nP-Vs; Sat, 09 Mar 2024 16:43:37 -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 1rj4Te-0003nE-VM for emacs-devel@gnu.org; Sat, 09 Mar 2024 16:43:35 -0500 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rj4Tc-0006GX-C1 for emacs-devel@gnu.org; Sat, 09 Mar 2024 16:43:34 -0500 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id 13180320010B; Sat, 9 Mar 2024 16:43:25 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 09 Mar 2024 16:43:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= strawberrytea.xyz; h=cc:content-type:content-type:date:date:from :from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm2; t=1710020605; x=1710107005; bh=IOPcpe6cU8 o2aPn2sDpeEzusbAnbqcAP0IkvGe5lw9w=; b=AmGjHwZjxYaHuDPp/cH1H6N3FF FJGLLmGc46gKfi5PJmkWAMXbiN4LtakPeEitxtjgsZtJwfZUO71uI2LsXA88tQgA UVgwyp/o7h6oZ1IIDfvPomr0yPguAvyWlZxY1fgow4GnFGM7zqYa7kELMoH5myDX 2QqGM099ewE5uhgBtHex7976JXT4S10whmkBJDQlgkdHb8eZYoYL9GCLH6Gwhmt4 +Caa1tnhazr+sOSdxBq9y0K7EQ5VbEDtRdHTNNywkX5+WCQ71rq111Tww34gezFk fqSnCwsejhuZJ94Xrn5ZO/M0sciFsv+N/Fk6vygnz166Hzp78Ch6EGuSbGBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1710020605; x=1710107005; bh=IOPcpe6cU8o2aPn2sDpeEzusbAnbqcAP0Ik vGe5lw9w=; b=U0K/xauGmIKqcVV1REb0Hybg6mkGYBs+mcz1O3Cb3BtoyhRYToF T3TUzcAZDNyfdEh+g4/YwU/l2n0uvgoHoD+0ROyl3NMQwoB5fm3c1c/9R34dR5oj oJbzrUpMFrzsTbCkAygLYKUAGhygHEbBr2lpUYCSiF3RZNWPrhZlin23SydzoQwe FAlo8UEnKGAHqTHe3kRrqi6cGxVa4Cv18NSQrz7M3UOnqUPzxdMioczv80yGFosw +L0h1cErGJA0KvBndU7Q3B76G0TysOWRQb+Nwl70MlMhdX/bFfjQ59LJa1iZfbx+ tGg0bDC3hFPEoEpGUNf0f2tF+KuYxEJG0WA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrieejgddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf fuffgfkfggtgesthdtredttdertdenucfhrhhomhepufhtrhgrfigsvghrrhihvfgvrgcu oehlohhokhesshhtrhgrfigsvghrrhihthgvrgdrgiihiieqnecuggftrfgrthhtvghrnh eptdegffeijeefieegtdegueetueejgfehudehgeegieetudffteekledtgefgieeknecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhhoohhkse hsthhrrgifsggvrhhrhihtvggrrdighiii X-ME-Proxy: Feedback-ID: id85149b6:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 9 Mar 2024 16:43:25 -0500 (EST) Received-SPF: pass client-ip=64.147.123.20; envelope-from=look@strawberrytea.xyz; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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: 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:316958 Archived-At: 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:]~*?#" "{<@" "@>;.,!:}") ) "Alist of (MODE CHARS BEG END), where MODE is a symbol. This is possibly a major-mode name, or one of the symbols -- 2.44.0 -- StrawberryTea