all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Error: End of file during parsing
@ 2022-09-27  6:20 Jean Louis
  2022-09-27  6:31 ` Emanuel Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Jean Louis @ 2022-09-27  6:20 UTC (permalink / raw)
  To: Help GNU Emacs

This condition is terrible:

Compiling file /home/data1/protected/Programming/emacs-lisp/rcd-cf.el at Tue Sep 27 09:18:19 2022
rcd-cf.el: Error: End of file during parsing

If there is end of file during parsing, then why Emacs cannot tell me
at what line number it encountered error?


Jean

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

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



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-27  6:20 Error: End of file during parsing Jean Louis
@ 2022-09-27  6:31 ` Emanuel Berg
  2022-09-27 13:28   ` Emanuel Berg
  2022-09-27  6:46 ` Eli Zaretskii
  2022-09-28  6:24 ` Christopher M. Miles
  2 siblings, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2022-09-27  6:31 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

> If there is end of file during parsing, then why Emacs
> cannot tell me at what line number it encountered error?

And the answer is even more specific: at the end of the
last line.

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-27  6:20 Error: End of file during parsing Jean Louis
  2022-09-27  6:31 ` Emanuel Berg
@ 2022-09-27  6:46 ` Eli Zaretskii
  2022-09-27 10:37   ` Michael Heerdegen
  2022-09-28  6:24 ` Christopher M. Miles
  2 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2022-09-27  6:46 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 27 Sep 2022 09:20:34 +0300
> From: Jean Louis <bugs@gnu.support>
> 
> This condition is terrible:
> 
> Compiling file /home/data1/protected/Programming/emacs-lisp/rcd-cf.el at Tue Sep 27 09:18:19 2022
> rcd-cf.el: Error: End of file during parsing
> 
> If there is end of file during parsing, then why Emacs cannot tell me
> at what line number it encountered error?

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.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-27  6:46 ` Eli Zaretskii
@ 2022-09-27 10:37   ` Michael Heerdegen
  2022-09-27 11:48     ` Gregory Heytings
  2022-09-27 11:50     ` Jean Louis
  0 siblings, 2 replies; 20+ messages in thread
From: Michael Heerdegen @ 2022-09-27 10:37 UTC (permalink / raw)
  To: help-gnu-emacs

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.

Michael.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-27 10:37   ` Michael Heerdegen
@ 2022-09-27 11:48     ` Gregory Heytings
  2022-09-27 15:06       ` Michael Heerdegen
  2022-09-27 11:50     ` Jean Louis
  1 sibling, 1 reply; 20+ messages in thread
From: Gregory Heytings @ 2022-09-27 11:48 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs


>> 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.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-27 10:37   ` Michael Heerdegen
  2022-09-27 11:48     ` Gregory Heytings
@ 2022-09-27 11:50     ` Jean Louis
  2022-09-27 15:44       ` Michael Heerdegen
  2022-09-28 11:42       ` Stefan Monnier via Users list for the GNU Emacs text editor
  1 sibling, 2 replies; 20+ messages in thread
From: Jean Louis @ 2022-09-27 11:50 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

* 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/



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-27  6:31 ` Emanuel Berg
@ 2022-09-27 13:28   ` Emanuel Berg
  0 siblings, 0 replies; 20+ messages in thread
From: Emanuel Berg @ 2022-09-27 13:28 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>> If there is end of file during parsing, then why Emacs
>> cannot tell me at what line number it encountered error?

And the answer is even more specific: at the end of the
last line.

Maybe also it should say unbalanced parens? But actually it
can also be e.g. a string that isn't closed.

E.g.,

  EOF during file persing (do you have unbalanced parens?)

Well, that would be the most likely in Lisp at least ...

But cannot this be fixed mechanically by just adding closing
parens (or the corresponding close char) until it's OK? Yes,
the balancing problem can, but it may still be incorrect
Elisp, e.g

