all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: StrawberryTea <look@strawberrytea.xyz>
To: emacs-devel@gnu.org
Subject: [PATCH] ffap.el: Exclude angle brackets from file names in XML
Date: Sat, 9 Mar 2024 15:37:44 -0600	[thread overview]
Message-ID: <874jdfkrno.fsf@strawberrytea.xyz> (raw)

In my company's code base, we have a lot of XML files that contain file
names in tags.  For example:

  <file>foo/bar.txt</file>

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



             reply	other threads:[~2024-03-09 21:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 21:37 StrawberryTea [this message]
2024-03-10  5:48 ` [PATCH] ffap.el: Exclude angle brackets from file names in XML Eli Zaretskii
2024-03-10  6:04   ` LemonBreezes
2024-03-10  6:40     ` Eli Zaretskii
2024-03-10  7:20       ` Yuri Khan
2024-03-10  7:51         ` Eli Zaretskii
2024-03-10 10:30           ` Yuri Khan
2024-03-10 10:46             ` Eli Zaretskii
2024-03-10 12:17               ` Yuri Khan
2024-03-10 12:43                 ` Eli Zaretskii
2024-03-10 13:15                   ` Yuri Khan
2024-03-10 13:53                     ` Lynn Winebarger
2024-03-14  9:49 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jdfkrno.fsf@strawberrytea.xyz \
    --to=look@strawberrytea.xyz \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.