all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jarosław Rzeszótko" <jrzeszotko@gmail.com>
To: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Making debugging possible on expressions executed from ielm
Date: Fri, 19 Jan 2018 20:14:15 +0100	[thread overview]
Message-ID: <CAO_X8WAhnJ4GV7HnNmQ=1sHXv_zWgoYZjADE=ZPTK+HEB5BENA@mail.gmail.com> (raw)
In-Reply-To: <CAO_X8WATaofe3U0Z-7Lmud_5RDXue6W97chgwtSbMeUO1_uMmQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2300 bytes --]

Any chances of getting this patch committed?

Thanks and cheers,
Jarosław Rzeszótko

On Mon, Jan 15, 2018 at 8:22 PM, Jarosław Rzeszótko <jrzeszotko@gmail.com>
wrote:

> Stefan,
>
> I did not know about condition-case-unless-debug, it indeed does make
> debugging possible with a simpler change and without any side effects. I
> attach the patch.
>
> Cheers,
> Jarosław Rzeszótko
>
> On Sat, Jan 13, 2018 at 10:22 AM, Jarosław Rzeszótko <jrzeszotko@gmail.com
> > wrote:
>
>> I attach a patch for ielm.el that makes it possible to enter the debugger
>> when executing expressions in ielm, and that makes ielm respect the
>> debug-on-error and debug-on-exit flags.
>>
>> I guess that possibly the reason that was not originally done is that it
>> is not obvious how to restore ielm to a usable state after the debugger has
>> been entered. My patch makes use of the fact that unwind-protect unwind
>> forms are still executed when user resumes execution from the debugger
>> after an error.
>>
>> Without the patch, ielm wraps the evaluation of the expression given by
>> the user in a condition case, and in case of an error, or exit, displays an
>> appropriate message in its buffer, right under the evaluated expression,
>> regardless of debug-on-error and debug-on-exit.
>>
>> With the patch, the message that ielm displays in its buffer will be a
>> generic error message  regardless if there was an error in the evaluated
>> form, or a quit. However:
>>
>> - if debug-on-error is t, emacs will enter the debugger and show a stack
>> trace, just like with almost any other evaluation method. When the user
>> continues the execution from the debugger, ielm will correctly resume
>> execution
>>
>> - if debug-on-error is nil, emacs will display the specific error in the
>> minibuffer anyway
>>
>> Similar things are true for debug-on-quit.
>>
>> I think this is an improvement over the current state of affairs. Of
>> course ideally I would like to preserve the "nice" message in ielm buffer
>> and make the improvements I made, but emacs does not seem to make it
>> possible to do some handling of an error and then to re-raise it while
>> preserving the original stack trace.
>>
>> Cheers,
>> Jarosław Rzeszótko
>>
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 3129 bytes --]

  parent reply	other threads:[~2018-01-19 19:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-13  9:22 Making debugging possible on expressions executed from ielm Jarosław Rzeszótko
2018-01-15 17:23 ` Stefan Monnier
2018-01-15 19:22 ` Jarosław Rzeszótko
2018-01-15 21:59   ` Stefan Monnier
2018-01-16  6:42     ` Jarosław Rzeszótko
2018-01-19 19:14   ` Jarosław Rzeszótko [this message]
2018-01-19 19:58     ` Eli Zaretskii
2018-01-20 17:55   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAO_X8WAhnJ4GV7HnNmQ=1sHXv_zWgoYZjADE=ZPTK+HEB5BENA@mail.gmail.com' \
    --to=jrzeszotko@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.