emacs-devel
[Top][All Lists]
Advanced

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

Re: [Fwd: Location of .emacs file under `su` and `su -`?]


From: Chong Yidong
Subject: Re: [Fwd: Location of .emacs file under `su` and `su -`?]
Date: Tue, 22 Aug 2006 11:18:00 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Lennart Borgman <address@hidden> writes:

> Subject:     Location of .emacs file under `su` and `su -`?
> From:     Adam Funk <address@hidden>
>
> 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,




reply via email to

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