emacs-devel
[Top][All Lists]
Advanced

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

Re: $USERPROFILE for $HOME on W32


From: Jason Rumney
Subject: Re: $USERPROFILE for $HOME on W32
Date: Mon, 22 Nov 2004 08:44:26 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt)

Stefan Monnier <address@hidden> writes:

> To follow up on the thread, here is a suggested patch.
> Any objection?

I'd rather put the code in init_environment() in w32.c, and keep all
hacking of environment variables in one place.


> --- startup.el        17 oct 2004 18:58:12 -0400      1.333
> +++ startup.el        22 nov 2004 01:23:05 -0500      
> @@ -340,6 +340,14 @@
>    (if command-line-processed
>        (message "Back to top level.")
>      (setq command-line-processed t)
> +    ;; On W32, try to use $USERPROFILE if $HOME isn't properly set.
> +    (when (and (memq system-type '(windows-nt))
> +            (equal (getenv "HOME") "C:/")
> +            (not (file-exists-p "~/.emacs"))
> +            (not (file-exists-p "~/_emacs"))
> +            (getenv "USERPROFILE")
> +            (file-writable-p (getenv "USERPROFILE")))
> +      (setenv "HOME" (getenv "USERPROFILE")))
>      ;; Give *Messages* the same default-directory as *scratch*,
>      ;; just to keep things predictable.
>      (let ((dir default-directory))




reply via email to

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