From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Adding with-editor to Emacs? Date: Tue, 17 Oct 2023 12:23:45 +0200 Message-ID: <87r0ltzgwe.fsf@gmx.de> References: <85msy98sni.fsf@elpa.gnu.org> <87r0nidkmt.fsf@bernoul.li> <83bkelc1p1.fsf@gnu.org> <87fs3xwzxm.fsf@bernoul.li> <837cp9bur7.fsf@gnu.org> <87a5u5wskw.fsf@bernoul.li> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40087"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , stefankangas@gmail.com, emacs-devel@gnu.org, rms@gnu.org To: Jonas Bernoulli Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 17 12:24:48 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 1qshFn-000A4O-8z for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Oct 2023 12:24:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qshEv-0001VN-Uw; Tue, 17 Oct 2023 06:23: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 1qshEu-0001Tc-8h for emacs-devel@gnu.org; Tue, 17 Oct 2023 06:23:52 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qshEs-0002aD-AY; Tue, 17 Oct 2023 06:23:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1697538226; x=1698143026; i=michael.albinus@gmx.de; bh=yXEs7ZWnUjZcuqenpAEIrTa7Byg5qcdgXr/nmMJAg0M=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=DSnba7ClwGOrtiFFo82jIDgxpfWn4nQbh8P9SilKMe4xAN+bfHGBeAT6j8Su+M13Hdroi9fQmmB r4NzvjONCkAb7ShADxKC436rk1ju5TVwTU02S2wGAw9UslLwyvZnHLA5Ih1iY/eRPV+3RwvkZTl6X CSnb9hO8cglDQxVSi20rbAnScbGdcuo6gRfhC1VdMJD4C3asSuu+H9MU1it9p64AUmQ7wgVXZeBIc dtDMAD3rAeI+OGmAJVwzRyl3qEjQG2Wg75vsb9acKlk7tQhBXhFhXp5gJKbKpKjgwZiLU/SIRw2/J K9m+PuWwE3FYIeUw7aJT/8INRNq0uYfag6Xw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MvK4Z-1rjpzP13qb-00rJJP; Tue, 17 Oct 2023 12:23:46 +0200 In-Reply-To: <87a5u5wskw.fsf@bernoul.li> (Jonas Bernoulli's message of "Fri, 01 Sep 2023 22:23:43 +0200") X-Provags-ID: V03:K1:8/1/ZyJ8103HuU86VbQRrO1FoJkvpLzHm7jDChQipgg/hxboQok jAHHrxYRKe4j+ATvOnBQ497yv9kLBavw7CPms4F4/7HF+i7MUBjnJG1IjQ37u6LmDzpWwIC ri6/J8PhZ/bJ/FAr7FOITtqMXkvMCZT3jQAye1SLzqI9KLohrknr1c4pIVROJ+d3+T7oP2X rzGx/qWVQ2xaL4KeBRtZg== UI-OutboundReport: notjunk:1;M01:P0:yVs5CcLKklI=;pKAOQTk3tZENaOwAAjTJI7KWK2i oLhDegY5c2TQ80ioUBO8zIVUwVB38UmNV1xFy2n6H0t6G3yTy+K3irlh1blLnzwPtYAIsompH NorL++6vRrDLepYass4SCQoGw3hpc9zcjrrE36pZyu2BP67RTs9pge9B3p5h3bBeyROAOR62q 1Pat0HSIND+I24plEp0jbE2GgoAU/TLTHjzS/QHGQPuiKu11Mt/PpMf5823Y1n9I3JcrCqoBe pLcG56ZCLxLIekR7veaTKqqLqNNbeMJZCg2dALbMDaOIg0bkSW+Jp0kTVr3p5A6e8+BWEz818 letLnv19aSjMbN7xtY/WHVklzLqUpXdB1xvsSGUIWGmbfsRUeh5t2Ru07qbdvO84IkdZquACc x+iYIx26uIXRPkQsobFYoH8+/L1HhkQ7UtAZarK1p6PAa85DCwcowvHAMSJwG9+Ms5FiAltV4 Q1tHnZfdiB9KAKpPT0NtXx89fp5AiEKNMCS6OCwZZNS3/EXs1ScPYTc2PqKnl78ow+W3sil3G 6nXlmsMOevEQ37kbT3ohm09osYwRhb8So1MQX6Nz9G2zHHPo2A0dfB6Yuk0AVsztlwCUV1by0 5YhFSc63Ag5N77TZRoPX9JSOLBYmTsOabK9+HR0B+2gjJbf2h80tKtg0LST4rao85eoT5Qn3I S+DPiz2OZjUG9OZfC67VkpP45Hzd3MSwGsRI4kX4clW+OaOlPxdSRexN+uZ0EI7ZiX7qseEoz UfJD0P7lFFdsGr2+nuTiilp/NHZLJiAmdFDeX3TULbw1ookCCwkSDAZgHiwXPgw6qv1ZDAV9 Received-SPF: pass client-ip=212.227.15.18; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:311533 Archived-At: Jonas Bernoulli writes: Hi Jonas, >>> - It implements a "sleeping editor". This is a shell script, which >>> outputs a request on stdout and then waits to be told to return. >>> With-editor use a process filter too look for that output and when >>> it sees it, it responds in a similar fashion to server.el. This >>> is useful because makes it possible to do this over Tramp. (I >>> believe this could also be done using regular emacsclient+server.el, >>> but that is difficult to setup and a security risk if not done >>> correctly. >> >> If we want a better/safer client-server connections for remote hosts, >> it should be handled in Tramp, I think. > > Probably and it would be great if Tramp did handle that, but I don't > even use Tramp except when users report that there is an issue when > using Tramp with one of my packages. So I am not the right person to > implement it there, but if Michael were to tackle this, then maybe I > would have some insights that could be useful. Or not. Finally, I've found a free time slot to check with-editor. In fact, emacsclient can also be called on a remote machine in order to reach the local Emacs server instance. What is needed is, that emacsclient must tell the Emacs server where it is located. Since Emacs 26, emacsclient is prepared for this. If you call "emacsclient --tramp=", all file names on the server side, emacsclient sends as "/path/to/file", are "/path/to/file". If you detect a remote directory in with-editor, you can add the option (concat "--tramp=" (file-remote-p default-directory)) to the emacsclient call, because file-remote-p returns exactly the needed prefix. Best regards, Michael.