Automated merge with file:///srv/hg/admin-doc
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 22 Jan 2009 21:47:54 +0200
changeset 23 c11633a0ae73
parent 20 ccbb0c9257bb (diff)
parent 22 6471aee1e8a1 (current diff)
child 24 ce71045ae5b3
Automated merge with file:///srv/hg/admin-doc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emacs.rst	Thu Jan 22 21:47:54 2009 +0200
@@ -0,0 +1,37 @@
+-*- mode: outline -*-
+
+* How debug?
+
+When your InitFile has a bug, or when you load external files that cause
+errors, the bug is often hard to find, because the Emacs Lisp reader does not
+know about line numbers and files – it just knows an error happened, and
+that’s it.
+
+You have several options:
+
+  * 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.
+
+  * Simplified Binary Search – add (error “No error until here”) in the
+  middle of your file. If you get the error “No error until here” when
+  reloading the file, move the expression towards the back of the file,
+  otherwise towards the front of the file.
+
+  * Use a keyboard macro that moves forward one expression (sexp) and
+  evaluates it.
+
+  * Try the command line switch --debug-init.
+
+  * Should n’t (setq debug-on-error t) help?
+
+ * Try check-parens.
+
+* Using edebug.
+
+The main entry point is ‘M-x edebug-defun’ (also on ‘C-u C-M-x’). Use it
+instead of `C-x C-e’ or ‘C-M-x’ to evaluate a ‘defun’ and instrument it for
+debugging.
+
+You can disable edebug on a function by evaluating the function again using
+‘C-M-x’.