Subject: bug#17950: 24.4.50; REGRESSION: `read-file-name' from a menu (mouse) treats "~/" as installation dir

From: Eli Zaretskii <[email-masked]>
Date: Sun, 06 Jul 2014 18:56:31 +0300

> Date: Sun, 6 Jul 2014 08:10:35 -0700 (PDT)
> From: Drew Adams <[email-masked]>
> Cc: [email-masked]
> 
> I invoked emacs -Q from a Windows shortcut with `Target':
> Z:\path\to\runemacs.exe -Q --debug-init
> and with `Start in' set to its default: z:\path\to\Emacs\bin
> 
> I then used *scratch* to evaluate the recipe code.
> I have env var HOME defined, also. And Emacs recognizes "~/" correctly
> (apart from the bug).
> 
> When I check `default-directory' it is "Z:\\path\\to\\bin/" (dunno
> why there is a forward slash at the end but the others are backslashes).
> If I change `Start in' then `default-directory' changes to reflect it,
> correctly.  But the dir used by the menu item is still the (same) wrong
> one.

Repeating this, everything I see is the same as you, except that the
file selection dialog still shows my home directory.

> However, it seems that the directory used for the file selection box
> is not related to `Start in'.  It seems to be the something like a
> dir used in a different or a previous Emacs session (?).  Not sure
> about that, but it definitely comes up with a directory that is
> unrelated to either my HOME or the directory in `Start in'.

Could be a Windows 7 thing (I'm testing on XP here).  I think it
remembers the last directory you were in, or something.  I'll try on
Windows 7 when I can.