GNU bug report logs - #26190
25.1; ffap problem with curly braces

Previous Next

Package: emacs;

Reported by: wyousef <at> fcih.net

Date: Mon, 20 Mar 2017 11:53:01 UTC

Severity: minor

Tags: fixed

Found in version 25.1

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: wyousef <at> fcih.net
Cc: 26190 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#26190: 25.1; ffap problem with curly braces
Date: Fri, 26 Jul 2019 13:26:50 +0200
wyousef <at> fcih.net writes:

> In scratch buffer with cursor on {/etc} do M-: (ffap-guesser) RET
>
> With emacs-25 => nil
> With emacs-24.5 => "/etc"

The regression occurred with this commit:

commit ba6c32b6decaa2a72a3d5f854efd513e8e82c118
Author: Dmitry Gutov <dgutov <at> yandex.ru>
Date:   Wed Apr 8 03:18:38 2015 +0300

    ffap: Support environment variable expansion in file names
    
    Fixes: debbugs:19839
    
    * lisp/ffap.el (ffap-string-at-point-mode-alist): Support
    environment variable expansion in file names.

diff --git a/lisp/ffap.el b/lisp/ffap.el
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1007,1 +1007,1 @@
-    (file "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
+    (file "--:\\\\$\\{\\}+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")

Which is slightly confusing since \\{ and \\} are number repetition
things while {} are literal braces, but I guess Emacs will interpret
them the same way here when they can't be repetition arguments in this
form.

So this means that the braces are now part of the file name, and since
"{/etc}" doesn't exist, you get nil.

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.

Opinions?

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




This bug report was last modified 5 years and 306 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.