GNU bug report logs - #79288
[PATCH] Add edebug-bounce-to-previous-value

Previous Next

Package: emacs;

Reported by: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>

Date: Thu, 21 Aug 2025 19:42:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
Subject: bug#79288: closed (Re: bug#79288: [PATCH] Add edebug-bounce-to-previous-value)
Date: Sat, 30 Aug 2025 09:37:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 79288 <at> debbugs.gnu.org.

-- 
79288: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79288
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: jschmidt4gnu <at> vodafonemail.de
Cc: 79288-done <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#79288: [PATCH] Add edebug-bounce-to-previous-value
Date: Sat, 30 Aug 2025 12:36:19 +0300
> Cc: 79288 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
> Date: Sun, 24 Aug 2025 17:00:39 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > Date: Sun, 24 Aug 2025 15:42:40 +0200
> > Cc: 79288 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
> > From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
> > 
> > On 2025-08-24  14:31, Eli Zaretskii wrote:
> > >> Date: Sun, 24 Aug 2025 14:02:52 +0200
> > >> Cc: 79288 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
> > >> From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
> > >>
> > >> On 2025-08-24  13:58, Eli Zaretskii wrote:
> > >>
> > >>> Hmm... either I'm blind, or there's no note in NEWS about removing the
> > >>> previous key binding of 'P'.
> > >>
> > >> Sorry, forgot to format-patch.  Next attempt ...
> > > 
> > > OK, last nit:
> > > 
> > >> --- a/doc/lispref/edebug.texi
> > >> +++ b/doc/lispref/edebug.texi
> > >> @@ -677,8 +677,7 @@ Edebug Views
> > >>  
> > >>  @table @kbd
> > >>  @findex edebug-view-outside
> > >> -@item P
> > >> -@itemx v
> > >> +@item v
> > >>  Switch to viewing the outside window configuration
> > >>  (@code{edebug-view-outside}).  Type @kbd{C-x X w} to return to Edebug.
> > > 
> > > This section, like many others, start with a summary of the commands,
> > > followed by the detailed description.  You added the detailed
> > > description, but please also add this new command to the summary part.
> > 
> > In section "Edebug Views" the patch has three hunks: The short one you
> > quoted above, then this one, which I considered to be the "summary part":
> > 
> > 
> >   @@ -689,6 +688,17 @@ Edebug Views
> >    before returning to Edebug.  With a prefix argument @var{n}, pause for
> >    @var{n} seconds instead.
> > 
> >   +@findex edebug-bounce-to-previous-value
> >   +@item P
> >   +Temporarily display the outside current buffer with the outside point
> >   +corresponding to the previous value
> >   +(@code{edebug-bounce-to-previous-value}).  The previous value is what
> >   +Edebug has evaluated before its last stop point or what you have
> >   +evaluated in the context outside of Edebug, for example, with
> >   +@kbd{C-x C-e}.  This command pauses for one second before returning to
> >   +Edebug.  With a prefix argument @var{n}, it pauses for @var{n} seconds
> >   +instead.
> >   +
> >    @findex edebug-where
> >    @item w
> >    Move point back to the current stop point in the source code buffer
> > 
> > 
> > And finally the third hunk, supposed to be the example/detailed
> > description:
> > 
> >   @@ -713,6 +723,20 @@ Edebug Views
> >    bounce to the point in the current buffer with @kbd{p}, even if
> >    it is not normally displayed.
> > 
> >   +  You can also bounce to buffer positions other than the current point.
> >   +Suppose you are debugging the form
> >   +
> >   +@example
> >   +(make-overlay beg end)
> >   +@end example
> >   +
> >   +@noindent
> >   +and you would like to know where @code{beg} and @code{end} are located
> >   +in the outside buffer.  Then you could either evaluate these, for
> >   +example, with @kbd{C-x C-e}, or step over them with @kbd{n}, and
> >   +immediately after that press @kbd{P}, to bounce to the position you have
> >   +previously evaluated.
> >   +
> >      After moving point, you may wish to jump back to the stop point.
> >    You can do that with @kbd{w} from a source code buffer.  You can jump
> >    back to the stop point in the source code buffer from any buffer using
> > 
> > 
> > Wouldn't that be sufficient?  If not, where exactly in the section would
> > you expect the "summary part"?
> 
> The summary should be shorter.  But never mind, I can fix that later.

Now installed on the master branch, and closing the bug.

Thanks.

[Message part 3 (message/rfc822, inline)]
From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add edebug-bounce-to-previous-value
Date: Thu, 21 Aug 2025 21:40:54 +0200
[Message part 4 (text/plain, inline)]
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.

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.

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.

Thanks for maintaining Emacs!


In GNU Emacs 31.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2025-08-21 built on sappc2
Repository revision: ade6608e2587452c8ea565ce3057879379ebd0b5
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12201009
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --with-native-compilation --with-mailutils'
[0001-Add-edebug-bounce-to-previous-value.patch (text/x-patch, attachment)]

This bug report was last modified 21 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.