[Top][All Lists]

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

Re: [h-e-w] Re: Emacs-21.3-5 msi installer

From: Robinows
Subject: Re: [h-e-w] Re: Emacs-21.3-5 msi installer
Date: Wed, 4 May 2005 22:43:36 EDT

From help-emacs-windows (a discussion about a Windows installer):
In a message dated 5/4/2005 6:57:24 P.M. Eastern Daylight Time, address@hidden writes:
Brian Elmegaard wrote:
>> Works like a charm, Rex.
>> I have the following suggestions to be put in default.el:
>> (setenv "HOME" (getenv "USERPROFILE"))  ; users will not have the root
>>                                         ; of C: as home

>What if HOME is already set?
>Wouldn't it be better to set HOME to %HOMEDRIVE%%HOMEPATH% (if >they're defined)?
Of course, overwriting an existing HOME variable is a bad idea, but Brian has a point. Naive Windows users are not likely to have a HOME variable and in a corporate environment may not have write access to C:\.  It seems to me the place to fix this is in Emacs, not in a third-party tool. Something like the patch below.
This looks first for the HOME variable, then USERPROFILE (likely to be C:\Documents and Settings\%USERNAME% ), and then, as a last resort, C:/.
One could get fancier by playing with the default value of "emacs_dir" or using %HOMEDRIVE% instead of C:

--- w32.c.~1.90.~ 2005-02-16 21:28:51.296875000 -0500
+++ w32.c 2005-05-04 20:21:49.593750000 -0400
@@ -949,7 +949,8 @@
       char * def_value;
     } env_vars[] =
-      {"HOME", "C:/"},
+      {"USERPROFILE", "C:/"},
+      {"HOME", "%USERPROFILE%"},
       {"emacs_dir", "C:/emacs"},
       {"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp;%emacs_dir%/lisp;%emacs_dir%/leim"},

reply via email to

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