all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: abbreviate-file-name on Windows seems incorrect
Date: Sat, 6 Jan 2007 08:22:09 -0800	[thread overview]
Message-ID: <EIENLHALHGIMHGDOLMIMEEBOCOAA.drew.adams@oracle.com> (raw)
In-Reply-To: <ulkkgz7v0.fsf@gnu.org>

> > I would expect (abbreviate-file-name "c:/foo/bar") to return
> > "~/foo/bar", but it returns "c:/foo/bar".
>
> This is a feature: the Windows port behaves here like the Unix version
> does, and doesn't change the file name if the home directory is a root
> directory.

OK.

> my $HOME's value is "d:/usr/eli":
> (abbreviate-file-name "d:/usr/eli/foo/bar") => "~/foo/bar"

I see. To tell the truth, I didn't bother to change $HOME outside Emacs and
start emacs -Q again to test the case other than HOME = "c:\\". I did try
using `setenv' to change "HOME", but that apparently doesn't have an effect
here. That is:

(setenv "HOME" "d:/usr/eli")
(abbreviate-file-name "d:/usr/eli/foo/bar") => "d:/usr/eli/foo/bar"

So, I didn't notice that it does work properly. Setting $HOME in Windows
itself to "d:\eli\" and then starting emacs -Q, I do get what you showed:

 (abbreviate-file-name "d:/usr/eli/foo/bar") => "~/foo/bar"

So, I was mistaken - no problem. Thx for the clear explanation.

How about mentioning in the doc string that "~" is not substituted for the
user's home dir if that is the root. ("/" in Unix or Linux,
"<drive-letter>:\" in Windows)? The doc string gives an incorrect idea of
what the function does, in this case (which is common in Windows).

  reply	other threads:[~2007-01-06 16:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-06  7:56 abbreviate-file-name on Windows seems incorrect Drew Adams
2007-01-06 11:37 ` Lennart Borgman (gmail)
2007-01-06 14:18   ` Eli Zaretskii
2007-01-06 15:03     ` Lennart Borgman (gmail)
2007-01-06 11:56 ` Eli Zaretskii
2007-01-06 16:22   ` Drew Adams [this message]
2007-01-06 21:51     ` Eli Zaretskii
2007-01-06 22:42       ` Drew Adams
2007-01-07  2:44       ` Miles Bader
2007-01-07  4:12         ` Eli Zaretskii
2007-01-07 14:29           ` Stephen Leake
2007-01-07 20:47             ` Eli Zaretskii
2007-01-07 22:03               ` Drew Adams
2007-01-07 22:08                 ` Drew Adams
2007-01-08  1:40                   ` Chris Moore
2007-01-08  2:04                     ` Drew Adams
2007-01-08 10:15                       ` Jason Rumney
2007-01-08 16:29                         ` Drew Adams
2007-01-09  0:01                         ` Richard Stallman
2007-01-09  0:30                           ` Jason Rumney
2007-01-09 12:55                             ` Stephen Leake
2007-01-09 17:57                             ` Richard Stallman
2007-01-08  8:44               ` Stephen Leake
2007-01-08 13:07                 ` Chris Moore
2007-01-08 19:30                 ` Eli Zaretskii
2007-01-09 12:52                   ` Stephen Leake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EIENLHALHGIMHGDOLMIMEEBOCOAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.