Subject: bug#26190: 25.1; ffap problem with curly braces

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 26 Jul 2019 13:38:03 +0200

Lars Ingebrigtsen <[email-masked]> writes:

> This was intended to make ffap work better with files that have curly
> braces in the file names.  I guess "{/etc}" could be a valid file name?
> But it's an odd one, and I'd guess that it would more commonly refer to
> /etc.  So I think the right thing here is to revert this patch and just
> accept that we can't guess right on file names with weird characters in
> them.

On the other hand, we could just strip the "{" from the front and "}"
from the end, which will restore the previous behaviour and possibly
still work with other files?  I've installed this on the trunk:

diff --git a/lisp/ffap.el b/lisp/ffap.el
index 47ceed47e3..33854a6c0d 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1081,9 +1081,9 @@ ffap-string-at-point-mode-alist
   '(
     ;; The default, used when the `major-mode' is not found.
     ;; Slightly controversial decisions:
-    ;; * strip trailing "@" and ":"
+    ;; * strip trailing "@", ":" and enclosing "{"/"}".
     ;; * no commas (good for latex)
-    (file "--:\\\\${}+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
+    (file "--:\\\\${}+<>@-Z_[:alpha:]~*?" "{<@" "@>;.,!:}")
     ;; An url, or maybe an email/news message-id:
     (url "--:=&?$+@-Z_[:alpha:]~#,%;*()!'" "^[0-9a-zA-Z]" ":;.,!?")
     ;; Find a string that does *not* contain a colon:

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no