Hot answers tagged

6 votes
Accepted

Examine function arguments after debug-on-error

The backtrace looks like this: signal(test-signal (1 2 3)) foo(123) (progn (foo 123)) eval((progn (foo 123)) t) elisp--eval-last-sexp(t) eval-last-sexp(t) eval-print-last-sexp(nil) ...
user avatar
  • 20.5k
6 votes
Accepted

Is it possible to edebug a lambda returned by a function?

Edebug does not support instrumenting code constructed at runtime. If you try to instrument create-function, then the stepping will occur when you evaluate (create-function 2), not when you execute ...
user avatar
  • 8,803
6 votes
Accepted

Signaling a breakpoint in Emacs Lisp

Add (debug) and you'll be thrown into a buffer showing you the backtrace and where you can examine the current state. See: Emacs Manual "Explicit Entry to the Debugger"
user avatar
  • 25.4k
5 votes
Accepted

Emacs is hanging on almost every word I type. How to identify the problem?

I would approach this a few ways: First, you'll want to identify if the problem reproduces in vanilla (i.e. non-configured, no Prelude) Emacs, or with your configurations. As Drew mentioned above, ...
user avatar
  • 398
5 votes

Debug pytests in emacs

I think that there are only the following solutions: Run tests outside of Emacs from your terminal emulator Run tests from realgud Run tests inside Emacs via eshell. But shell output may be corrupted,...
user avatar
4 votes
Accepted

How to force `condition-case` to activate the debugger

Try using condition-case-unless-debug instead of condition-case. You should be able to M-x debug-on-entry either foo or bar in this context: (defun foo () (condition-case-unless-debug nil (...
user avatar
  • 70.3k
4 votes
Accepted

How to navigate stack frames in Emacs debugger?

Simply move point in the *Backtrace* buffer to the corresponding line of the frame you're interested in. examine state of variables Then press v (debugger-toggle-locals) to show local variables in ...
user avatar
  • 8,803
3 votes
Accepted

When working on elisp where to show intermediate values?

If you are using messages to yourself while developing then: That's fine - nothing wrong with using message. You can also define a wrapper for such uses of message, which respects a global variable ...
user avatar
  • 70.3k
3 votes

How to automatically open the debugger whenever `kill-buffer` is invoked?

M-x debug-on-entry kill-buffer That opens the standard Emacs debugger whenever kill-buffer is invoked. It doesn't matter that it's a built-in (primitive, not coded in Lisp). See the Elisp manual, ...
user avatar
  • 70.3k
3 votes

What tools can help make the emacs debug output more readable?

Emacs 27: C-hig (elisp)Backtraces 18.1.7 Backtraces Debugger mode is derived from Backtrace mode, which is also used to show backtraces by Edebug and ERT. (*note Edebug::, and *note the ERT ...
user avatar
  • 43.9k
3 votes
Accepted

Stack reflection in Emacs Lisp?

Short answer : the function backtrace-frame should be what you want. How did I find this ? Well, here are the steps : invoke the elisp info manual (my favourite way is C-h r TAB RET), then search ...
user avatar
  • 3,361
2 votes
Accepted

Autocompletion of a variable name while Python debugging

I have used M-x pdb on and off for quite some time now, and while I would love to be corrected on this, unfortunately I don't think it supports tab completion. I have recently started playing with ...
user avatar
  • 4,575
2 votes
Accepted

Debugging erratic error

You're probably using an old version of AUCTeX, which had indeed the bug you're reporting: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22417 This was due to an error in the style/subfigure.el file ...
user avatar
  • 3,215
2 votes

Is it possible to edebug a lambda returned by a function?

Yes. M-x debug-on-entry RET square-two RET M-: (square-two) RET Debugger entered--entering a function: * square-two() eval((square-two) nil) eval-expression((square-two) nil nil 127) funcall-...
user avatar
  • 70.3k
2 votes
Accepted

Unable to load bookmarks list on emacs master

I had the same problem. Turned out there was a file ~/.emacs-bmk-bmenu-state.el that still contained the pesky symbol. I moved the file to a save directory, restarted Emacs, and now bookmark+ works ...
user avatar
2 votes

How to debug frequent emacs feezes

M-x toggle-debug-on-quit Hit C-g when running into the freeze ???? PROFIT Don't forget running M-x toggle-debug-on-quit again after successful debugging, it's rather annoying to have every C-g spawn ...
user avatar
  • 21.1k
2 votes

Trouble setting up dap for python in Spacemacs

With help from the spacemacs gitter room I was able to get it working. Here is the solution: Spacemacs doesn't use ptvsd anymore and uses debugpy instead, so I did this: pip uninstall ptvsd pip ...
user avatar
  • 141
2 votes
Accepted

How can I apply `(toggle-debug-on-quit)` ignore ` Debugger entered Lisp error: (minibuffer-quit)`

Try adding minibuffer-quit to debug-ignored-errors. You can do this using: (add-to-list 'debug-ignored-errors 'minibuffer-quit)
user avatar
  • 5,825
2 votes
Accepted

Emacs elisp debugger: How do i make the debugger jump to source when i press s?

s is bound to a new function that was recently added, and indeed it appears to be non–functional. I took a look at the source code, and it does attempt to pull file and line number from the stack ...
user avatar
  • 12.2k
1 vote
Accepted

--debug-init not showing enhanced information

A parse error while loading a Lisp file seems to prevent the debugger from firing. If you wonder why typex.el is loaded Add the following line at the top of typex.el: (debug) Then start Emacs ...
user avatar
1 vote

--debug-init not showing enhanced information

(What's the question?) Emacs told you that your file typex.el is syntactically incorrect - it reached the end of file (e.g., missing right parentheses) while trying to parse/read it. As it said: ...
user avatar
  • 70.3k
1 vote

--debug-init not showing enhanced information

You're not getting a run-time debugger because Emacs didn't get as far as running the code -- the error in question is End of file during parsing so it couldn't successfully read that file in the ...
user avatar
  • 43.9k
1 vote

What tools can help make the emacs debug output more readable?

It's possible to format backtraces differently using mapbacktrace with a custom function. One such example is always printing the items as list, I've contributed a patch introducing the debugger-...
user avatar
  • 21.1k
1 vote
Accepted

Tools to develop and debug ELISP code

Here is the beginnings of a list of useful techniques culled from the comments. Please add any others that you find useful by editing this answer: The elisp analog of sprinkling printfs in a program ...
1 vote

Is it possible to edebug a lambda returned by a function?

BTW, while npostavs's solution is the better option for your example, in those cases where you really do need to build the code manually with backquotes (e.g. inside defmacro), you can try: (defun ...
user avatar
  • 25.4k
1 vote
Accepted

Debugging -- debugger-mode -- how to highlight the culprit

The following answer only addresses the issue of highlighting all the C source code functions in the *Backtrace*. The unmodified stock version of debugger-make-xrefs searches the debugging buffer for ...
user avatar
  • 17.8k
1 vote

how to start daemon with `--debug-init` or equivalent debugger?

You could use a custom wrapper script as your -a argument value, but you presumably only want to use --debug-init temporarily, so... just do that. Kill your Emacs server if it's running, and then ...
user avatar
  • 43.9k
1 vote
Accepted

Debug org-mode link to PDF displayed with PDF-Tools

are you sure you are using the right link? It looks like you need: pdfview:./somefile.pdf::2 to me, at least based on https://github.com/markus1189/org-pdfview/blob/master/org-pdfview.el#L39
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible