From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Adding with-editor to Emacs? Date: Mon, 04 Sep 2023 14:44:01 +0200 Message-ID: <87r0nertv2.fsf@ledu-giraud.fr> References: <85msy98sni.fsf@elpa.gnu.org> <87r0nidkmt.fsf@bernoul.li> <83bkelc1p1.fsf@gnu.org> <87fs3xwzxm.fsf@bernoul.li> <837cp9bur7.fsf@gnu.org> <87zg23tjby.fsf@ledu-giraud.fr> <83ledn6zj4.fsf@gnu.org> <87v8crt7d4.fsf@ledu-giraud.fr> <83v8cr5a81.fsf@gnu.org> <87msy2tklg.fsf@ledu-giraud.fr> <83cyyy5dyg.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39812"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: jonas@bernoul.li, stefankangas@gmail.com, emacs-devel@gnu.org, rms@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 04 14:46:57 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qd8yn-000A6V-Ee for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Sep 2023 14:46:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qd8wn-00030T-HO; Mon, 04 Sep 2023 08:44:53 -0400 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 1qd8wB-0002CN-2w for emacs-devel@gnu.org; Mon, 04 Sep 2023 08:44:16 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qd8w2-0004gD-AL; Mon, 04 Sep 2023 08:44:14 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=rszKmTie Ga1UlsTAeOWqEjaYgUN0vgi7YSpKT1iQ+50=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=RTasms7HrwWIShpVjf1jH1npW1FxrV tsttTHYNTYBZzILCCZVHgRuB/YCqj/dc05e8kvSgRUWSlRE4qgTGYSBA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=rszKmTieGa1UlsTA eOWqEjaYgUN0vgi7YSpKT1iQ+50=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=DKz7sz7awxRKFK4VM8mYkJulF2L/KvmMcowER/ HOHikHgBRyU5ZGnRxGehkb167fEHu9cFQMRdhz8CLq/hqpvHMohUAoNyKeKiTGqGga0kp4 KKe2n7Th8rGA6eZX+sO6NTYTT3+vv+bTaO2rS5fIcEHH4nFwq/xzCf3kan3JIdh5eQluwL R1PRShu4lx7kyXqVuoHp+wrw/rEDdEB3vPabHjNDiR4ke/laBeQ6D0SDes1fo/b22+aJsZ wjGbup4iCoAygaOvIH7SpQlGh3lIZzKyTUKZubyS5BehzNOr4+zjH3l40lCCk36ABqptMS 6o3gV5ddNjEJEoYFVp9uMeiA== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id c5993ebb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 4 Sep 2023 14:44:02 +0200 (CEST) In-Reply-To: <83cyyy5dyg.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 04 Sep 2023 15:18:31 +0300") Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310077 Archived-At: Eli Zaretskii writes: >> From: Manuel Giraud >> Cc: jonas@bernoul.li, stefankangas@gmail.com, emacs-devel@gnu.org, >> rms@gnu.org >> Date: Mon, 04 Sep 2023 10:21:15 +0200 >> >> Eli Zaretskii writes: >> >> [...] >> >> >> Not really I guess. I don't know how to set EDITOR correctly to do the >> >> following: >> >> >> >> - M-x shell >> >> - ssh remote-server >> >> - su -l >> >> - vipw --> open a new buffer in *this* Emacs >> >> >> >> But, I could do this with with-editor and eshell (maybe it could work >> >> for M-x shell also, I don't know) as follow: >> >> >> >> - C-x C-f /ssh:remote-server|su:: >> >> - M-x eshell >> >> - vipw --> and here it works, opening an Emacs buffer through >> >> emacsclient so I could edit and C-c C-c when done >> > >> > You've lost me here. You assume I know what with-editor does? >> >> Ok, I might be lost also (as I said I'm not an expert of everything >> with-editor does). I'll try to rephrase. with-editor is able to >> correctly set EDITOR to have any shell command that need editing appear >> into an Emacs buffer locally. Such command might be over a ssh session >> or into a sudo for instance. > > And it provides a separate value for EDITOR to each one of these > cases? This I'm not sure. I have tested on two different machines and on a local "doas" and echo $EDITOR always returns this: sh -c 'printf "\nWITH-EDITOR: $$ OPEN $0\037$1\037 IN $(pwd)\n"; sleep 604800 & sleep=$!; trap "kill $sleep; exit 0" USR1; trap "kill $sleep; exit 1" USR2; wait $sleep' So it seems there is some shell hackery going on. -- Manuel Giraud