From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: unwind-protect within while-no-input Date: Thu, 9 May 2024 20:41:46 +0300 Message-ID: <81e1ee34-4262-4bd8-884d-2495230e22a6@gutov.dev> References: <86msp1a24a.fsf@gnu.org> <86jzk4a5ck.fsf@gnu.org> <8634qs9yl0.fsf@gnu.org> <861q6c9wdj.fsf@gnu.org> <86r0ec87d5.fsf@gnu.org> <86edab8rml.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13016"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Spencer Baugh , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 09 19:42:59 2024 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 1s57nG-00038I-Bu for ged-emacs-devel@m.gmane-mx.org; Thu, 09 May 2024 19:42:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s57mX-0008FW-ID; Thu, 09 May 2024 13:42:13 -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 1s57mE-0008EO-3u for emacs-devel@gnu.org; Thu, 09 May 2024 13:41:54 -0400 Original-Received: from wfhigh7-smtp.messagingengine.com ([64.147.123.158]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s57mB-000088-OP for emacs-devel@gnu.org; Thu, 09 May 2024 13:41:53 -0400 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.west.internal (Postfix) with ESMTP id 9838A1800115; Thu, 9 May 2024 13:41:49 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 09 May 2024 13:41:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1715276509; x=1715362909; bh=4FZRQ9/nKQKHLwSLzzD4niJLUiWPoKhFqgnqf7VKHPY=; b= ZduV1oqEzQKGlPXCvSFX8WtFJm/t2i9JJ5RQqnpcqlmZEmlKHnOVJMV1LjTjDDoY MXGixJ/lcwYs7iK05ui40LtSR4efhRNaadax8oy3aaiXBhXvt0CfjV0X38rLGtEo mqe9B0Z/Mo2jC//fweSMW8mbI4uPRtRztiMpVnhhU2jllkBqqZm72mbNh04e587W xAeNxk26D9l7XK+tZYliWyu0actupbvzIsCvO6Jp49FrYR/AE88MQljDbvf0zeEs vCI96VQQH+/kPy5yOJg6iootqN9imyZBf6VIIQQar3MlKvfMGZOOFFCAUSLwB04B Y5hkD7eUnLuUxzVhKUKY/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1715276509; x= 1715362909; bh=4FZRQ9/nKQKHLwSLzzD4niJLUiWPoKhFqgnqf7VKHPY=; b=F nAnFYZj1UTnH6sFMOmw9JRh2DL8jOMie+ScyU3Fizv9G0bPUND9JtUxKEHGJ68SX O4J/gfsASkorC0FpZtmlhr0uEZdsmmJu9lFXvWuykXQuuDKvSdFGfwLvWwCFtx8C I7ZSZpMisrLuwRc58N5s97PclaDApqihP3QGhRYvNsn6n9EhnkG7qtsSlpAVjMgE 2RyV3BPF2xp0d1jqEPpxlZSMjImkX30HQOmEjtBU5BCiraxnj7ymsuyL64zcPAo0 MeyGQU9DuW1ZM3OPEfet1dDrGZOaxAIfQnbDHNlgP5NQ0mE/zypRxSsXy9HZGRfV D6abEIytHBJcJDXmy3L9g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdefvddguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnheptdfhuedvtdevleegueelvedvjeevheffveevhedvuefftdefhfdvueeggfet gfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 May 2024 13:41:47 -0400 (EDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=64.147.123.158; envelope-from=dmitry@gutov.dev; helo=wfhigh7-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, 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:319093 Archived-At: On 09/05/2024 16:07, Spencer Baugh wrote: >> The correct solution to these problems is to document the requirements >> of your function from the callers, and let the callers deal with that >> according to their needs. (I suspect that in the case that bothers >> you, you yourself are that caller, which makes it easier to implement >> such protocols.) >> >> Btw, you never explained why you are bothered specifically by >> while-no-input. Nor did you describe the problem. > I'm writing a completion-at-point-function and completion table. This > table internally uses asynchronous subprocesses to get completions. > > This completion-at-point-function and table may be called by the popular > completion frontend corfu-mode. corfu-mode uses while-no-input around > calls to completion tables. > > I want to ensure that my asynchronous subprocesses are deleted even if > my code is interrupted by corfu's while-no-input. > > I can't change the protocol of completion tables or > completion-at-point-functions (that's defined by Emacs), and I'm not the > one calling while-no-input (that's corfu-mode). And for some extra context: one of the questions at this point is whether company-mode should also use while-no-input around completion table queries (for better responsiveness, naturally), or at least provide an opt-in way to do so. I wasn't sure there is a safe way to implement completion tables inside such amended protocol (this is finicky stuff, after all), and suggested Spencer asks on the mailing list. The question is specifically about while-no-input, though I suppose any good solution for it should be safe against C-g too.