[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#47677: [PATCH] condition-case success continuation
From: |
Mattias Engdegård |
Subject: |
bug#47677: [PATCH] condition-case success continuation |
Date: |
Thu, 22 Apr 2021 15:58:10 +0200 |
21 apr. 2021 kl. 16.13 skrev Stefan Kangas <stefan@marxist.se>:
> Should this be closed, or is there more to do here?
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
since neither `catch` nor `condition-case` compose with themselves or each
other.
For example, it would be useful to have `pcase` match both the value of an
expression as well as throws and errors from it.
Here is a proper patch, essentially a polished version of the previously posted
diff. It adds `condition-case` clauses on the form
((:catch TAG-EXPR) BODY...)
where TAG-EXPR is evaluated before the protected form to a tag value, and BODY
is executed when that tag is thrown, with the variable bound to the thrown
value.
0001-catch-handlers-in-condition-case-bug-47677.patch
Description: Binary data
- bug#47677: [PATCH] condition-case success continuation, (continued)
- bug#47677: [PATCH] condition-case success continuation, Lars Ingebrigtsen, 2021/04/12
- bug#47677: [PATCH] condition-case success continuation, Stefan Monnier, 2021/04/12
- bug#47677: [PATCH] condition-case success continuation, Mattias Engdegård, 2021/04/12
- bug#47677: [PATCH] condition-case success continuation, Lars Ingebrigtsen, 2021/04/13
- bug#47677: [PATCH] condition-case success continuation, Mattias Engdegård, 2021/04/13
- bug#47677: [PATCH] condition-case success continuation, Lars Ingebrigtsen, 2021/04/14
- bug#47677: [PATCH] condition-case success continuation, Mattias Engdegård, 2021/04/15
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/16
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/16
- bug#47677: [PATCH] condition-case success continuation, Stefan Kangas, 2021/04/21
- bug#47677: [PATCH] condition-case success continuation,
Mattias Engdegård <=
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/23
- bug#47677: [PATCH] condition-case success continuation, Mattias Engdegård, 2021/04/24
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/25
- bug#47677: [PATCH] condition-case success continuation, Eli Zaretskii, 2021/04/25
- bug#47677: [External] : bug#47677: [PATCH] condition-case success continuation, Drew Adams, 2021/04/25
- bug#47677: [External] : bug#47677: [PATCH] condition-case success continuation, Eli Zaretskii, 2021/04/25
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/26
- bug#47677: [PATCH] condition-case success continuation, Eli Zaretskii, 2021/04/26
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/26
- bug#47677: [PATCH] condition-case success continuation, Filipp Gunbin, 2021/04/26