Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!m.cs.uiuc.edu!liberte From: liberte@m.cs.uiuc.edu Newsgroups: gnu.emacs Subject: Re: difficulties with lisp Message-ID: <52400018@m.cs.uiuc.edu> Date: 4 Sep 89 23:10:00 GMT References: <45058@bbn.COM> Lines: 31 Nf-ID: #R:bbn.COM:45058:m.cs.uiuc.edu:52400018:000:1445 Nf-From: m.cs.uiuc.edu!liberte Sep 4 18:10:00 1989 > /* Written 9:28 am Aug 31, 1989 by jr@bbn.com in m.cs.uiuc.edu:gnu.emacs */ > To check for paren balancing, go to the end of the file and insert a > ) . Emacs ought to complain if parens are unbalanced. Then delete > that ) and the one before it. Emacs ought to show you a matching > paren (check that it's the right one). This assume you are in some > form of lisp mode. > /* End of text from m.cs.uiuc.edu:gnu.emacs */ Emacs doesnt always look far enough for a matching paren to bounce to. Instead of relying on that, I use forward and backward sexp motion; that also moves me closer to where the error is. So if you get end of file during parsing, you are missing one or more right parens. Go to the end of file and insert a right paren, and then move back one sexp to find the start of the sexp in error. If instead, you have "extra" right parens, go to the beginning of file and insert a left paren, back up to before that paren and move forward one sexp to find the first extra right paren. These tricks will catch most paren errors. However, other kinds of errors may exist in top-level forms (e.g. bad char, or error during eval). One way to catch many of these errors is to turn on debug-on-error. Then during an eval-current-buffer, the debug window will pop up and the point for the buffer you just evaluated will be at the error. Dan LaLiberte uiucdcs!liberte liberte@cs.uiuc.edu liberte%a.cs.uiuc.edu@uiucvmd.bitnet