From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alfonso Sanchez-Beato via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68074: eshell sudo/doas does not work for aliases Date: Fri, 26 Jan 2024 23:53:00 +0000 (UTC) Message-ID: <713218597.2366797.1706313180478@mail.yahoo.com> References: <31356544.8861481.1703711546895.ref@mail.yahoo.com> <31356544.8861481.1703711546895@mail.yahoo.com> Reply-To: Alfonso Sanchez-Beato Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31413"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "68074@debbugs.gnu.org" <68074@debbugs.gnu.org> To: Stefan Kangas , Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 27 00:54:25 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rTW1f-0007zO-NF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Jan 2024 00:54:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTW1F-0003JU-Gy; Fri, 26 Jan 2024 18:53:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rTW1D-0003J0-Km for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2024 18:53:55 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTW1D-0004wF-7f for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2024 18:53:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rTW1J-00070k-Jq for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2024 18:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alfonso Sanchez-Beato Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Jan 2024 23:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68074 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68074-submit@debbugs.gnu.org id=B68074.170631319826884 (code B ref 68074); Fri, 26 Jan 2024 23:54:01 +0000 Original-Received: (at 68074) by debbugs.gnu.org; 26 Jan 2024 23:53:18 +0000 Original-Received: from localhost ([127.0.0.1]:53045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTW0c-0006zY-4h for submit@debbugs.gnu.org; Fri, 26 Jan 2024 18:53:18 -0500 Original-Received: from sonic312-26.consmr.mail.ir2.yahoo.com ([77.238.178.97]:35125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTW0Z-0006zI-1c for 68074@debbugs.gnu.org; Fri, 26 Jan 2024 18:53:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1706313181; bh=KjToidzPlvPxOaSUsfMs/RDdBv+oq8rri5AENMiy2uo=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=dEMiDxMYwWesK9iyCaaCjGLacBL03iY8VZOHscZELQtSbUk27Zgz5MMfozY/p9OwNj7vG2gu1fEZJrJE6TP4yI+WwgaUH6lY2gTOEjn98KkJLNYn08i8B27DQZ/1QxGIRo1ufHFHsG2QTObOyESCEioJbnm3UaOn3ATvdmtJGpn1FBfusvkqWwjdQTp2RKQojEquMco2TZMcKFrX0H5h9wOqDHz7mN/E2V6rcr1n8HKNRQm/ys0tmdYiJ36uNApjfzmddGowpNtJaaPBSweyDhiKSzY5cHLd+70A3sZE6jLAIT3FhSaMzbUZYVbIfwJER0r6vZWgUqObYH5hGayDdw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1706313181; bh=prhhG2qDhzLtgYgPx1UTg6yUqE/Wd4S8qy9TuTIvqLR=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=WILURVNvBiSniu85e8/KuG1yF5Q3WENz5D75YTlN/LmEyUbC991TZLgvlLMqy+HHEfmqESGBjOc5jyXP9A5bt49aFGIXdcIEJB6cb5SdQz908DZ3S9ERG2mdHJ5T9RYjo91K7LCOu4DX7wV5C0gifgfWS1jQaDP6rbWdOttpBheSqbH0lwfFncbZ4GvPfy1+mV1L45fEjEbDfy/9z2BZ6OymVY+gWmia5CmIkavhHYD0/6Iv4i4qr0wq3CELN7pnR03hGwLEDfA4aZMIVR/S1F3Sgo2yFR6PzzjWUJIIJaRqhhf/zYkrGHzXrgB/KRq3EtKLcM6y/31WNMToT3RafA== X-YMail-OSG: fvUkEKIVM1k1.GUireyWfuyUTb5SExEuLK0wfRItPfn2AQhV9U0mBaeU3aw9rKm GJuNOTfYzQC6RQRnhT7nCafPlaZlOxQQVRm9yB1heKN_VifdglRhacS2I2v9XqiZvkwSmlH.DNwc roJlvfRDhEHUJt4JjkafZv.mlgPGrkAr3j.lTl9cZon8jiuFcdScxY30OFHSrKzMeEm0dW3XXriQ aqeWlDsToZySta6cbbkeJoB5th97CsdWBkjaLeJdZFejD2xg2V6dnU0GzQaAiVPF.HvFrJlHvj_N 3JrTdbQY0TbAxrHcMZIkF26bZNBc4joCf0x.t8j0fORH1.tjs5uJfAj1hedMnAAcpir8Q.LA._Cp WDmuBiSDGjXQwhr6LIIz1yZKL_xcmtQNAeJTLdeNCOpJ6RZGT6TSth8gjrwqOZ_yCwmRTQ1fORuE JTv3gXDSTT9s7igExAYAqwF4Scyv5Zkqim_3TGS4y04xvVxG8Vm2X7slWk6Yl6rAkRIi8cfp1M2c ArOyB7fLELt0IZ8903QiniS1L.4IybidLflg4IXJQ.26eRMk7b02BZDRN.INvYSH061B99J63qNC F7XVhip9iGHB0KuQlqkQiDCkv_GqbkKpJTXbNH3aqhOubEc.WX36qf34UbRpko4F.vYw9vCRMQNu FAxut96OYv.OQyjvgkgYWsHK.xXijzlVSot5ce1MQ8bl9oPTH_LyigTinGHJIjyyXENal3UrgbCK IfEbrtb2..NsU3G4CSbYlTwen3SYnQyqpFq1LUVzw0jOg_4HsVchPvT9R_bF8QPC_2L4XRcdP1Wp gnF2w.ph2twp0TlaG4_VD_M3u2z3CI9srBgOf0VyoD X-Sonic-MF: X-Sonic-ID: 910a98de-5263-4ce1-b8ea-7319a314d84f Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ir2.yahoo.com with HTTP; Fri, 26 Jan 2024 23:53:01 +0000 In-Reply-To: X-Mailer: WebService/1.1.22046 YMailNorrin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278952 Archived-At: En jueves, 25 de enero de 2024, 02:43:46 GMT, Jim Porter escribi=C3=B3:=20 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=20 >> gut feeling though is that we shouldn't have a special case in this code= =20 >> for when the alias starts with "cd". I'll have to do some testing with= =20 >> aliases and sudo in order to have a more-helpful answer though. >>=20 >> At a guess, I think a better place to add code for this is likely in=20 >> em-tramp.el. > After letting this percolate in my brain for a few weeks, the answer=20 > revealed itself to me: the functions in "em-tramp.el" shouldn't throw=20 > 'eshell-external', they should throw 'eshell-replace-command'. That=20 > allows for a two-step command replacement in this case. First,=20 > 'eshell/sudo' (or 'eshell/doas') will do its replacement. Then, Eshell=20 > will evaluate that and call the inner command, which will do another=20 > replacement to expand the alias. > Alfonso, does the attached patch work for you? If so, I'll merge it to=20 > master. Unfortunately that does not seem to be the case, I see an error saying "Inv= alid 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] $