unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Davin Pearson <davin.pearson@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>
Subject: How do I go about debugging my Elisp code?
Date: Sat, 8 Jan 2022 18:20:47 +1300	[thread overview]
Message-ID: <CAG9ihEv+vex+5=PLcn2Pvs1RLQQgGVjjD7_sGxcZOYscr2mj=g@mail.gmail.com> (raw)

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

I sent this email to gnu.emacs.help but got no reply :-(

When it comes up with a back trace it notifies you of the
problematic line of code but doesn't tell you which line the
error comes from.

What I have to do with this is to put debugger checkpoints on
every second line of Elisp code.  At least that gives you the
location of the error message, by looking at the *Messages*
buffer you can see the last checkpoint before the debugger
was entered...

See the file at the following location for an example.
In this file debug lines are commented out like so
;;(message "#cream:[0-9]+:")

http://davinpearson.nz/binaries/dmp-padderise.el

Executing the command in this file called dmp-padderise.el:
dmp-padderise--uncomment-hash-lines makes all the debug lines
visible to the Elisp system.  Executing the following command:
dmp-padderise--comment-hash-lines comments out the debug lines.

Is there a better way to hunt down error messages?

Could someone email me a hyperlink to a superior debugging
system?

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

             reply	other threads:[~2022-01-08  5:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-08  5:20 Davin Pearson [this message]
2022-01-10 10:11 ` How do I go about debugging my Elisp code? Michael Heerdegen
2022-01-10 10:37   ` Po Lu
  -- strict thread matches above, loose matches on Subject: below --
2022-01-08  5:36 No Wayman

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='CAG9ihEv+vex+5=PLcn2Pvs1RLQQgGVjjD7_sGxcZOYscr2mj=g@mail.gmail.com' \
    --to=davin.pearson@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 public inbox

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

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).