"T. Kurosaka - Sun Professional Services" <kuro(a)Japan.Sun.COM> writes:
I once wrote a little hack for parenthesis checking. I am not sure if
this'd be helpful to you.
------------
(defun pbug ()
"Check parenthesis bugs or similar horrors.
Even with Emacs advanced programming facilities, checking mismatching
parenthesis or missing quote (so called \"pbug\") is no less annoying than
pointer chasing in C.
This function divides the buffer into regions and tries evaluating them one
by one. It stops at the first region where it fails to evaluate because of
pbug or any other errors. It sets point and mark (and highlights if
`transient-mark-mode' is on) on the failing region and center its first
line. \"^def\" is used to define regions. You may also `eval-region'
right after pbug is done to let lisp parse pinpoint the bug.
No more \"End of file during parsing\" horrors!"
(interactive)
(let ((point (point))
(region-regex "^(def..")
defs beg end)
(goto-char (point-min))
(setq defs (loop while (search-forward-regexp region-regex nil t)
collect (point-at-bol)))
;; so it evals last definition
(nconc defs (list (point-max)))
(setq beg (point-min))
(while defs
(goto-char beg)
(setq end (pop defs))
;; to be cool, uncomment these to see pbug doing step by step
;; (message "checking pbug from %s to %s..." beg end)
;; (sit-for 1)
(when (eq (condition-case nil
(eval-region beg (1- end))
(error 'pbug-error))
'pbug-error)
(push-mark end 'nomsg 'activate)
(goto-char beg)
(recenter)
(error "a pbug found from %s to %s" beg end))
(setq beg end))
(goto-char point)
(message "no pbug found")))
(define-key emacs-lisp-mode-map [(super c) p] 'pbug)
I finally managed to build and install XEmacs 21.2.13 but
starting up xemacs gives me the "internal input stream" error
in the window. I still can edit but would like to fix
the problem. The lisp stack trace, when run with
-debug-init is as followings. What could cause this
error? Running xemacs with -q doesn't show any error
so the problem must be in my .emacs. I'd like to know
if there is any easy way to locate the offending line.
Signaling: (end-of-file "internal input stream")
load-internal("~/.emacs" t t t undecided)
load("~/.emacs" t t t)
load-user-init-file("")
load-init-file()
command-line()
normal-top-level()
-kuro