emacs-devel
[Top][All Lists]
Advanced

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

Re: abbreviate-file-name on Windows seems incorrect


From: Stephen Leake
Subject: Re: abbreviate-file-name on Windows seems incorrect
Date: Mon, 08 Jan 2007 03:44:09 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt)

Eli Zaretskii <address@hidden> writes:

> Please show your precise test case (in "emacs -Q").

On trying to reproduce my test, I'm getting different results (sigh).

Here's the test:

On Windows, before Emacs, in Cygwin bash:

$ echo $HOME
/Stephe
 
$ emacs -Q

---- in *scratch* -------
(getenv "HOME")
"C:\\Stephe"

(expand-file-name "~/foo")
"c:/Stephe/foo"

(abbreviate-file-name "/Stephe/foo")
"/Stephe/foo"

(abbreviate-file-name "c:\\Stephe\\foo")
"c:\\Stephe\\foo"

(abbreviate-file-name "c:\\Projects\\foo")
"c:\\Projects\\foo"


(setenv "HOME" "c:\\Projects")
"c:\\Projects"

(getenv "HOME")
"c:\\Projects"

(expand-file-name "~/foo")
"c:/Projects/foo"

(abbreviate-file-name "c:\\Projects\\foo")
"c:\\Projects\\foo"

----------

Now I'm getting the expected behavior from 'expand-file-name', but not
from 'abbreviate-file-name'. This is from

GNU Emacs 22.0.92.1 (i386-mingw-nt5.1.2600) of 2007-01-06 on ACS1100007992

I have access to a Sun Solaris box:

GNU Emacs 21.4.1 (sparc-sun-solaris2.8, X toolkit, Xaw3d scroll bars) of 
2005-09-21 on ra

-------
(getenv "HOME")
"/home/stephe"

(expand-file-name "~/foo")
"/home/stephe/foo"

(abbreviate-file-name "/home/stephe/foo")
"~/foo"

(abbreviate-file-name "/home/Projects/foo")
"/home/Projects/foo"


(setenv "HOME" "/home/Projects")
t

(getenv "HOME")
"/home/Projects"

(expand-file-name "~/foo")
"/home/Projects/foo"

(abbreviate-file-name "/home/Projects/foo")
"/home/Projects/foo"

---------

This is exhibiting the expected behavior for 'expand-file-name', and
the caching behavior for 'abbreviate-file-name'.

-- 
-- Stephe




reply via email to

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