all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "John Wiegley" <johnw@newartisans.com>
To: emacs-devel@gnu.org
Subject: Re: Recommend move eshell/su and eshell/sudo to em-tramp.el
Date: Tue, 03 Jul 2012 14:47:00 -0500	[thread overview]
Message-ID: <m2r4ssiq4r.fsf@newartisans.com> (raw)
In-Reply-To: <87pq8dl4dq.fsf@gmx.de> (Michael Albinus's message of "Tue, 03 Jul 2012 08:56:17 +0200")

>>>>> Michael Albinus <michael.albinus@gmx.de> writes:

> looks like it is the same message you have sent some days ago. Are there
> changes I haven't seen? Anyway ...

Ah, I never saw it come across on the emacs-devel Archives, so I believed it
hadn't been sent.

> In a first reaction I've said this doesn't happen if default-directory is
> local. This is wrong, I did oversee that I had defined an alias as metioned
> in (info "(eshell) Built-ins")

> alias sudo '*sudo $*'

> Would such an alias serve you better?

That would serve me personally, but I don't believe it should be the default.
It's not good to have a default behavior if we have to educate others on how
to then disable it.  It surprised me, so I'm sure it will surprise others.

>> - It doesn't show any output until the command is done

> I'm working on this. Hopefully, I could change the behaviour when the
> command is an external command. If the command is mapped to a lisp function
> (like the command "ls" to "eshell/ls"), I have no clue how to achieve
> this. The latter case happens also for Lisp code not using Tramp, but there
> are shorter delays.

Yes, any Lisp function blocks until all output is ready, that's just a
shortcoming of the way Eshell is using Emacs Lisp.

> Would it be sufficient to propagate the above mentioned alias more
> prominently? Or shall we make that alias the default?

This type of behavior, being that it is special, really deserves to be in its
own "opt-in" module.  It's better to educate people how to turn on behavior
that may have surprising consequences, rather than to make it the default and
then educate them how to disable it.

Also, eshell/sudo does not fit with the philosophy of the other functions in
em-unix.el.  Every other function in that file provides a *pure Lisp*
implementation of an equivalent Unix command.  As far as I can see, both *sudo
and eshell/sudo end up calling /usr/bin/sudo.  sehell/sudo is not pure Lisp
(i.e., it involves an external command).  So I'm not sure what benefit
eshell/sudo gains, since ultimately it does the same thing, only slower and
with blocking I/O?

Other than that, you know I'm a huge Tramp fan, and I use Tramp+eshell quite
often.  I'm very interested in seeing this work progress, albeit in its own
module.

Thanks,
  John



  reply	other threads:[~2012-07-03 19:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02 19:25 Recommend move eshell/su and eshell/sudo to em-tramp.el John Wiegley
2012-07-03  6:56 ` Michael Albinus
2012-07-03 19:47   ` John Wiegley [this message]
2012-07-04 14:53     ` Michael Albinus
2012-07-10 12:22   ` Michael Albinus
2012-07-10 16:57     ` John Wiegley
2012-07-10 18:56       ` Michael Albinus
2012-07-11  3:57         ` John Wiegley
  -- strict thread matches above, loose matches on Subject: below --
2012-06-29  3:32 John Wiegley
2012-06-29  9:45 ` Michael Albinus
2012-06-29 21:51 ` Phil Hagelberg

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=m2r4ssiq4r.fsf@newartisans.com \
    --to=johnw@newartisans.com \
    --cc=emacs-devel@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.