From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johnny Newsgroups: gmane.emacs.help Subject: Re: Customising .init.el for root user Date: Sat, 22 Jun 2013 15:03:59 +0100 Message-ID: <87obayxmwg.fsf@gmx.co.uk> References: <871u7woijw.fsf@gmx.co.uk> <8761x7qm5r.fsf@newsguy.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371909867 8955 80.91.229.3 (22 Jun 2013 14:04:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Jun 2013 14:04:27 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Harry Putnam Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 22 16:04:27 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UqOQU-0000fM-9H for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Jun 2013 16:04:26 +0200 Original-Received: from localhost ([::1]:57581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqOQT-0005GH-O3 for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Jun 2013 10:04:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqOQE-0005ET-DN for help-gnu-emacs@gnu.org; Sat, 22 Jun 2013 10:04:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UqOQ7-0001wI-B6 for help-gnu-emacs@gnu.org; Sat, 22 Jun 2013 10:04:10 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:64058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqOQ7-0001vp-1W for help-gnu-emacs@gnu.org; Sat, 22 Jun 2013 10:04:03 -0400 Original-Received: from deusexmachina ([81.141.146.13]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0Lgql4-1UTgOM1Fpe-00oCya; Sat, 22 Jun 2013 16:04:01 +0200 In-Reply-To: <8761x7qm5r.fsf@newsguy.com> (Harry Putnam's message of "Fri, 21 Jun 2013 15:49:36 -0400") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1 (gnu/linux) X-Provags-ID: V03:K0:UZ0VorTO8srSbJna2fOm8Iz3hCLbZQDATN4m1T3eXLjh6/QGPMh bAoqHl4sPTtTdESrw/XHKXs1BOKyFBQTE9/h3XogsME1DT8iyy2kZCY0KP4i7u90XHjzoAR q6dyrsvsVVv9YXc9ktN8m0SsS9Y2T8DvIw1wPvUiPZFLpFf6j16tUbzmKxIp66GCHV0jnJ4 is0pySnbh5L5fefwS++iQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.19 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91667 Archived-At: Harry Putnam writes: > Johnny writes: > >> I want emacs to start with some specific parameters >> >> 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. > > The old hands here will probably have much better ways, but I've found > its just easier to put the code for the desired changes in a small > *.el file in your path like for-root.el containing code to effect the > changes you want for the root session. > > You do have to remember to load it manually unless you want the > slicker ways. But I've found over time its just easier to keep up > with the way I described above. > > Then when you start emacs as root just load that file with > M-x load-library for-root > > Or perhaps create an aliase for emacs that loads the file like: > alias emrt="emacs -l /path/to/for-root.el" > > And start emacs with `emrt' when running as root. > Thanks Harry, this is indeed an option for some specific (most?) use cases. I find myself switching to root quite frequently, and multiple init files would require me to update them all with the tweaks I want. Which I am too lazy (or forgetful) to do... -- Johnny