((   (err msg "Containing expression ends prematurely")

damn

->

(()) (Symbol’s function definition is void: nil

rats

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-27 11:48     ` Gregory Heytings
@ 2022-09-27 15:06       ` Michael Heerdegen
  0 siblings, 0 replies; 20+ messages in thread
From: Michael Heerdegen @ 2022-09-27 15:06 UTC (permalink / raw)
  To: help-gnu-emacs

Gregory Heytings <gregory@heytings.org> writes:

> 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.

Would be helpful, yes.  I'm not sure about the usually intact
indentation, though: sometimes when that happened to me indentation of
other top-level expressions had been messed up.  Can happen very quickly
once such an accident occurred.

Anyway - does that mean you think the compiler should do this?

Michael.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-27 11:50     ` Jean Louis
@ 2022-09-27 15:44       ` Michael Heerdegen
  2022-09-28 11:42       ` Stefan Monnier via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 20+ messages in thread
From: Michael Heerdegen @ 2022-09-27 15:44 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis <bugs@gnu.support> writes:

> I am manually using the number guessing method:

Yes - that's what Gregory suggests: works but relies on intact
indentation of top-level expressions.

Michael.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-27  6:20 Error: End of file during parsing Jean Louis
  2022-09-27  6:31 ` Emanuel Berg
  2022-09-27  6:46 ` Eli Zaretskii
@ 2022-09-28  6:24 ` Christopher M. Miles
  2 siblings, 0 replies; 20+ messages in thread
From: Christopher M. Miles @ 2022-09-28  6:24 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 882 bytes --]


Is there Elisp helper code method to automatic this unbalanced
parenthesis searching?

Jean Louis <bugs@gnu.support> writes:

> This condition is terrible:
>
> Compiling file /home/data1/protected/Programming/emacs-lisp/rcd-cf.el at Tue Sep 27 09:18:19 2022
> rcd-cf.el: Error: End of file during parsing
>
> If there is end of file during parsing, then why Emacs cannot tell me
> at what line number it encountered error?
>
>
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> In support of Richard M. Stallman
> https://stallmansupport.org/


-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-27 11:50     ` Jean Louis
  2022-09-27 15:44       ` Michael Heerdegen
@ 2022-09-28 11:42       ` Stefan Monnier via Users list for the GNU Emacs text editor
  2022-10-03 23:35         ` Jean Louis
  1 sibling, 1 reply; 20+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2022-09-28 11:42 UTC (permalink / raw)
  To: help-gnu-emacs

>> 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:

Try `M-x check-parens RET`


        Stefan




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-09-28 11:42       ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2022-10-03 23:35         ` Jean Louis
  2022-10-04  1:41           ` Emanuel Berg
  0 siblings, 1 reply; 20+ messages in thread
From: Jean Louis @ 2022-10-03 23:35 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

* Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2022-09-28 16:36]:
> >> 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:
> 
> Try `M-x check-parens RET`

That is good, thank you.


-- 
Jean

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

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



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-10-03 23:35         ` Jean Louis
@ 2022-10-04  1:41           ` Emanuel Berg
  2022-10-10  6:08             ` Jean Louis
  0 siblings, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2022-10-04  1:41 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>>>> 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:
>> 
>> Try `M-x check-parens RET`
>
> That is good, thank you.

But nothing ever happens with that?

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-10-04  1:41           ` Emanuel Berg
@ 2022-10-10  6:08             ` Jean Louis
  2022-10-10 23:24               ` Emanuel Berg
  0 siblings, 1 reply; 20+ messages in thread
From: Jean Louis @ 2022-10-10  6:08 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg <incal@dataswamp.org> [2022-10-06 11:59]:
> >> Try `M-x check-parens RET`
> >
> > That is good, thank you.
> 
> But nothing ever happens with that?

Since then I have used it, it finds the place where parenthesis is
missing. 

It should also be involved in those error messages to at least
estimate where is the problem or provide link to quickly go to place
where parenthesis is missing.

-- 
Jean

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

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



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-10-10  6:08             ` Jean Louis
@ 2022-10-10 23:24               ` Emanuel Berg
  2022-10-11 19:00                 ` Jean Louis
  0 siblings, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2022-10-10 23:24 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>>>> Try `M-x check-parens RET`
>>>
>>> That is good, thank you.
>> 
>> But nothing ever happens with that?
>
> Since then I have used it, it finds the place where
> parenthesis is missing.

Ah, I see now, you have to remove a paren (break the code) for
it to "work" :)

> It should also be involved in those error messages

Yes, sounds reasonable, I wonder tho if you can get "out
parsed" only by parenthesis mismatch or if there are other
ways to do that?

> to at least estimate

Estimate, that's how it works?

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-10-10 23:24               ` Emanuel Berg
@ 2022-10-11 19:00                 ` Jean Louis
  2022-10-11 22:26                   ` Emanuel Berg
  0 siblings, 1 reply; 20+ messages in thread
From: Jean Louis @ 2022-10-11 19:00 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg <incal@dataswamp.org> [2022-10-11 10:24]:
> Jean Louis wrote:
> 
> >>>> Try `M-x check-parens RET`
> >>>
> >>> That is good, thank you.
> >> 
> >> But nothing ever happens with that?
> >
> > Since then I have used it, it finds the place where
> > parenthesis is missing.
> 
> Ah, I see now, you have to remove a paren (break the code) for
> it to "work" :)

