stumpwm-devel
[Top][All Lists]
Advanced

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

Re: [STUMP] [PATCH] Fix `eval-line' for the case when the user aborts


From: Diogo F. S. Ramos
Subject: Re: [STUMP] [PATCH] Fix `eval-line' for the case when the user aborts
Date: Thu, 06 Nov 2014 19:03:29 -0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

> Thanks for the patch! I've tweaked it a bit to get the behavior you
> suggest:
>> There might be a way to integrate this calling conventions, so
>> whichever the user aborts inside a input box, "Abort." is print and
>> there is no error thrown.
> This will be integrated in the master branch soon.

Cool, thank you.

Just let me reinterate what I said about throwing an error.

dc21a1c adds to `eval-line' the form (throw 'error :abort), which
`colon' also has.

When calling `eval-line' using a keybind, `call-interactively' is called
indirectly.  `call-interactively' has a `catch' form for `'error'.  So,
when the user presses C-g, `eval-line' throws the tag and
`call-interactively' catches it.  All good.

But, if one evaluates (eval-line nil) from the REPL, there will be no
`catch' for `'error', so there will be an error.  In SBCL, the error
reads "attempt to THROW to a tag that does not exist".

We are trading an error for another but admittedly, calling `eval-line'
from a REPL should be way less common than calling it using a keybind,
or even as a command from the `colon' input box.



reply via email to

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