I think I have a problem in my .emacs file and would like to place in it some function that would cause emacs to stop evaluating. I could then start a binary search to see where the problem is occurring.
I think I found it. Entering
seems to accomplish the goal
(top-level)works just fine to run a bisect of the file. I located the problem area and fixed it.
(top-level)when encountered will stop further evaluation. What the problem was does not matter, I wanted a way to simply put something in my .emacs top prevent evaluating code so I did not have to resort to commenting out or deleting text. Using
(top-level)allowed me to bisect my .emacs until I found what was causing my issue. Anyone else stumbling across this may find it useful to stop code evaluation.
;; ;; WARNING!! don't execute anything below here if using plain old emacs (if (string-equal "/usr/bin/emacs" (getenv "EMACS")) (top-level))