[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Attaching context info to an error
From: |
João Távora |
Subject: |
Re: Attaching context info to an error |
Date: |
Sat, 23 Dec 2023 03:28:03 +0000 |
On Sat, Dec 23, 2023 at 3:02 AM João Távora <joaotavora@gmail.com> wrote:
> (defun pm/invoke-restart (restart)
> (interactive
> (some-read-from-minibuffer-or-somesuch))
> (funcall (caadr restart)))
>
> (defun baz (sym)
> (error "whoops, it happened again for %s" sym))
>
> (defun bar ()
> (pm/with-retry-restart (:msg "Retry") (baz (gensym))))
>
> (defun foo ()
> (bar))
>
> (foo)
>
> ;; Local Variables:
> ;; read-symbol-shorthands: (("pm/" . "poor-mans-restarts-"))
> ;; End:
>
> This very code works fine in Common Lisp (just add a WHILE
> macro to it)
Just to be clear what I meant by this to those unfamiliar with
Common Lisp and interactive restarts. It means I can invoke
the restart interactively from the Common Lisp debugger that
is invoked as the last step of the non-returning error.
'baz' will be called again and again with different arguments
and always errors until I recompile it to something else that
doesn't error, which I can do while the debugger is active.
I expected to be able to do the same from the Emacs Lisp
debugger-mode/backtrace-mode *Backtrace* buffer, but I never
get one such buffer.
João
- Attaching context info to an error, Stefan Monnier, 2023/12/21
- Re: Attaching context info to an error, Gerd Möllmann, 2023/12/22
- Re: Attaching context info to an error, Jens Schmidt, 2023/12/22
- Re: Attaching context info to an error, João Távora, 2023/12/22
- Re: Attaching context info to an error, Stefan Monnier, 2023/12/27
- Re: Attaching context info to an error, João Távora, 2023/12/27
- Re: Attaching context info to an error, João Távora, 2023/12/27
- Re: Attaching context info to an error, Stefan Monnier, 2023/12/27