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.help Subject: Re: Issue with remote async processes. Date: Fri, 25 Mar 2022 09:55:55 +0100 Message-ID: <87y20yif6s.fsf@gmx.de> References: <20220324222414.6k5cj2ovxfnpozwr.ref@Ergus> <20220324222414.6k5cj2ovxfnpozwr@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10315"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Ergus Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 25 09:56:42 2022 Return-path: Envelope-to: geh-help-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 1nXfkQ-0002SU-ND for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 25 Mar 2022 09:56:42 +0100 Original-Received: from localhost ([::1]:34504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXfkP-0007wp-A8 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 25 Mar 2022 04:56:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXfjq-0007wN-Us for help-gnu-emacs@gnu.org; Fri, 25 Mar 2022 04:56:06 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:54387) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXfjl-0008Aw-89 for help-gnu-emacs@gnu.org; Fri, 25 Mar 2022 04:56:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1648198557; bh=RmOa7uwEA10CJrahJA+CSck6wBD3EoYEIbSyE7S91m0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=BotmoN3gQRuYfRhyCiPaW9wAVq8oz4EYK8kOpcJ9TEM/LCeKGCdZZi0Zy5fX8fuID XSlLTBx2v6Mgx7eTs7z4R545cYwNqXhwZQB5Pg1SyM2rRDDeeDEPD6Mku+25fiN08Z m9oGESr8+sQphqOr0uzPoppopmItFTQhH3GTF6BQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.118.40]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MBDj4-1nMAU63ZBG-00Cf9R; Fri, 25 Mar 2022 09:55:56 +0100 In-Reply-To: <20220324222414.6k5cj2ovxfnpozwr@Ergus> (Ergus's message of "Thu, 24 Mar 2022 23:24:14 +0100") X-Provags-ID: V03:K1:V5O/hETADK6X/vPzGem0FR50jpntqvpsehM7XRyKEEYhPsAICar pOID3xsZQSiZll+j6Ebsy49Zm9FNwG0GCwicenusWkPHgnXwnd0Q36lswJLKiZLN5dwVSYK k4Y+YCmuiWx0jMILXT5lcQQHWCqirj0XbSNFmJ1yBcdKA9vvQEJ29qvsxMdhE9rt4VnMjSC fy+jNmr2FFYJgVjUsfa6Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:ifG4FfG6es8=:WlWFPJK9mBLjwwLEXxUojZ qYdrN7lvTp8N0TVU1RNKj3zPHGHlazRtSsi0gf7QbkwkOFGsyAeYmQBDRhFdczg2LymLmTH2U pFimRn6NxzZoz1toXpMAGoMVTc38iBRJnifJ4d+NOTfwRycxZT9Y/iL+35TNU54n89c3l953f EfZhyDdg6yX0aa9wqRgVxZaI30B+91hnFWXF9a/4OKVbJ2VGjxzY5xm3tFAd0NLxcruYaQbuA mr+XtOEhIJRey6oDxySvyrt6W0ef16VEqEwdX8+a9ZkZXpY2BKSffhsDK0AqtfwvM16Eo0aBu iGLkwZdQcHat5naY7tfS1Ni3k59/xknMKeU9YHxpS49Nvw8rtJBkjWxNxaVI9y9A3+d5wQSFr 7N4TOAoBMKCfYUPAQ9eq9rysrUUzbTszm1HvuB3C9QemuOJnCwlM7wvez0lmLN0hui87+Y85u 9I8jLAU9izUa4QlA+NrBtPT6rnxMf8G3EgXklq6F0o7OrI1kckX+w9o+VTIcyKgjUhxGIRefh k07xShw1aqqwzT+NbmzjiI4NGxI5oo1ddhJ14e+xdTDl0bFFGtjZcIsXELuSbHQ37xv7lD8pJ DBm2ouhyYdCsZhPETWYhR1MtjN+cShtB+QNhHHjAhXcz/zAN9nvuUnGDJsGC5dfO4OTZLCnoJ xQnz3+2DEu51A/Y3zEDlC5uya7Kw0mzap87SkI0o/cfrJb6KazrdNVBQ14ZR6xwpAxUB7BA/R vB7F75jV/A8YkWgET2i1xjlUnzo2q1pqkLPqzDoLgAYtpfxHS+E109fM7R7puKRQnlcjBIzg Received-SPF: pass client-ip=212.227.17.20; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136749 Archived-At: Ergus writes: > Hi: Hi, > I have this simple code: > > (defun my/async-sentinel (process _msg) > "Sentinel function for an asynchronous counsel PROCESS." > (when (eq (process-status process) 'exit) > (with-current-buffer " *string-output*" > (while (accept-process-output process)) > (message "%s" (buffer-substring-no-properties (point-min) (point-max)))))) > > (let ((my/output (generate-new-buffer " *string-output*" t)) > process) > (with-connection-local-variables > (setq process (start-file-process "myls" my/output "ls")) > (set-process-sentinel process #'my/async-sentinel))) > > This works in local processes without issues, but on remote I don't get > any output. Probably it is an error in the code, but I don't understand > what's missing. And something similar to this used to work before. > > Any help please? You call (generate-new-buffer " *string-output*" t) which means several instances of this buffer might exist in parallel, with different names. So you cannot expect, that --8<---------------cut here---------------start------------->8--- (with-current-buffer " *string-output*" --8<---------------cut here---------------end--------------->8--- works. Instead, use --8<---------------cut here---------------start------------->8--- (with-current-buffer (process-buffer process) --8<---------------cut here---------------end--------------->8--- Best regards, Michael.