all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] ffap.el: Exclude angle brackets from file names in XML
@ 2024-03-09 21:37 StrawberryTea
  2024-03-10  5:48 ` Eli Zaretskii
  2024-03-14  9:49 ` Eli Zaretskii
  0 siblings, 2 replies; 13+ messages in thread
From: StrawberryTea @ 2024-03-09 21:37 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-03-14  9:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-09 21:37 [PATCH] ffap.el: Exclude angle brackets from file names in XML StrawberryTea
2024-03-10  5:48 ` 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

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.