Created
December 15, 2012 06:45
-
-
Save roryk/4291793 to your computer and use it in GitHub Desktop.
Steps through elisp to find an error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; from http://newsgroups.derkeiler.com/Archive/Comp/comp.emacs/2005-12/msg00064.html saved for posterity | |
(defalias 'puffer-lesen 'eval-buffer-or-region-step-by-step) | |
(defun eval-buffer-or-region-step-by-step () | |
"Stepps through region if activated, otherwise takes the whole buffer | |
evaluating last-sexp and messaging point. As `eval-last-sexp' exits | |
encountering an error, you may easily pick the last point. | |
Attention: Commands changing the current-buffer as `find-file' will | |
derail the check." | |
(interactive) | |
(let ((anfang (if mark-active | |
(region-beginning) | |
(point-min))) | |
(ende (if mark-active | |
(region-end) | |
(point-max)))) | |
(goto-char anfang) | |
(while (and (not (eobp)) (< (point) ende)) | |
(progn | |
(forward-sexp 1) | |
(message "point %s" (point)) | |
(eval-last-sexp nil))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment