A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.gnu.org/software/emacs/manual/html_node/elisp/Debugging-Redisplay.html below:

Debugging Redisplay (GNU Emacs Lisp Reference Manual)

Next: Debugging Infinite Loops, Previous: Entering the Debugger on an Error, Up: The Lisp Debugger   [Contents][Index]

19.1.2 Debugging Redisplay Errors

When an error occurs in Lisp code which redisplay has invoked, Emacs’s usual debugging mechanisms are unusable, for technical reasons. This subsection describes how to get a backtrace from such an error, which should be helpful in debugging it.

These directions apply to Lisp forms used, for example, in :eval mode line constructs (see The Data Structure of the Mode Line), and in all hooks invoked from redisplay, such as:

Note that if you have had an error in a hook function called from redisplay, the error handling might have removed this function from the hook. You will thus need to reinitialize that hook somehow, perhaps with add-hook, to be able to replay the bug.

To generate a backtrace in these circumstances, set the variable backtrace-on-redisplay-error to non-nil. When the error occurs, Emacs will dump the backtrace to the buffer *Redisplay-trace*, but won’t automatically display it in a window. This is to avoid needlessly corrupting the redisplay you are debugging. You will thus need to display the buffer yourself, with a command such as switch-to-buffer-other-frame C-x 5 b.

Variable: backtrace-on-redisplay-error

Set this variable to non-nil to enable the generation of a backtrace when an error occurs in any Lisp called from redisplay.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4