all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eduardo Ochs <eduardoochs@gmail.com>
To: Lewis Creary <lewcreary@cs.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Learning Edebug
Date: Fri, 20 Dec 2024 04:18:13 -0300	[thread overview]
Message-ID: <CADs++6hcws6mGRwFMcXCYuoZA6TPO6g1_ENGxZBvovxvfFK0_w@mail.gmail.com> (raw)
In-Reply-To: <130443705.1910512.1734664285448@mail.yahoo.com>

On Fri, 20 Dec 2024 at 00:15, Lewis Creary via Users list for the GNU
Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
> Hello,
>
> I'm trying to learn how to use the Emacs lisp function Edebug, but
> so far am not having any success.  The documentation says that I
> need to "instrument" the function that I want to debug, and I'm even
> having trouble with that.
>
> I've been programming in Emacs Lisp for over a decade, and have
> always found that print statements were sufficient for debugging my
> programs.  But now I have a bug that I won't be able to
> understand without stepping through the code with a debugger --
> hence the need for Edebug.  I'm looking for a person who is
> willing and able to help me learn to use this tool.  If you are
> such a person, I'd be very glad to hear from you.


Hi Lewis,

this is a mini-tutorial on Edebug that I wrote for a friend some time
ago:

--snip--snip--
;; Preparation:
;;   (emacs-lisp-mode)
;;   (require 'edebug)
;;
;; See: (find-elinode "edebug")
;;      (find-elnode "Edebug")
;;      (find-efunctiondescr 'eval-defun "instrument")
;;      (find-efunctiondescr 'edebug-mode)
;;      (find-efunctiondescr 'edebug-mode "C-M-x" "eval-defun")
;;      (eek "M-h M-k  M-C-x  ;; eval-defun")
;;
(defun ee-triangle-buggy (n)
  (if (= n 1) 1
    (+ n (ee-triangle-buggy (1= n)))))

;; Instrument the defun above with:   (eek "3*<up> C-u M-C-x")
;; Run it in edebug mode with:        (ee-triangle-buggy 4)
;; Start by learning these keys:
;;      (find-elnode "Edebug Execution Modes" "<SPC>" "Step:")
;;      (find-elnode "Edebug Misc" "q" "Return to the top level")
--snip--snip--

It needs eev, and it uses elisp hyperlinks. Everything there should
make sense to people who understand the sections 2 and 3 of the main
tutorial of eev - see:

  Trying eev with a sexp (2024)
  http://anggtwu.net/2024-find-tryit-links.html

Usually Brazilians understand eev immediately, but for many people in
developed countries using explicit sexps feels so wrong that examples
like the one above don't make any sense at all, even after years. I
talked a bit about that in my presentation at the EmacsConf2024 and in
a related video. Here are links to their subtitles:

  http://anggtwu.net/emacsconf2024.html#0:00
  http://anggtwu.net/2024-bash-test-blocks.html#0:00

My holidays have just started and I am planning to hang out a lot in
the #emacs IRC channel in the next days. If you would like to chat
meet me there or send me an e-mail!

  Cheers,
    Eduardo Ochs
    http://anggtwu.net/#eev



  parent reply	other threads:[~2024-12-20  7:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <130443705.1910512.1734664285448.ref@mail.yahoo.com>
2024-12-20  3:11 ` Learning Edebug Lewis Creary via Users list for the GNU Emacs text editor
2024-12-20  6:23   ` mbork
2024-12-20  7:18   ` Eduardo Ochs [this message]
2024-12-20  8:11   ` Joost Kremers
2024-12-20 11:36   ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-12-20 15:37     ` [External] : " Drew Adams
2024-12-20 22:46   ` tpeplt
2024-12-21  2:41     ` Eduardo Ochs
2024-12-21  6:17   ` Joel Reicher
2024-12-21 18:44     ` [External] : " Drew Adams

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=CADs++6hcws6mGRwFMcXCYuoZA6TPO6g1_ENGxZBvovxvfFK0_w@mail.gmail.com \
    --to=eduardoochs@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=lewcreary@cs.com \
    /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.