all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 5072@emacsbugs.donarmstrong.com,
	Thierry Volpiatto <thierry.volpiatto@gmail.com>
Subject: bug#5072: 23.1.50; Eshell fail with sudo command
Date: Mon, 30 Nov 2009 06:28:53 +0100	[thread overview]
Message-ID: <873a3wvawa.fsf@gmx.de> (raw)
In-Reply-To: <jwv3a3wole7.fsf-monnier+emacsbugreports@gnu.org> (Stefan Monnier's message of "Sun, 29 Nov 2009 20:25:01 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I've added recently an eshell implementation for su and sudo, using
>> Tramp. This requires to run bash, indeed.
>
> What is the advantage?

Imagine, you are on a remote machine, and you want to call a Lisp
function, accessing a file with root permissions. In eshell, you do:

     ~ $ cd /ssh:user@remotehost:/etc
     /ssh:user@remotehost:/etc $ sudo find-file shadow

>> In order to keep your original behaviour, you shall call
>> ,----
>> | *sudo emerge -av somepackage
>> `----
>
> Couldn't your code fail more gracefully and transparently fallback on
> running the bare `sudo'?

That is the eshell built-in approach to suppress command emulation. You
can also apply it to "ls" or "du" or whatever command available in
eshell implementation(1). I wouldn't change it; eshell users know this
approach, likely (2).

Maybe more useful would be to improve Tramp, calling a command via
start-file-process directly (without opening a shell first). This is
already on my todo list, but it isn't simple; it needs basic changes.

At least I will move the eshell related information in etc/NEWS to the
"user visible changes" section.

(1): Check for "eshell/*" Lisp functions.

(2): eshell documentation is very poor. Even this is not documented; I
will improve it next days.

>         Stefan

Best regards, Michael.





      reply	other threads:[~2009-11-30  5:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-29 17:46 bug#5072: 23.1.50; Eshell fail with sudo command Thierry Volpiatto
2009-11-29 20:52 ` Michael Albinus
2009-11-30  1:25   ` Stefan Monnier
2009-11-30  5:28     ` Michael Albinus [this message]

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=873a3wvawa.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=5072@emacsbugs.donarmstrong.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=thierry.volpiatto@gmail.com \
    /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.