unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* sudo emacs
@ 2013-02-06 10:06 drain
  2013-02-06 14:59 ` Doug Lewan
  0 siblings, 1 reply; 3+ messages in thread
From: drain @ 2013-02-06 10:06 UTC (permalink / raw)
  To: Help-gnu-emacs

This somewhat downgrades root privileges, but I cannot encrypt mail without
it. Hitherto I almost never ran Emacs with sudo.

The problem is, I cannot access any files without sudo. Now all of my inits
require it.

I was thinking of creating alternates. Is it possible for .emacs to be
instructed to ignore certain files and load others depending on privilege?

I *believe* I've seen people write code that enables Emacs to distinguish
between the OS it is running on and run the inits accordingly, etc.



--
View this message in context: http://emacs.1067599.n5.nabble.com/sudo-emacs-tp277339.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



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

* RE: sudo emacs
  2013-02-06 10:06 drain
@ 2013-02-06 14:59 ` Doug Lewan
  0 siblings, 0 replies; 3+ messages in thread
From: Doug Lewan @ 2013-02-06 14:59 UTC (permalink / raw)
  To: drain, Help-gnu-emacs@gnu.org

I'm not a sudo-er at work, but I bet all the files you create (and probably get auto-saved) are owned by root (or whatever user you sudo to).

Maybe sudo-ext.el (http://www.emacswiki.org/emacs/sudo-ext.el) can help do the right thing. (No, I haven't used it; I just went looking.)

,Douglas
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224

When I do good, I feel good. When I do bad, I feel bad and that's my religion. - Abraham Lincoln


> -----Original Message-----
> From: help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org
> [mailto:help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org] On
> Behalf Of drain
> Sent: Wednesday, 2013 February 06 05:06
> To: Help-gnu-emacs@gnu.org
> Subject: sudo emacs
> 
> This somewhat downgrades root privileges, but I cannot encrypt mail
> without
> it. Hitherto I almost never ran Emacs with sudo.
> 
> The problem is, I cannot access any files without sudo. Now all of my
> inits
> require it.
> 
> I was thinking of creating alternates. Is it possible for .emacs to be
> instructed to ignore certain files and load others depending on
> privilege?
> 
> I *believe* I've seen people write code that enables Emacs to
> distinguish
> between the OS it is running on and run the inits accordingly, etc.
> 
> 
> 
> --
> View this message in context: http://emacs.1067599.n5.nabble.com/sudo-
> emacs-tp277339.html
> Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: sudo emacs
       [not found] <mailman.19118.1360145191.855.help-gnu-emacs@gnu.org>
@ 2013-02-06 16:32 ` jpkotta
  0 siblings, 0 replies; 3+ messages in thread
From: jpkotta @ 2013-02-06 16:32 UTC (permalink / raw)
  To: gnu.emacs.help; +Cc: Help-gnu-emacs

On Wednesday, February 6, 2013 4:06:18 AM UTC-6, drain wrote:
> This somewhat downgrades root privileges, but I cannot encrypt mail without
> 
> it. Hitherto I almost never ran Emacs with sudo.
> 
> 
> 
> The problem is, I cannot access any files without sudo. Now all of my inits
> 
> require it.
> 
> 
> 
> I was thinking of creating alternates. Is it possible for .emacs to be
> 
> instructed to ignore certain files and load others depending on privilege?
> 
> 
> 
> I *believe* I've seen people write code that enables Emacs to distinguish
> 
> between the OS it is running on and run the inits accordingly, etc.
> 
> 
> 
> 
> 
> 
> 
> --
> 
> View this message in context: http://emacs.1067599.n5.nabble.com/sudo-emacs-tp277339.html
> 
> Sent from the Emacs - Help mailing list archive at Nabble.com.

You can use tramp to edit files as root (instead of finding "/home/user/file", find "/sudo:root@hostname:/home/user/file").  Maybe there's a way to automatically prepend the tramp sudo stuff for certain files.  Take a look at http://www.emacswiki.org/emacs/OpenWith for one possible method.

You can certainly split your init file, but that seems like it's solving the wrong problem.



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

end of thread, other threads:[~2013-02-06 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.19118.1360145191.855.help-gnu-emacs@gnu.org>
2013-02-06 16:32 ` sudo emacs jpkotta
2013-02-06 10:06 drain
2013-02-06 14:59 ` Doug Lewan

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).