From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#47677: [PATCH] condition-case success continuation Date: Tue, 27 Apr 2021 19:00:53 +0000 Message-ID: References: <219007D9-0FD0-4AC2-A8B0-24A0FC277AE8@acm.org> <87lf9nzy48.fsf@gnus.org> <87F315E7-7F8A-46C5-A71B-F090F067D0B8@acm.org> <87sg3uskgt.fsf@gnus.org> <87zgy1qkni.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7576"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Filipp Gunbin , Lars Ingebrigtsen , Stefan Kangas , Stefan Monnier , 47677@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 27 21:01:28 2021 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 1lbSxb-0001i6-E0 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Apr 2021 21:01:27 +0200 Original-Received: from localhost ([::1]:42748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbSxa-0004ZI-E3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Apr 2021 15:01:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbSxC-0004Y1-31 for bug-gnu-emacs@gnu.org; Tue, 27 Apr 2021 15:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbSxB-0000v8-PY for bug-gnu-emacs@gnu.org; Tue, 27 Apr 2021 15:01:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lbSxB-00052C-Nx for bug-gnu-emacs@gnu.org; Tue, 27 Apr 2021 15:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Apr 2021 19:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47677 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 47677-submit@debbugs.gnu.org id=B47677.161955005719335 (code B ref 47677); Tue, 27 Apr 2021 19:01:01 +0000 Original-Received: (at 47677) by debbugs.gnu.org; 27 Apr 2021 19:00:57 +0000 Original-Received: from localhost ([127.0.0.1]:50925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lbSx7-00051n-5G for submit@debbugs.gnu.org; Tue, 27 Apr 2021 15:00:57 -0400 Original-Received: from heytings.org ([95.142.160.155]:55714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lbSx5-00051d-43 for 47677@debbugs.gnu.org; Tue, 27 Apr 2021 15:00:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1619550053; bh=R/J4Cy9ayVFAELnlE9a+whKIy0QGhNhImXpfzE/2LW8=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=wfrMc+ynuIqJvx7MjMypKGVckSxnTMwnseo/WN1Qt4rKOWiQI/CkrJnfPU8NrrCKk qjZX5ZuxVqkLWvziZ9qsxgm/aDHO2hm8qFIWjQOLGrf2mA4q9Km5tWT0gwij087zvp UE51FvxEKlKPH6wLDAMclAv4WqElMxrzlPpgAor0dtHX+Y/27Ahc8wa+ZeSd0SJ+5c oUyjkhhEgBKxKSe1sNkKP5QEmnzbBmdnDWiz2YGTjrqYyj6MM5pu93D9pVhXcZwRrn 66ofYuSPMj6yH4JMUKELwUfdSMe8PsYkWfDDUoz68SAHQrjOoMVatkktJCERFbg2F8 86mjZXgY+VG9w== In-Reply-To: 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" Xref: news.gmane.io gmane.emacs.bugs:205045 Archived-At: > > Unrelated to your comment: since several people have misunderstood the > proposal, I'm closing the bug > I guess you did not see my previous post in this bug thread. This bug should not be closed. I agree with Richard and Eli, it is not necessary to add that feature to Elisp, the more so as it can be implemented with a short macro: (defmacro if-success (var action continuation &rest handlers) "Regain control when an error is signaled, otherwise continue. Execute ACTION and, if no error happened, CONTINUATION, with VAR bound to the return value of ACTION. Otherwise, execute the appropriate HANDLER, with VAR bound to (ERROR-SYMBOL . SIGNAL-DATA)." `(catch 'success-case-failure ((lambda (,var) ,continuation) (catch 'success-case-success (throw 'success-case-failure (condition-case ,var (throw 'success-case-success ,action) ,@handlers))))))