[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#8439: [PATCH] ffap.el -- detect paths with spaces (v2)
From: |
Eli Zaretskii |
Subject: |
bug#8439: [PATCH] ffap.el -- detect paths with spaces (v2) |
Date: |
Fri, 19 Oct 2012 13:22:10 +0200 |
> Date: Fri, 19 Oct 2012 13:05:56 +0300
> From: jari <jari.aalto@cante.net>
> Cc: 8439@debbugs.gnu.org, hochberg@dmhsoftware.com
>
> | What will this do to text such as the one below?
> |
> | C:\emacs\bin\prog1.exe on Windows or /usr/bin/prog1 on Unix.
>
> User can enable/disable if spaces are taken into account. If enabled,
> the result is:
>
> "C:\emacs\bin\prog1.exe on Windows or /usr/bin/prog1"
Why would it exclude the " on Unix." part?
> If you have strategiy to make it better, please suggest.
(I don't use ffap, so take the below with a grain of salt.)
Several things come to mind:
. You could modify the heuristics depending on the major mode. E.g.,
if it's Text or anything derived from text, file names with spaces
will generally be delimited by quotes.
. You could by default stop "skipping" when you see common words like
"on", "and", "or", "and/or", etc.
. You could by default stop when the slash flavor changes, like first
\, then / (see my example).
. At least in text modes, punctuation (with the notable exception of
a period) will not normally be part of a file name.
> | > 3. In Cygwin Emacs the paths are expected to be in "/cygdrive/<letter>/"
> | > format.
> |
> | What about Posix-standard /foo/bar/baz, which is the usual case on
> | Cygwin?
>
> Only "<drive letter>:" is converted into "/cygdrive/<drive letter>" under
> Cygwin.
Sorry, I don't follow. You said "In Cygwin Emacs the paths are
_expected_ to be", so I assumed you mean the file names on Cygwin are
_required_ to be in the /cygdrive/x/foo form. Maybe I misunderstood
what you meant.