help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error: End of file during parsing


From: Jean Louis
Subject: Re: Error: End of file during parsing
Date: Tue, 27 Sep 2022 14:50:07 +0300
User-agent: Mutt/+ () (2022-06-11)

* Michael Heerdegen <michael_heerdegen@web.de> [2022-09-27 13:57]:
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > It did tell you: the error is at EOF.  That's where Emacs realized
> > that there is an error.  It cannot do that earlier.
> >
> > The problem is likely unbalanced parentheses somewhere.
> 
> Yes, likely.
> 
> If a file contains N open parens and N+1 closing parens, or the other
> way round, Emacs can't even know or conclude what the programmer
> actually wanted to write.  This kind of problem requires some manual
> error searching by the programmer.

I am manually using the number guessing method:

- If there are 12000 lines, I go to middle of that one, like line
  6000, somewhere from there up or to bottom, I do M-x eval-region

- Then if there is failure, I go to half between x and 6000, if it is
  in bottom region I go to line 9000 and eval region from 9000 to
  12000;

- Then if problem is between 6000 - 9000, then I go to to half of it,
  to line 7500 and again verify 50% of region;

That way I arrive fastest to the location.

Could that same algorithm be used in Emacs for function to narrow it
to lines from X to Y?

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]