[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]
[MD:2797]NTEmacsen crashed, when expand-file-name.
- X-ml-count: 2797
- Subject: [MD:2797]NTEmacsen crashed, when expand-file-name.
- From: Andrew Innes <andrewi@xxxxxxx>
- Date: 13 Dec 2001 23:35:59 +0000
- User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7
On Thu, 13 Dec 2001 09:47:28 +0200, "Eli Zaretskii" <eliz@xxxxxxxxxxxxx> said:
>>Date: Thu, 13 Dec 2001 11:40:12 +0900 (JST)
>>From: Hideyuki SHIRAI (=?iso-2022-jp?B?GyRCR3IwZj0oOVQbKEI=?=)
>><shirai@xxxxxxxxxxx>
>>
>>step.1 Execute above elisp code on Windows.
>>step.2 Set default_directory = build_string ("/");
>>step.3 (find-file-name-handler "/" 'expand_file_name)
>>=> ange-ftp-completion-hook-function
>>step.4 ange-ftp-completion-hook-function() calls expand-file-name("/")
>>step.5 Set default_directory = build_string ("/");
>>step.6 But "/" is not rootdirectory in DOS_NT.
>>step.7 Excecute default_directory = Fexpand_file_name (default_directory, Qnil);
>>step.8 Excecute step.7 to infinitely.
>
>Thanks for debugging this.
>
>>I think important point 'step.5' to solve this infinity loop;
>>Set the value like "c:/" to default_directory when
>>default_directory is not string on Windows.
>
>I think "c:/" is not the best default. It is better to default to
>the current drive, the one where Emacs runs: that's the equivalent of
>the Unix default "/".
>
>Jason, do you agree? If so, does the Windows runtime have a function
>called `getdisk' or maybe `_getdisk', which returns a numerical drive
>index (0 = A:, 1 = B:, etc.)? Given this info, I can write a slightly
>different change for expand-file-name, specific to DOS_NT systems.
>
>
I would call GetModuleFileName to find the full location of emacs.exe,
and hence a valid drive letter. See w32.c for an example of calling
GetModuleFileName, and use the function `parse_root' in the same file to
extract the root directory.
AndrewI