Subject: Re: bug#79288: [PATCH] Add edebug-bounce-to-previous-value

From: Eli Zaretskii <[email-masked]>
Date: Fri, 22 Aug 2025 09:39:50 +0300

> Date: Thu, 21 Aug 2025 21:40:54 +0200
> From:  Jens Schmidt via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> Edebug has `edebug-bounce-point', which is invaluable to quickly peek
> into the current buffer and its position during an Edebug session.
> 
> But now suppose you edebug a form
> 
>   (< foo-position (foo-end-of-current-blurb))
> 
> involving buffer positions and you would like to know where
> `foo-position' and the result of the call to `foo-end-of-current-blurb'
> are located in the current buffer while stepping through that form.
> AFAIK, this involves manual switching to the current buffer, calling
> `goto-char', etc., which is inconvenient and breaks the debugging flow.
> 
> The attached patch extends the concept of `edbug-bounce-point' by adding
> a function `edebug-bounce-to-previous-value'.  That function uses the
> previous value (as recorded by `edebug-compute-previous-result') to
> bounce point to that value.  (If the previous value is not an integer
> or marker, the function errors out.)  In that way it is much easier to
> understand where buffer positions are actually located and what the code
> does with them.

Thanks, but I think this command should have a key binding.

> One could imagine alternative implementations, for example, by extending
> `edebug-bounce-point' to bounce to the previous value when called with
> C-u as prefix arg.

edebug-bounce-point already accepts an argument, so such an extension
would not be easy, and will probably make using the command too
cumbersome.

> If you agree that this feature would be useful and if we can agree on a
> concrete implementation, I can provide a full-blown patch including NEWS
> entry and all.

Yes, sounds useful, thanks.  Stefan, any additional comments or
suggestions?