unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: SU commands from Emacs
Date: Fri, 24 Aug 2007 17:59:18 +1000	[thread overview]
Message-ID: <87y7g1s6qx.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: mailman.5238.1187937431.32220.help-gnu-emacs@gnu.org

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

> jadamson@partners.org (Joel J. Adamson) writes:
>
>> Sometimes I want to do a command that requires root privileges.
>
> Yes, lately I stumbled over a find-grep in /etc.  How could this be
> done with root privileges?
>

I use either sudo or su within a shell or term buffer to run commands as
root. 

I can't think of any straight-forward way to run elisp/emacs commands with
the privileges of another user - there just isn't a mechanism to do
this. The closest I could think of would be using some sort of
emacsclient/emacserver setup, but this would require having another emacs
running as root, which doesn't seem practicle to me. 

I have seen something in the most recent emacs docs that indicate tramp may
be able to execute processes on remote servers. If this is the case, it
should be possible, in conjunction with sudo/su as a connection method to
execute commands as root via tramp.

If you positively, must, have to run emacs commands as another user, I
guess you could call emacs in 'batch' mode, with a function call on the
command line - it may be possible to have the output sent back into a
buffer in the local emacs (i.e. like output from a shell command), but this
is going to be very slow and use a lot of resources (memory/cpu etc)

If the reason you want to use emacs to do processing as another user is
because you like to write stuff in lisp, then maybe something like lush
(Lisp User Shell), rep (lisp/scheme interpreter) scsh (scheme shell) or
even one of the mainstream CL implementations, like clisp, cmucl or sbcl
will give you what you want.

HTH

Tim

  parent reply	other threads:[~2007-08-24  7:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-17 17:38 SU commands from Emacs Joel J. Adamson
2007-08-17 18:23 ` Emilio Lopes
2007-08-17 19:38   ` Joel J. Adamson
2007-08-18  9:55     ` Emilio Lopes
2007-08-17 19:04 ` David Hansen
2007-08-17 19:27 ` Peter Dyballa
     [not found] ` <mailman.4925.1187378874.32220.help-gnu-emacs@gnu.org>
2007-08-17 20:23   ` Joel J. Adamson
2007-08-17 20:37     ` Sven Joachim
     [not found] ` <mailman.4924.1187377704.32220.help-gnu-emacs@gnu.org>
2007-08-17 20:28   ` Joel J. Adamson
2007-08-24  6:38     ` Dieter Wilhelm
2007-08-24  9:37       ` Michael Albinus
2007-08-24 20:32         ` Dieter Wilhelm
2007-08-24 22:16           ` Peter Dyballa
2007-08-25  2:45             ` Dieter Wilhelm
2007-08-25 19:35             ` Joel J. Adamson
2007-08-26  8:49               ` Michael Albinus
2007-08-27 13:28                 ` Joel J. Adamson
     [not found]         ` <mailman.5288.1187987493.32220.help-gnu-emacs@gnu.org>
2007-08-24 21:55           ` David Kastrup
2007-08-25  3:00             ` Dieter Wilhelm
2007-08-26 10:55               ` Michael Albinus
2007-08-24  9:51       ` Peter Dyballa
     [not found]     ` <mailman.5238.1187937431.32220.help-gnu-emacs@gnu.org>
2007-08-24  7:59       ` Tim X [this message]
2007-08-24 20:20         ` Dieter Wilhelm
     [not found]         ` <mailman.5305.1188026786.32220.help-gnu-emacs@gnu.org>
2007-08-25  9:28           ` Tim X
2007-08-25 13:57             ` Dieter Wilhelm

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87y7g1s6qx.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    --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.
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).