emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 425c281 1/3: Allow t as a catch-all condition-c


From: Noam Postavsky
Subject: Re: [Emacs-diffs] master 425c281 1/3: Allow t as a catch-all condition-case handler (Bug#24618)
Date: Thu, 6 Sep 2018 21:01:31 -0400

On 5 September 2018 at 11:31, Stefan Monnier <address@hidden> wrote:
>> Hmm, right. The rest of the docstring talks only about errors though.
>> Should we change the whole thing? While technically more accurate,
>> saying "Regain control when a signal is signaled" sounds a bit funny.
>
> I think the solution normally used is that "signal" is only used for the
> action, while the event-object is called "condition".  I.e.
> "Regain control when a condition is signaled".

So how about this:

 DEFUN ("condition-case", Fcondition_case, Scondition_case, 2, UNEVALLED, 0,
-       doc: /* Regain control when an error is signaled.
-Executes BODYFORM and returns its value if no error happens.
+       doc: /* Regain control when a condition is signaled.
+Executes BODYFORM and returns its value if nothing is signaled.
 Each element of HANDLERS looks like (CONDITION-NAME BODY...)
 where the BODY is made of Lisp expressions.

-A handler is applicable to an error if CONDITION-NAME is one of the
-error's condition names.  A CONDITION-NAME of t applies to any error
-symbol.  If an error happens, the first applicable handler is run.
+A handler is applicable to a condition if CONDITION-NAME is one of the
+condition's names.  A CONDITION-NAME of t applies to any condition
+name.  If a condition is signaled, the first applicable handler is run.

 The car of a handler may be a list of condition names [...]

-When a handler handles an error, control returns to the `condition-case'
+When a handler handles a condition, control returns to the `condition-case'
 and it executes the handler's BODY...
 with VAR bound to (ERROR-SYMBOL . SIGNAL-DATA) from the error.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]