From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Koch Newsgroups: gmane.emacs.bugs Subject: bug#61350: Eglot over Tramp freezes with large project Date: Sat, 11 Mar 2023 12:14:43 +0200 (EET) Message-ID: <1207702286.307021.1678529683809@office.mailbox.org> References: <87y1ootw2t.fsf@gmail.com> <87o7pflfcd.fsf@gmx.de> <87wn43e9ht.fsf@gmail.com> <874jr6oont.fsf@gmx.de> <87sfeqd4zi.fsf@gmail.com> <877cw1swjm.fsf@gmx.de> <87k0016dgo.fsf@gmx.de> <1458446553.50372.1677606917251@office.mailbox.org> <87ilfkh89k.fsf@gmail.com> <87y1ofct83.fsf@gmx.de> <87356n8kja.fsf@gmail.com> <877cvvfnp6.fsf@gmx.de> <54377687.213790.1678016749459@office.mailbox.org> <87356jfktc.fsf@gmx.de> <87a60ovi90.fsf@gmx.de> <31964054.380679.1678194256931@office.mailbox.org> <87r0u0u0rl.fsf@gmx.de> <87mt4otyy1.fsf@gmx.de> <87pm9fk6ht.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32815"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61350@debbugs.gnu.org To: Michael Albinus , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 11 11:15:37 2023 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 1pawGG-0008KS-33 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Mar 2023 11:15:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pawFp-0007ER-7u; Sat, 11 Mar 2023 05:15:09 -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 1pawFj-0007Dx-CW for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2023 05:15:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pawFi-00032J-W8 for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2023 05:15:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pawFi-0000Tk-HZ for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2023 05:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Koch Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Mar 2023 10:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61350 X-GNU-PR-Package: emacs Original-Received: via spool by 61350-submit@debbugs.gnu.org id=B61350.16785296951809 (code B ref 61350); Sat, 11 Mar 2023 10:15:02 +0000 Original-Received: (at 61350) by debbugs.gnu.org; 11 Mar 2023 10:14:55 +0000 Original-Received: from localhost ([127.0.0.1]:56621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pawFb-0000T5-8W for submit@debbugs.gnu.org; Sat, 11 Mar 2023 05:14:55 -0500 Original-Received: from mout-p-101.mailbox.org ([80.241.56.151]:41500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pawFZ-0000Sq-9D for 61350@debbugs.gnu.org; Sat, 11 Mar 2023 05:14:54 -0500 Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4PYf110Vd2z9sST; Sat, 11 Mar 2023 11:14:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=koch.ro; s=MBO0001; t=1678529685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fG+lGj5Wc/6rlrlaBbBYSwmILPe+21OZpo1geAOTTbk=; b=jWLDy8qr/xCGE7MIJPVJEM9BL6Upx82E7ch5Ey+1gMasgnt9KPzMCEI3Bcp+nOxi7osMX+ d1HHg37G1IEPHO9XtUAZCUVrulTqgWV7D20gOI6bDl6nCoCocOGy2x/eP+PjlDtcgzSALn EVcweabN0l+rR/ZjKYh1fIgEuAMWeMCjV7GJ14Xps3w+g0tZFrLXffD3DsxfNLXPLSpPQy sYAfy3ymK5QYXr8rHysZl13dC7fLNbCSkDNwjOfo0IgrwgHqp+DKzX6Y6g6s7aCLo/M0OA a1oHZWwI5jpSEgtNa7c7lwUMaQ2EjAzX3v4r4KnYtvsZ2pAmTYDuB4rXpAps8A== In-Reply-To: <87pm9fk6ht.fsf@gmx.de> X-Priority: 3 Importance: Normal 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:257775 Archived-At: Hi Michael, gute Besserung! I'm sorry, I didn't test your patch yet. I didn't have the focus time to do so. But mainly it does not look good to me. Even if our tests would indicate no problem, we couldn't possibly test for all side effects to all elisp code that works with processes. For me the conservative approach is to remove the JUST-THIS-ONE argument. I digged into the history of the JUST-THIS-ONE argument. etc/NEWS.22 says, emphasis from me: """ *** Function 'accept-process-output' has a new optional fourth arg JUST-THIS-ONE. If non-nil, only output from the specified process is handled, suspending output from other processes. If value is an integer, also inhibit running timers. THIS FEATURE IS GENERALLY NOT RECOMMENDED, but may be necessary for specific applications, such as speech synthesis. """ The argument was discussed here: https://lists.gnu.org/archive/html/emacs-devel/2004-08/msg00141.html and introduced in this commit: https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=107ed38d4bdec03002b2a23619e205722cd5b8d1 I don't even think that the original motivation for introducing JUST-THIS-ONE was valid. Unfortunately there was not much discussion about it. It was argued, that it would be hard to make a process filter function reentrant. And I think that this was an invalid root cause analysis to start with. First, the emacs manual says[1]: "Note that if any of those functions are called by the filter, the filter may be called recursively." - So you should make your filter reentrant, If I understand correctly. [1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Filter-Functions.html A process filter function Second, the manual further says: "Quitting is normally inhibited within a filter function". This indicates to me, that a filter function should be "side effect free" besides putting its input somewhere (e.g. in a buffer or message queue) and trigger an event if there is enough input for further processing. This also reduces the risk, that the function could be called recursively in a damaging way. It seems to me, that there is not yet a standard way in Emacs for continuations (or event driven programming) although the Emacs Wiki refers to the emacs-deferred library: https://www.emacswiki.org/emacs/ConcurrentEmacs Because there is no such library in Emacs, people either write their own code for continuations (eglot?) or do too much work in a process filter function (speechd-el in 2004 which led to JUST-THIS-ONE). I'm sending this email now to give you a quick response but will continue to read: https://jyp.github.io/posts/elisp-cps.html Thanks, Thomas