From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: [Fwd: Location of .emacs file under `su` and `su -`?] Date: Tue, 22 Aug 2006 11:18:00 -0400 Message-ID: <874pw4u7dj.fsf@furball.mit.edu> References: <44EAF4A8.9030708@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1156260615 10801 80.91.229.2 (22 Aug 2006 15:30:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Aug 2006 15:30:15 +0000 (UTC) Cc: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 22 17:30:11 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GFYCA-0004Lx-1O for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2006 17:29:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GFYC9-0006PV-EP for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2006 11:29:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GFYBw-0006P8-Gl for emacs-devel@gnu.org; Tue, 22 Aug 2006 11:29:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GFYBv-0006P0-8F for emacs-devel@gnu.org; Tue, 22 Aug 2006 11:29:23 -0400 Original-Received: from [18.72.1.2] (helo=south-station-annex.mit.edu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GFYJY-0004R0-KV for emacs-devel@gnu.org; Tue, 22 Aug 2006 11:37:16 -0400 Original-Received: from central-city-carrier-station.mit.edu (CENTRAL-CITY-CARRIER-STATION.MIT.EDU [18.7.7.72]) by south-station-annex.mit.edu (8.13.6/8.9.2) with ESMTP id k7MFTHvJ025349; Tue, 22 Aug 2006 11:29:22 -0400 (EDT) Original-Received: from outgoing-legacy.mit.edu (OUTGOING-LEGACY.MIT.EDU [18.7.22.104]) by central-city-carrier-station.mit.edu (8.13.6/8.9.2) with ESMTP id k7MFIBMZ015484; Tue, 22 Aug 2006 11:18:11 -0400 (EDT) Original-Received: from furball.mit.edu (SYDNEYPACIFIC-THREE-NINETY-NINE.MIT.EDU [18.95.6.144]) ) by outgoing-legacy.mit.edu (8.13.6/8.12.4) with ESMTP id k7MFHwaW014472; Tue, 22 Aug 2006 11:18:03 -0400 (EDT) Original-Received: from cyd by furball.mit.edu with local (Exim 3.36 #1 (Debian)) id 1GFY0u-0000m2-00; Tue, 22 Aug 2006 11:18:00 -0400 Original-To: Lennart Borgman In-Reply-To: <44EAF4A8.9030708@student.lu.se> (Lennart Borgman's message of "Tue, 22 Aug 2006 14:12:24 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-Spam-Score: 1.217 X-Scanned-By: MIMEDefang 2.42 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: news.gmane.org gmane.emacs.devel:58719 Archived-At: Lennart Borgman writes: > Subject: Location of .emacs file under `su` and `su -`? > From: Adam Funk > > When I use `su` and run emacs, I get errors because it loads > ~adam/.emacs as the init file, which contains > > (add-to-list 'load-path "~/.local/site-lisp/") > > but then doesn't find the *.el and *.elc files there > > When emacs starts up, does it actually look up "~${LOGNAME}/.emacs" > instead of (what I would expect) "${HOME}/.emacs"? Yes. I'm not sure why. This contradicts the information in the Emacs manual, which says to use HOME. Anyway, this is trivial to fix. I'll check the following patch in over the next few days if no one objects. *** emacs/lisp/startup.el.~1.410.~ 2006-07-24 00:18:47.000000000 -0400 --- emacs/lisp/startup.el 2006-08-22 11:14:56.000000000 -0400 *************** *** 865,871 **** ((eq system-type 'vax-vms) "sys$login:.emacs") (t ! (concat "~" init-file-user "/.emacs"))))) ;; This tells `load' to store the file name found ;; into user-init-file. (setq user-init-file t) --- 865,871 ---- ((eq system-type 'vax-vms) "sys$login:.emacs") (t ! "~/.emacs")))) ;; This tells `load' to store the file name found ;; into user-init-file. (setq user-init-file t) *************** *** 877,884 **** (let ((otherfile (expand-file-name "init" ! (file-name-as-directory ! (concat "~" init-file-user "/.emacs.d"))))) (load otherfile t t) ;; If we did not find the user's init file, --- 877,883 ---- (let ((otherfile (expand-file-name "init" ! (file-name-as-directory "~/.emacs.d")))) (load otherfile t t) ;; If we did not find the user's init file,