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

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

bug#18764: 24.4; electric-indent in *scratch* signals an error


From: Noam Postavsky
Subject: bug#18764: 24.4; electric-indent in *scratch* signals an error
Date: Thu, 14 Jun 2018 22:34:35 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

tags 18764 + confirmed
found 18764 26.1
quit

Eli Zaretskii <eliz@gnu.org> writes:

> In "emacs -Q":
>
> 1) Insert the following long sequence of left parens followed by a somewhat
> shorter sequence of right parens:

Specifically, the sequence of left parens must be more than 100, to hit
this limit:

static void
scan_sexps_forward(...)
{...
  struct level levelstart[100];
  struct level *curlevel = levelstart;
  struct level *endlevel = levelstart + 100;
  ...
        case Sopen:
          ...
          if (++curlevel == endlevel)
            curlevel--; /* error ("Nesting too deep for parser"); */

and a sequence of 100 close parens so that the curlevel stack will be
completely popped:

        case Sclose:
          ...
          if (curlevel != levelstart)
            curlevel--;

In this case parse-partial-sexp will have the right depth, but
incorrectly have nil for element 2 "character address of start of last
complete sexp terminated."

Not sure exactly what to do about this though.  Maybe parse-partial-sexp
should (optionally?) signal an error when the curlevel stack overflows?






reply via email to

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