(What's the question?)
Emacs told you that your file typex.el
is syntactically incorrect - it reached the end of file (e.g., missing right parentheses) while trying to parse/read it. As it said:
investigate and remove the
cause of the error in your initialization file.
So bisect typex.el
to find the culprit. You can easily and quickly bisect it by commenting out 1/2, then 3/4, 7/8, 15/16,... of it. You can comment out a block of text by selecting it and using M-x comment-region
. You can uncomment a selection by using C-u M-x comment-region
.
Or select 1/2, then 3/4,... of the code at a time and use M-x eval-region
.
A check with 1/2, 3/4,... is a binary search - it's very fast. And it's systematic - you can't miss anything. And it requires little thought.
Another possibility is to start at the beginning of the file and use C-M-f
, to move past each sexp in turn, till you find one that isn't terminated properly (e.g. missing right parens). (But that's not a binary search.)
Personally, instead of comment-region
I use this, from misc-cmds.el
, binding it to C-x C-;
:
(defun comment-region-lines (beg end &optional arg)
"Like `comment-region' (which see), but comment or uncomment whole lines."
(interactive "*r\nP")
(when (> beg end) (setq beg (prog1 end (setq end beg))))
(let ((bol (save-excursion (goto-char beg) (line-beginning-position)))
(eol (save-excursion (goto-char end) (if (bolp)
(point)
(line-end-position)))))
(comment-region bol eol arg)))