unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Is there a reason why iinvalid-read-syntax doesn't give me the location of the error?
@ 2019-08-07 13:40 ndame
  2019-08-07 13:59 ` Michael Heerdegen
  0 siblings, 1 reply; 5+ messages in thread
From: ndame @ 2019-08-07 13:40 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Sometimes I encounter huge generated elisp list data which has a
problem somewhere. So when I evaluate it I get the error:

   Lisp error: (invalid-read-syntax ". in wrong context")


I wonder why the error message doesn't give me the location of the
error like scan-error. I have to bisect the file to find the bad part.

Doesn't invalid-read-syntax have the location where it encountered the
error? If it does then why doesn't it print it like scan-error?
 


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

* Re: Is there a reason why iinvalid-read-syntax doesn't give me the location of the error?
  2019-08-07 13:40 Is there a reason why iinvalid-read-syntax doesn't give me the location of the error? ndame
@ 2019-08-07 13:59 ` Michael Heerdegen
  2019-08-07 14:17   ` Noam Postavsky
  2019-08-07 14:34   ` ndame
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Heerdegen @ 2019-08-07 13:59 UTC (permalink / raw)
  To: ndame; +Cc: help-gnu-emacs@gnu.org

ndame <emacsuser@freemail.hu> writes:

> I wonder why the error message doesn't give me the location of the
> error like scan-error. I have to bisect the file to find the bad part.

I don't have the answer to your question, only a workaround: turn on
debug-on-error and eval.  When the debugger pops up, switch to the
source code buffer.  Point will be likely near the problem (AFAICT
`read' just leaves point where it gave up).

Michael.



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

* Re: Is there a reason why iinvalid-read-syntax doesn't give me the location of the error?
  2019-08-07 13:59 ` Michael Heerdegen
@ 2019-08-07 14:17   ` Noam Postavsky
  2019-08-07 14:34   ` ndame
  1 sibling, 0 replies; 5+ messages in thread
From: Noam Postavsky @ 2019-08-07 14:17 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs@gnu.org, ndame

On Wed, 7 Aug 2019 at 09:59, Michael Heerdegen <michael_heerdegen@web.de> wrote:
>
> ndame <emacsuser@freemail.hu> writes:
>
> > I wonder why the error message doesn't give me the location of the
> > error like scan-error. I have to bisect the file to find the bad part.
>
> I don't have the answer to your question, only a workaround: turn on
> debug-on-error and eval.  When the debugger pops up, switch to the
> source code buffer.  Point will be likely near the problem (AFAICT
> `read' just leaves point where it gave up).

The backtrace itself should mention the exact location where the last
`read' was. In Emacs 27, you can click on it to jump there.

See Bug#6435.



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

* Re: Is there a reason why iinvalid-read-syntax doesn't give me the location of the error?
  2019-08-07 13:59 ` Michael Heerdegen
  2019-08-07 14:17   ` Noam Postavsky
@ 2019-08-07 14:34   ` ndame
  2019-08-08  8:10     ` Stefan Monnier
  1 sibling, 1 reply; 5+ messages in thread
From: ndame @ 2019-08-07 14:34 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs@gnu.org

> I don't have the answer to your question, only a workaround: turn on
> debug-on-error and eval.  When the debugger pops up, switch to the
> source code buffer.  Point will be likely near the problem (AFAICT
> `read' just leaves point where it gave up).

Yes, thank you. 

I was so baffled by invalid-read-syntax not printing the position like
scan-error (I tried it with 26.2) that it did not occur to me to try
it with debug enabled.


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

* Re: Is there a reason why iinvalid-read-syntax doesn't give me the location of the error?
  2019-08-07 14:34   ` ndame
@ 2019-08-08  8:10     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2019-08-08  8:10 UTC (permalink / raw)
  To: help-gnu-emacs

> I was so baffled by invalid-read-syntax not printing the position like
> scan-error (I tried it with 26.2)

I recommend filing a bug-report for that,


        Stefan




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

end of thread, other threads:[~2019-08-08  8:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-07 13:40 Is there a reason why iinvalid-read-syntax doesn't give me the location of the error? ndame
2019-08-07 13:59 ` Michael Heerdegen
2019-08-07 14:17   ` Noam Postavsky
2019-08-07 14:34   ` ndame
2019-08-08  8:10     ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).