all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Johnny <yggdrasil@gmx.co.uk>
To: help-gnu-emacs@gnu.org
Subject: Customising .init.el for root user
Date: Thu, 20 Jun 2013 17:25:55 +0100	[thread overview]
Message-ID: <871u7woijw.fsf@gmx.co.uk> (raw)

Hi,

Starting emacs as my normal user running a root terminal (via su), I want
emacs to start with some specific parameters that does not apply when
running as the normal user. Specifically, I want the color to be
distinct so that it is obvious which emacs is the root session. 

I understand that by default the users init file is used [1]. This
never worked well for me, defaulting into basic settings, but after
looking into it and replacing any "~" references with full paths, it
works as intended.
However, this gives /all/ the defaults in the user init file, such as
the color-theme used. I already use the same init file for multiple
(well, two anyhow) computers and use a check which machine I am on for
some dedicated settings, e.g.
,----
| (when (string= (system-name) "the other machine")
|       ..run some customisations...
|       )
`----
Is there any similar way to check whether the session was started with
root privileges to set customisations? E.g. 
,---- 
| (when (session-started-as-root)
|         (load-theme 'wheatgrass)
|         )
`----
with a 'session-started-as-root' function? Better methods??

I found one way is to default to a root init file by defining an alias
in the root .bashrc as
,----
| alias emacs="emacs -u root"
`----
however it would be nice to have only one init file to keep track of as
many tweaks are nice to have in all sessions.

Any ideas / good practices?

All the best 

Johnny


Footnotes: 
[1]  (info "(emacs)Find Init")

-- 
Johnny



             reply	other threads:[~2013-06-20 16:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 16:25 Johnny [this message]
2013-06-21 13:13 ` Customising .init.el for root user J. David Boyd
2013-06-21 13:18   ` Christopher Schmidt
2013-06-21 14:55     ` J. David Boyd
2013-06-21 15:46       ` Stefan Monnier
2013-06-21 16:00         ` J. David Boyd
     [not found]         ` <mailman.2149.1371830721.22516.help-gnu-emacs@gnu.org>
2013-06-21 16:55           ` Barry Margolin
2013-06-21 17:15             ` J. David Boyd
2013-06-22 13:52     ` Johnny
2013-06-21 19:49 ` Harry Putnam
2013-06-22 14:03   ` Johnny
2013-06-22 21:26     ` Harry Putnam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871u7woijw.fsf@gmx.co.uk \
    --to=yggdrasil@gmx.co.uk \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.