bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7617: 24.0.50; `expand-file-name': removal of slashes


From: Stefan Monnier
Subject: bug#7617: 24.0.50; `expand-file-name': removal of slashes
Date: Sun, 12 Dec 2010 22:53:40 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> I am using the function `expand*' on user input (one operation among
> many), to do just what is advertised for `expand*'

There-s your problem.  You treat user input in a `read-file-name' as an
actual file name (i.e. suitable to pass to functions like
expand-file-name), whereas it is actually a different beast, closely
related, but different: it has this "..// -> /" and ".../~ -> ~" rules,
as well as env-var expansion (which also implies "$$ -> $" rewrite).
And even these special rules depend on file-name-handlers so, e.g., they
do not apply to URLs but other rules may aaply to other
special filenames.  I.e. the only safe thing to do is to first pass those
strings through substitute-for-file-name.


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]