emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recommend move eshell/su and eshell/sudo to em-tramp.el


From: John Wiegley
Subject: Re: Recommend move eshell/su and eshell/sudo to em-tramp.el
Date: Tue, 03 Jul 2012 14:47:00 -0500
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1 (darwin)

>>>>> Michael Albinus <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]