[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: expand-file-name leaves "/../" in expansions at times
From: |
Chong Yidong |
Subject: |
Re: expand-file-name leaves "/../" in expansions at times |
Date: |
Tue, 17 Apr 2007 10:54:21 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.98 (gnu/linux) |
Jason Rumney <address@hidden> writes:
> Chong Yidong wrote:
>> Convert filename name to absolute, and canonicalize it.
>>
>> All your examples are consistent with this behavior. The important
>> thing is that DEFAULT-DIRECTORY is only consulted if the filename is
>> relative.
>>
> But shouldn't the "and canonicalize it" step involve replacing the ../
> with the actual directories they represent?
Hmm, that's true. It seems that Emacs treats both / and /../ as
semi-independent canonical directories, which is a little
counter-intuitive.
(expand-file-name "/../a")
"/../a"
(expand-file-name "/../../a")
"/a"
On the other hand, I just checked, and this behavior seems to have
been around since at least Emacs 20. Glancing through the source
code, this behavior seems to be deliberate---something to do with the
"superroot directory". Maybe someone on this list can elucidate?
- expand-file-name leaves "/../" in expansions at times, Diane Murray, 2007/04/16
- Re: expand-file-name leaves "/../" in expansions at times, Chong Yidong, 2007/04/16
- Re: expand-file-name leaves "/../" in expansions at times, Jason Rumney, 2007/04/17
- Re: expand-file-name leaves "/../" in expansions at times, Jan Djärv, 2007/04/18
- Re: expand-file-name leaves "/../" in expansions at times, Richard Stallman, 2007/04/18
- Re: expand-file-name leaves "/../" in expansions at times, Glenn Morris, 2007/04/19
- Re: expand-file-name leaves "/../" in expansions at times, Miles Bader, 2007/04/19
- Re: expand-file-name leaves "/../" in expansions at times, Glenn Morris, 2007/04/19
- Re: expand-file-name leaves "/../" in expansions at times, Glenn Morris, 2007/04/19
- Re: expand-file-name leaves "/../" in expansions at times, Stefan Monnier, 2007/04/19