From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: $USERPROFILE for $HOME on W32 Date: Mon, 22 Nov 2004 01:26:51 -0500 Message-ID: <87vfbycsgj.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1101104866 14555 80.91.229.6 (22 Nov 2004 06:27:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Nov 2004 06:27:46 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 22 07:27:32 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CW7fg-00053u-00 for ; Mon, 22 Nov 2004 07:27:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CW7oi-0005po-77 for ged-emacs-devel@m.gmane.org; Mon, 22 Nov 2004 01:36:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CW7oY-0005pa-GX for emacs-devel@gnu.org; Mon, 22 Nov 2004 01:36:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CW7oX-0005p9-I2 for emacs-devel@gnu.org; Mon, 22 Nov 2004 01:36:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CW7oX-0005ot-CP for emacs-devel@gnu.org; Mon, 22 Nov 2004 01:36:41 -0500 Original-Received: from [209.226.175.188] (helo=tomts25-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CW7f1-0006FV-SB for emacs-devel@gnu.org; Mon, 22 Nov 2004 01:26:52 -0500 Original-Received: from alfajor ([67.71.119.192]) by tomts25-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20041122062650.NQID25979.tomts25-srv.bellnexxia.net@alfajor>; Mon, 22 Nov 2004 01:26:50 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 23E0AD73CB; Mon, 22 Nov 2004 01:26:51 -0500 (EST) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:30231 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30231 To follow up on the thread, here is a suggested patch. Any objection? If anybody wants to install it (with or without adjustments), please feel free to do it: I'd rather not spend any more time on this. Stefan --- 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))