[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: How do I go about debugging my Elisp code?

From: Jean Louis
Subject: Re: Fwd: How do I go about debugging my Elisp code?
Date: Fri, 14 Jan 2022 11:24:06 +0300
User-agent: Mutt/2.1.5+104 (cd3a5c8) (2022-01-09)

I join to advise by Michael from Sweden as to make it a proper
package, use byte-compiler messages and warnings first.

You could use M-x emacs-lisp-byte-compile to find various warnings and
that is also for debugging purposes.

What I often do is instrumenting the function for Edebug and using
xref package to move from function to function.

Here is the method:

1. First find the function which you suspect or wish to debug, or the
   one which you are invoking.

2. Press C-u for prefix followed by C-M-x within the function. This
   will instrument the function for Edebug.

3. Run the function to begin the process. Once instrumenting process
   begins, click "n" for next and verify various values and how
   function is executed. You will find out what is wrong.

4. If you see that function is calling other function where you think
   that problem exists, instrument that other function as well.

5. To remove instrumentation use M-x edebug-remove-instrumentation and
   remove functions which you don't want to inspect any more.


Take action in Free Software Foundation campaigns:

In support of Richard M. Stallman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]