From: Alfonso Sanchez-Beato via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Kangas <stefankangas@gmail.com>,
Jim Porter <jporterbugs@gmail.com>
Cc: "68074@debbugs.gnu.org" <68074@debbugs.gnu.org>
Subject: bug#68074: eshell sudo/doas does not work for aliases
Date: Fri, 26 Jan 2024 23:53:00 +0000 (UTC) [thread overview]
Message-ID: <713218597.2366797.1706313180478@mail.yahoo.com> (raw)
In-Reply-To: <b6c9c31b-e26a-3116-3a67-c72b74042e8c@gmail.com>
En jueves, 25 de enero de 2024, 02:43:46 GMT, Jim Porter <jporterbugs@gmail.com> escribió:
On 1/11/2024 1:15 PM, Jim Porter wrote:
>> I've been meaning to look at this in detail, but haven't had time. My
>> gut feeling though is that we shouldn't have a special case in this code
>> for when the alias starts with "cd". I'll have to do some testing with
>> aliases and sudo in order to have a more-helpful answer though.
>>
>> At a guess, I think a better place to add code for this is likely in
>> em-tramp.el.
> After letting this percolate in my brain for a few weeks, the answer
> revealed itself to me: the functions in "em-tramp.el" shouldn't throw
> 'eshell-external', they should throw 'eshell-replace-command'. That
> allows for a two-step command replacement in this case. First,
> 'eshell/sudo' (or 'eshell/doas') will do its replacement. Then, Eshell
> will evaluate that and call the inner command, which will do another
> replacement to expand the alias.
> Alfonso, does the attached patch work for you? If so, I'll merge it to
> master.
Unfortunately that does not seem to be the case, I see an error saying "Invalid function" after applying on top of current master:
$ which cp
cp is an alias, defined as "*cp $*"
$ touch foo
$ eshell/sudo cp foo /
Invalid function: "foo"
[1] $
next prev parent reply other threads:[~2024-01-26 23:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <31356544.8861481.1703711546895.ref@mail.yahoo.com>
2023-12-27 21:12 ` bug#68074: eshell sudo/doas does not work for aliases Alfonso Sanchez-Beato via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11 21:00 ` Stefan Kangas
2024-01-11 21:15 ` Jim Porter
2024-01-25 2:43 ` Jim Porter
2024-01-26 23:53 ` Alfonso Sanchez-Beato via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-01-27 0:27 ` Jim Porter
2024-01-27 1:19 ` Jim Porter
2024-01-27 8:46 ` Alfonso Sanchez-Beato via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-27 20:24 ` Jim Porter
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=713218597.2366797.1706313180478@mail.yahoo.com \
--to=bug-gnu-emacs@gnu.org \
--cc=68074@debbugs.gnu.org \
--cc=alfonsosanchezbeato@yahoo.es \
--cc=jporterbugs@gmail.com \
--cc=stefankangas@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.