GNU bug report logs - #18764
24.4; electric-indent in *scratch* signals an error

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Sat, 18 Oct 2014 15:00:03 UTC

Severity: normal

Tags: confirmed, fixed, patch

Found in versions 24.4, 26.1

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #12 received at control <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 18764 <at> debbugs.gnu.org
Subject: Re: bug#18764: 24.4; electric-indent in *scratch* signals an error
Date: Thu, 14 Jun 2018 22:34:35 -0400
tags 18764 + confirmed
found 18764 26.1
quit

Eli Zaretskii <eliz <at> 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?





This bug report was last modified 7 years and 30 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.