From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: bug#47677: [PATCH] condition-case success continuation Date: Fri, 23 Apr 2021 00:18:06 -0400 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> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40101"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, stefan@marxist.se, monnier@iro.umontreal.ca, 47677@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=83=C2=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 23 06:19:19 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 1lZnHj-000AHF-BA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Apr 2021 06:19:19 +0200 Original-Received: from localhost ([::1]:44650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZnHh-0005GR-Tu for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Apr 2021 00:19:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZnHS-0005GL-IO for bug-gnu-emacs@gnu.org; Fri, 23 Apr 2021 00:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZnHS-0004gt-6u for bug-gnu-emacs@gnu.org; Fri, 23 Apr 2021 00:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lZnHS-0001nN-2R for bug-gnu-emacs@gnu.org; Fri, 23 Apr 2021 00:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Apr 2021 04:19:02 +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.16191514966848 (code B ref 47677); Fri, 23 Apr 2021 04:19:02 +0000 Original-Received: (at 47677) by debbugs.gnu.org; 23 Apr 2021 04:18:16 +0000 Original-Received: from localhost ([127.0.0.1]:35949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZnGh-0001mO-ME for submit@debbugs.gnu.org; Fri, 23 Apr 2021 00:18:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZnGf-0001m9-5X for 47677@debbugs.gnu.org; Fri, 23 Apr 2021 00:18:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34260) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZnGZ-00047P-60; Fri, 23 Apr 2021 00:18:07 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1lZnGY-0003BC-5u; Fri, 23 Apr 2021 00:18:06 -0400 In-Reply-To: (message from Mattias =?UTF-8?Q?Engdeg=C3=83=C2=A5rd?= on Thu, 22 Apr 2021 15:58:10 +0200) 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:204730 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > There's the business of fixing `catch` in the same way. (A new bug could be opened for it, but since it's intimately related we might as well do it here.) As mentioned, `catch` has three problems: > - no way to execute code when a throw is caught > - no way to execute code when the body terminates normally > - no way to catch both throws and errors I do not agree that these are problems. catch and throw are ok as they are, and we should leave them alone. catch is meant for intentional exits, and condition-case is meant for catching errors. If you want to handle both in one place, use both constructs there. If you want to do something after catch catches a throw, it is not hard to implement that using the existing constructs. (if (catch 'foo (prog1 nil ...do stuff...)) ;; use (throw 'foo t) to exit do-if-throw do-if-no-throw) given how rarely this is used, it's as easy as it needs to be, and avoids making catch complicated. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)