GNU bug report logs - #5033
23.1; antlr-mode: antlr-indent-command broken for long grammars

Previous Next

Package: emacs;

Reported by: Mr Kludge <mrkludge <at> gmail.com>

Date: Tue, 24 Nov 2009 15:05:04 UTC

Severity: normal

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mr Kludge <mrkludge <at> gmail.com>
Subject: bug#5033: closed (Re: bug#5033: 23.1; antlr-mode: antlr-indent-command
 broken for long grammars)
Date: Tue, 01 Oct 2019 01:18:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#5033: 23.1; antlr-mode: antlr-indent-command broken for long grammars

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 5033 <at> debbugs.gnu.org.

-- 
5033: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5033
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Kangas <stefan <at> marxist.se>
To: Andrew Hyatt <ahyatt <at> gmail.com>
Cc: Chong Yidong <cyd <at> stupidchicken.com>, 5033-done <at> debbugs.gnu.org
Subject: Re: bug#5033: 23.1;
 antlr-mode: antlr-indent-command broken for long grammars
Date: Tue, 1 Oct 2019 03:16:47 +0200
Andrew Hyatt <ahyatt <at> gmail.com> writes:

> I cannot reproduce this on Emacs 25.  I loaded the provided silly.g, set
> the antrl-slow-cache-diff-threshold to 0, and indented each line without
> any issues, at many different points on the line.
>
> Someone can let me know if they can still reproduce this, otherwise I'll
> close this out.

It was never closed at the time, 3 years ago, so I'm closing this now.

If anyone can still reproduce this, please reopen the bug report.

Best regards,
Stefan Kangas

[Message part 3 (message/rfc822, inline)]
From: Mr Kludge <mrkludge <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1; antlr-mode: antlr-indent-command broken for long grammars
Date: Tue, 24 Nov 2009 09:58:52 -0500
[Message part 4 (text/plain, inline)]
Hello,

I am running into an antlr-mode bug when indenting long grammars.
Specifically, when the point in the grammar is higher than
antlr-slow-cache-diff-threshold indenting a grammar rule fails in
calling c-where-wrt-brace-construct through beginning-of-defun.

To trigger:
Write a longinsh grammar (more than 5k chars with the default setting)
or simply set antlr-slow-cache-diff-threshold to 0 and then try to
indent in a grammar rule.
See attached silly.g for an example.

Indentation breaks, with the following error:
c-where-wrt-brace-construct: c-beginning-of-decl-1 returned label

Backtrace:
  c-where-wrt-brace-construct()
  c-beginning-of-defun(1)
  funcall(c-beginning-of-defun 1)
  beginning-of-defun-raw(nil)
  ad-Orig-beginning-of-defun(nil)
  beginning-of-defun()
  antlr-syntactic-context()
  antlr-indent-line()
  antlr-indent-command(nil)
  call-interactively(antlr-indent-command nil nil)

Solution:
A simple solution (kludge) is to modify antlr-syntactic-context to not call
beginning-of-defun in antlr-mode.el.
See attached patch.
[Message part 5 (text/html, inline)]
[antlr-mode.el.patch (application/octet-stream, attachment)]
[silly.g (application/octet-stream, attachment)]

This bug report was last modified 5 years and 237 days ago.

Previous Next


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