From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.help Subject: Re: Error: End of file during parsing Date: Tue, 27 Sep 2022 11:48:25 +0000 Message-ID: <94a8e877a7e62d9e6568@heytings.org> References: <83k05pjov1.fsf@gnu.org> <875yh96r2n.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39953"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 27 15:39:53 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odAoT-000A8g-Ji for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 27 Sep 2022 15:39:53 +0200 Original-Received: from localhost ([::1]:42400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odAoS-0000YE-Mn for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 27 Sep 2022 09:39:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od94h-0007jy-Fl for help-gnu-emacs@gnu.org; Tue, 27 Sep 2022 07:48:33 -0400 Original-Received: from heytings.org ([95.142.160.155]:58716) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od94e-0005uc-Oo for help-gnu-emacs@gnu.org; Tue, 27 Sep 2022 07:48:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1664279306; bh=Uj3rwJHWLNgyOpgGZ08ZkE4vY4p80OY0YyZFGDi0WpI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=26iFLGs8WfExwxdxlh9j/2G8tF1a5ctETSVHmOt3PFio93+gmWlpJ8aIQuFv1ESdK BUANU22AqpuR+4Si8sk4E58VLOIHQvyboyUdbFJjfi6uFlJ1IEgeemoVWdOPK2lbbS 2VfGrtaS5lyu5fvr3HLCCln2LTTs+T9GV8PZ+5c8VdSQg6i6lyO+AHCrv9KaJCP014 qHKmGWmiEsik+lkD+UU0j3lk01xHpQumTtIiPSs1NorD6thWpakzu9dz3Lmbjmf6XQ YR5G6aH1CikRnAFjYLRHC9F1kPFORrp3hWQ6cKsV3+HOrL8ZH+11R3ga5bIxbm4Fju NyP5w5Xc5nZIQ== In-Reply-To: <875yh96r2n.fsf@web.de> Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:139647 Archived-At: >> 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. > > 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. > If a file contains N open parens and N+1 closing parens, Emacs displays an error message pointing to the closing paren to which no opening paren corresponds. If a file contains N+1 open parens and N closing parens, Emacs displays an "End of file during parsing" error message. It could be a bit smarter, though: if one assumes that the file is properly indented, which is usually the case, whenever a parenthesis is read in column 1, the number of opening and closing parens must match. IOW, Emacs could point to the first such place where this is not the case. Such a hint would not be 100% accurate, but would be helpful.