check-parens finds the missing parenthesis, so it is other way around.

> > It should also be involved in those error messages
> 
> Yes, sounds reasonable, I wonder tho if you can get "out
> parsed" only by parenthesis mismatch or if there are other
> ways to do that?
> 
> > to at least estimate
> 
> Estimate, that's how it works?

When there is compiling process, then such fails without giving enough
information. Instead of failing, process could use functions in
check-parens to indicate where could be the problem in the code, and
provide link for user to click on the link and quickly invoke
check-parens

I did not know that function exist. It is not enough integrated in Emacs.

-- 
Jean

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

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



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-10-11 19:00                 ` Jean Louis
@ 2022-10-11 22:26                   ` Emanuel Berg
  2022-10-12 13:14                     ` Jean Louis
  0 siblings, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2022-10-11 22:26 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>>>>>> Try `M-x check-parens RET`
>>>>>
>>>>> That is good, thank you.
>>>> 
>>>> But nothing ever happens with that?
>>>
>>> Since then I have used it, it finds the place where
>>> parenthesis is missing.
>> 
>> Ah, I see now, you have to remove a paren (break the code)
>> for it to "work" :)
>
> check-parens finds the missing parenthesis, so it is other
> way around.

It can't, and it isn't :)

>>> It should also be involved in those error messages
>> 
>> Yes, sounds reasonable, I wonder tho if you can get "out
>> parsed" only by parenthesis mismatch or if there are other
>> ways to do that?
>> 
>>> to at least estimate
>> 
>> Estimate, that's how it works?
>
> When there is compiling process, then such fails without
> giving enough information. Instead of failing, process could
> use functions in check-parens to indicate where could be the
> problem in the code, and provide link for user to click on
> the link and quickly invoke check-parens
>
> I did not know that function exist. It is not enough
> integrated in Emacs.

Do it yourself, Jean :)

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-10-11 22:26                   ` Emanuel Berg
@ 2022-10-12 13:14                     ` Jean Louis
  2022-10-12 20:02                       ` Emanuel Berg
  0 siblings, 1 reply; 20+ messages in thread
From: Jean Louis @ 2022-10-12 13:14 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg <incal@dataswamp.org> [2022-10-12 12:17]:
> > I did not know that function exist. It is not enough
> > integrated in Emacs.
> 
> Do it yourself, Jean :)

I have balls, but not kottbullar.

-- 
Jean

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

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



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-10-12 13:14                     ` Jean Louis
@ 2022-10-12 20:02                       ` Emanuel Berg
  2022-10-15 14:28                         ` Alessandro Bertulli
  0 siblings, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2022-10-12 20:02 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>>> I did not know that function exist. It is not enough
>>> integrated in Emacs.
>> 
>> Do it yourself, Jean :)
>
> I have balls, but not kottbullar.

So did Lance Armstrong ...

But he also had "Edgar" (EPO), additional testosterone and his
own blood re-injected into him at a later stage, and maybe
that's where Jean is lacking?

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Error: End of file during parsing
  2022-10-12 20:02                       ` Emanuel Berg
@ 2022-10-15 14:28                         ` Alessandro Bertulli
  0 siblings, 0 replies; 20+ messages in thread
From: Alessandro Bertulli @ 2022-10-15 14:28 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs



>> I have balls, but not kottbullar.
>
> So did Lance Armstrong ...
>
> But he also had "Edgar" (EPO), additional testosterone and his
> own blood re-injected into him at a later stage, and maybe
> that's where Jean is lacking?

... I really can't follow your point guys.

-- 
Alessandro Bertulli



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-10-15 14:28 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27  6:20 Error: End of file during parsing Jean Louis
2022-09-27  6:31 ` Emanuel Berg
2022-09-27 13:28   ` Emanuel Berg
2022-09-27  6:46 ` Eli Zaretskii
2022-09-27 10:37   ` Michael Heerdegen
2022-09-27 11:48     ` Gregory Heytings
2022-09-27 15:06       ` Michael Heerdegen
2022-09-27 11:50     ` Jean Louis
2022-09-27 15:44       ` Michael Heerdegen
2022-09-28 11:42       ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-10-03 23:35         ` Jean Louis
2022-10-04  1:41           ` Emanuel Berg
2022-10-10  6:08             ` Jean Louis
2022-10-10 23:24               ` Emanuel Berg
2022-10-11 19:00                 ` Jean Louis
2022-10-11 22:26                   ` Emanuel Berg
2022-10-12 13:14                     ` Jean Louis
2022-10-12 20:02                       ` Emanuel Berg
2022-10-15 14:28                         ` Alessandro Bertulli
2022-09-28  6:24 ` Christopher M. Miles

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.