unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: How do I get edebug online?
Date: Mon, 17 Jan 2022 14:46:17 -0800	[thread overview]
Message-ID: <87fspmkmkm.fsf@ericabrahamsen.net> (raw)
In-Reply-To: CAG9ihEv2gMRvv8s-NR3i64D4o_HNM5wQ6KDZpvuexOOc-5cwtg@mail.gmail.com

Davin Pearson <davin.pearson@gmail.com> writes:

> First I eval the following sexp:
>
> (setq edebug-all-defs t)
>
> Then I issue the following command on the following code which resides
> in a file called:
> ~/java-training-wheels/dlisp/coolmacs/dmp-grep--splat-file.el.
> The command is \C-\M-x.  The file contains the following defun:
>
> (defun fac (n)
>   (when (= 5 n)
>     (message "Foo bar")
>     (edebug)
>     (message "Rita Hayworth"))
>   (if (< 0 n)
>       (* n (fac (1- n)))
>     1))

You don't insert an actual call to (edebug) in your code (I didn't
actually know that was possible, and looking at the docstring it says it
works more or less like `debug', which is why you got the backtrack you
mention below).

Using `edebug-all-defs' always seemed clumsy to me, and likely to cause
an explosion of unwanted effects. I would leave that as nil, and then
just use the C-u prefix argument for C-M-x (`eval-defun'). That lets you
be much more targeted about what you instrument and what you don't.

Now, when you execute the function, edebug will halt execution right at
the beginning of the function, and hand over control to you and
keybindings like "g" and "SPC" and what have you. You don't need to
insert anything into the function definition itself.

HTH,
Eric




  reply	other threads:[~2022-01-17 22:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 22:28 How do I get edebug online? Davin Pearson
2022-01-17 22:46 ` Eric Abrahamsen [this message]
2022-01-17 23:34   ` Michael Heerdegen
2022-01-17 23:44     ` Eric Abrahamsen
2022-01-18  0:06       ` Michael Heerdegen
2022-01-18  0:10       ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-01-18  3:43         ` Eric Abrahamsen
2022-01-17 23:55 ` Michael Heerdegen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87fspmkmkm.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).