Subject: bug#52441: 28.0.50; ffap-file-at-point reports a keyword symbol as the current directory

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 12 Dec 2021 06:24:13 +0100

"Omar Antolín Camarena" <[email-masked]> writes:

> If you place point on the colon of any symbol, such as :foo and evaluate
> the expression (ffap-file-at-point) the result is the value of
> default-directory. This seems wrong, probably nil would be a better
> answer.  If you put point on any other character of the symbol,
> (ffap-file-at-point) does indeed return nil.

It's interpreted as a path.  I.e., with

/usr/bin:/bin

and point over the first bit, it returns "/usr/bin".  And empty
strings are valid directories in paths, and means "the current
directory".

So what it's doing is consistent, but perhaps surprising.  We could
change it to disregard the path interpretation if the string starts with
":", because that will be correct in the vast majority of the cases.

It more DWIM, but the ffap functions are already pretty DWIM, so I'm in
favour.  Anybody else got an opinion?

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