From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: unwind-protect within while-no-input Date: Wed, 08 May 2024 21:51:34 +0300 Message-ID: <86r0ec87d5.fsf@gnu.org> References: <86msp1a24a.fsf@gnu.org> <86jzk4a5ck.fsf@gnu.org> <8634qs9yl0.fsf@gnu.org> <861q6c9wdj.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10633"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 08 20:52:21 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 1s4mOr-0002hZ-06 for ged-emacs-devel@m.gmane-mx.org; Wed, 08 May 2024 20:52:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4mOF-0006sa-NF; Wed, 08 May 2024 14:51:43 -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 1s4mO8-0006rl-L4 for emacs-devel@gnu.org; Wed, 08 May 2024 14:51:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4mO8-0002xl-6d; Wed, 08 May 2024 14:51:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xHcMPopNRFWoc3ydwbWM/NjQ8vY4/mBX6yD21h0Dook=; b=H8nZ2uHLcNe7 HjD7NXt3r+B/5Gd7iS5Z0Ye1mQIr5jsnJL1YXPVKJ7ybzE0AaDnYUDrs04CHyZq6T79X1llxyHHLs ncoKeIHC8pLDa1LjNL0SVyGLI2jvwxpR3Uu8uOTlphPa40UMX3ye9LSJaraS5E+VEm3ckGqQtSWvz eJMpDYzYG6kz7FzNH2cET5vw8u3w2t/cUDI1H6K5nKVg7+qk30IQSblFX7Z81Y6+ZM7nb16YgNVTA T/qCVslSiHnc1aYJotZAlIwz8tQSK63VgFDCE+TB4aerZa4aLywWG/vU9dJ75f6NXByYuB7OUEFmZ fzIvZTJBV06i3E+BQzouMg==; In-Reply-To: (message from Spencer Baugh on Wed, 08 May 2024 11:14:05 -0400) 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:319022 Archived-At: > From: Spencer Baugh > Date: Wed, 08 May 2024 11:14:05 -0400 > > If I have a function: > > (defun my-function () > ...do something...) > > which might be invoked by some other package that I don't control like this: > > (defun some-other-package () > (while-no-input > ... > (my-function) > ...)) > > How does my-function run the unwind-forms when it is interrupted by > while-no-input? How can a function cause its caller to do anything at all? It can't. If the caller wants to make sure some unwind-forms will always run after my-function either returns locally or exits non-locally, the caller needs to arrange for that.