unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Location of .emacs file under `su` and `su -`?
@ 2006-08-22 11:26 Adam Funk
  2006-08-22 16:08 ` Peter Dyballa
       [not found] ` <mailman.5450.1156262916.9609.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Adam Funk @ 2006-08-22 11:26 UTC (permalink / raw)


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, because (as far
as I can tell) it's looking in /root/.local/site-lisp/, which doesn't
exist.  Does that seem to be a correct interpretation?

When I use `su -` and run emacs, it loads ~root/.emacs as the init
file.

In both cases, `env` tells me
 
  EDITOR=/usr/bin/emacs
  HOME=/root
  USERNAME=root
  USER=root

so I think the difference is here:

  su      -->  LOGNAME=adam
  su -    -->  LOGNAME=root

When emacs starts up, does it actually look up "~${LOGNAME}/.emacs"
instead of (what I would expect) "${HOME}/.emacs"?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Location of .emacs file under `su` and `su -`?
  2006-08-22 11:26 Location of .emacs file under `su` and `su -`? Adam Funk
@ 2006-08-22 16:08 ` Peter Dyballa
       [not found] ` <mailman.5450.1156262916.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Dyballa @ 2006-08-22 16:08 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 22.08.2006 um 13:26 schrieb Adam Funk:

> When emacs starts up, does it actually look up "~${LOGNAME}/.emacs"
> instead of (what I would expect) "${HOME}/.emacs"?

You might be able to avoid asking this question by invoking GNU Emacs  
with the option --user or -u and then passing that user's login name.  
Could be $USER is sufficient ...

--
Greetings

   Pete

“Computers are good at following instructions, but not at reading  
your mind.”
    - D. E. Knuth, The TeXbook, Addison-Wesley 1984, 1986, 1996, p. 9

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Location of .emacs file under `su` and `su -`?
       [not found] ` <mailman.5450.1156262916.9609.help-gnu-emacs@gnu.org>
@ 2006-08-23 10:15   ` Adam Funk
  0 siblings, 0 replies; 3+ messages in thread
From: Adam Funk @ 2006-08-23 10:15 UTC (permalink / raw)


On 2006-08-22, Peter Dyballa <Peter_Dyballa@web.DE> wrote:
>
> Am 22.08.2006 um 13:26 schrieb Adam Funk:
>
>> When emacs starts up, does it actually look up "~${LOGNAME}/.emacs"
>> instead of (what I would expect) "${HOME}/.emacs"?
>
> You might be able to avoid asking this question by invoking GNU Emacs  
> with the option --user or -u and then passing that user's login name.  
> Could be $USER is sufficient ...

I've changed the line in /root/.bashrc from

  export EDITOR='/usr/bin/emacs -nw'

to

  export EDITOR='/usr/bin/emacs -nw -u root'

and that's fixed it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-23 10:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-22 11:26 Location of .emacs file under `su` and `su -`? Adam Funk
2006-08-22 16:08 ` Peter Dyballa
     [not found] ` <mailman.5450.1156262916.9609.help-gnu-emacs@gnu.org>
2006-08-23 10:15   ` Adam Funk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).