# HG changeset patch # User Oleksandr Gavenko # Date 1297023819 -7200 # Node ID 11928bb0b66d4ec53f3e272aa3027ded79cbaf48 # Parent 7c884c0647b7d6e051c01d6cdc98fa8899bd975f Fix section level. Write about '-Q' and '--debug-init'. diff -r 7c884c0647b7 -r 11928bb0b66d emacs.rst --- a/emacs.rst Wed Feb 02 21:25:23 2011 +0200 +++ b/emacs.rst Sun Feb 06 22:23:39 2011 +0200 @@ -57,30 +57,44 @@ M-x debug-on-quit RET' and then just hit `C-g' next time it gets 'stuck' somewhere. -*** Check if bug in ini file. +** Check if bug in ini file not in Emacs itself. First run Emacs without loading anything: $ emacs --no-init-file --no-site-file +or more shortly (as '-Q' imply '-q', '--no-site-file', and '--no-splash' +together): + + $ emacs -Q + If bug not reproduced bug lies in ini files! -*** Binary Search. +** Debug by binary search. Select half of the file in a region, and M-x eval-region. Depending on whether that causes the error or not, split this half or the other half again, and repeat. -*** Elisp. +** Elisp debug tips. - Use a keyboard macro that moves forward one expression (sexp) and evaluates it. - Try C-x check-parens. - - Set (setq debug-on-error t). + +** Enable debug mode (also on loading). + +Set in source + + (setq debug-on-error t) -*** CLI. +or invoke Emacs like: + + $ emacs --debug-init - $ emacs --no-init-file --no-site-file --debug-init +'--debug-init' which binds 'debug-on-error' to 't' while loading the init +file, and bypasses the `condition-case' which normally catches errors in the +init file. *** Simplified Binary Search.