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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Mr Kludge <mrkludge@HIDDEN>; dated Tue, 24 Nov 2009 15:05:04 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 5033 <at> debbugs.gnu.org:


Received: (at 5033) by debbugs.gnu.org; 1 Jan 2010 17:42:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 01 12:42:26 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1NQlW6-0006h1-2L
	for submit <at> debbugs.gnu.org; Fri, 01 Jan 2010 12:42:26 -0500
Received: from pantheon-po19.its.yale.edu ([130.132.50.75])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <cyd@HIDDEN>) id 1NQlW4-0006gv-Gg
	for 5033 <at> debbugs.gnu.org; Fri, 01 Jan 2010 12:42:24 -0500
Received: from furry (dhcp128036014103.central.yale.edu [128.36.14.103])
	(authenticated bits=0)
	by pantheon-po19.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id
	o01HgKha027497
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Fri, 1 Jan 2010 12:42:20 -0500
Received: by furry (Postfix, from userid 1000)
	id 17F12C05D; Fri,  1 Jan 2010 12:42:20 -0500 (EST)
From: Chong Yidong <cyd@HIDDEN>
To: Mr Kludge <mrkludge@HIDDEN>
Subject: Re: 23.1; antlr-mode: antlr-indent-command broken for long grammars
Date: Fri, 01 Jan 2010 12:42:20 -0500
Message-ID: <87vdflrabn.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed)
X-Spam-Score: -0.6 (/)
X-Debbugs-Envelope-To: 5033
Cc: Christoph.Wedler@HIDDEN, 5033 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -0.8 (/)

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

> Solution:
> A simple solution (kludge) is to modify antlr-syntactic-context to not
> call beginning-of-defun in antlr-mode.el.  See attached patch.

I am not able to test this solution, because I don't work with antlr
files (and I doubt any of the other core Emacs maintainers do either).
I'm CC'ing the author of antlr-mode, Christoph Wedler, though we haven't
heard from him in a while.

In the meantime, could you try to explain what removing the
beginning-of-defun call in antlr-syntactic-context might break?  (Surely
that call is there for a reason.)




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#5033; Package emacs. Full text available.

Message received at submit@HIDDEN:


Received: (at submit) by emacsbugs.donarmstrong.com; 24 Nov 2009 14:59:05 +0000
From mrkludge@HIDDEN Tue Nov 24 06:59:04 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAOEx3fA021564
	for <submit@HIDDEN>; Tue, 24 Nov 2009 06:59:04 -0800
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NCwr7-0005tD-84
	for bug-gnu-emacs@HIDDEN; Tue, 24 Nov 2009 09:59:01 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1NCwr1-0005qw-M6
	for bug-gnu-emacs@HIDDEN; Tue, 24 Nov 2009 09:59:00 -0500
Received: from [199.232.76.173] (port=43315 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1NCwr0-0005qm-Lv
	for bug-gnu-emacs@HIDDEN; Tue, 24 Nov 2009 09:58:55 -0500
Received: from mail-pw0-f47.google.com ([209.85.160.47]:42876)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <mrkludge@HIDDEN>)
	id 1NCwr0-00080u-7b
	for bug-gnu-emacs@HIDDEN; Tue, 24 Nov 2009 09:58:54 -0500
Received: by pwi9 with SMTP id 9so4734852pwi.26
        for <bug-gnu-emacs@HIDDEN>; Tue, 24 Nov 2009 06:58:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:received:date:message-id:subject
         :from:to:content-type;
        bh=0jmP1lkrGHEcXHWyY55aFT4ok1eBYFf9RBm6o0dFy7Y=;
        b=Ftb84mj57prjsg12KO8Z9GshKrV3hYC4P4b3hdIydXWhIbTtEflA21QWUWaAUccCka
         fZCKkEL3vA50Ms6eb7cCpiu8sAHR1/gVj/CyzuvJAxXvwvjLakYgtv9DXWr2Xa1nqsS+
         XyBOe+MGBIjAOjUaih/24G0vQLG9wlw+1oGrY=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:date:message-id:subject:from:to:content-type;
        b=AJbzRITxH6gmMtp2xJTlWeQCXjHUYJOpL+NXv6HQMhEnw8M0g8KnkZNlqwMivpGSJH
         aYtzghutRKg5CV1xYdDzmK2Xv+Cey0K9yBKbsepiqwYM1eZhET2ik9DSVOOnduiRHCOZ
         RycJCc942wZWtMRhYTbjVrzNswLLEPw8u+n10=
MIME-Version: 1.0
Received: by 10.140.143.2 with SMTP id q2mr322211rvd.0.1259074732671; Tue, 24 
	Nov 2009 06:58:52 -0800 (PST)
Date: Tue, 24 Nov 2009 09:58:52 -0500
Message-ID: <c3c120a40911240658w48185716ka9b3b4e67ab359f7@HIDDEN>
Subject: 23.1; antlr-mode: antlr-indent-command broken for long grammars
From: Mr Kludge <mrkludge@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/mixed; boundary=000e0cd28a6c2fc26604791f2e67
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)

--000e0cd28a6c2fc26604791f2e67
Content-Type: multipart/alternative; boundary=000e0cd28a6c2fc26004791f2e65

--000e0cd28a6c2fc26004791f2e65
Content-Type: text/plain; charset=ISO-8859-1

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.

--000e0cd28a6c2fc26004791f2e65
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello,<br><br>I am running into an antlr-mode bug when indenting long gramm=
ars.<br>Specifically, when the point in the grammar is higher than<br>antlr=
-slow-cache-diff-threshold indenting a grammar rule fails in<br>calling c-w=
here-wrt-brace-construct through beginning-of-defun.<br>
<br>To trigger: <br>Write a longinsh grammar (more than 5k chars with the d=
efault setting)<br>or simply set antlr-slow-cache-diff-threshold to 0 and t=
hen try to<br>indent in a grammar rule.=A0 <br>See attached silly.g for an =
example.<br>
<br>Indentation breaks, with the following error:<br>c-where-wrt-brace-cons=
truct: c-beginning-of-decl-1 returned label<br><br>Backtrace:<br>=A0 c-wher=
e-wrt-brace-construct()<br>=A0 c-beginning-of-defun(1)<br>=A0 funcall(c-beg=
inning-of-defun 1)<br>
=A0 beginning-of-defun-raw(nil)<br>=A0 ad-Orig-beginning-of-defun(nil)<br>=
=A0 beginning-of-defun()<br>=A0 antlr-syntactic-context()<br>=A0 antlr-inde=
nt-line()<br>=A0 antlr-indent-command(nil)<br>=A0 call-interactively(antlr-=
indent-command nil nil)<br>
<br>Solution: <br>A simple solution (kludge) is to modify antlr-syntactic-c=
ontext to not call <br>beginning-of-defun in antlr-mode.el. <br>See attache=
d patch.<br><br>

--000e0cd28a6c2fc26004791f2e65--
--000e0cd28a6c2fc26604791f2e67
Content-Type: application/octet-stream; name="antlr-mode.el.patch"
Content-Disposition: attachment; filename="antlr-mode.el.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g2esf7pf0

LS0tIGxpc3AvcHJvZ21vZGVzL2FudGxyLW1vZGUuZWwub2xkCTIwMDktMTEtMjQgMDk6NTA6MjIu
MDAwMDAwMDAwIC0wNTAwCisrKyBsaXNwL3Byb2dtb2Rlcy9hbnRsci1tb2RlLmVsCTIwMDktMTEt
MjQgMDk6NTE6MjQuMDAwMDAwMDAwIC0wNTAwCkBAIC0xMTExLDkgKzExMTEsNyBAQAogCShzZXRx
IHN0YXRlIChwYXJzZS1wYXJ0aWFsLXNleHAgKGNhZHIgYW50bHItc2xvdy1jb250ZXh0LWNhY2hl
KSBvcmlnCiAJCQkJCW5pbCBuaWwKIAkJCQkJKGNkZHIgYW50bHItc2xvdy1jb250ZXh0LWNhY2hl
KSkpCi0gICAgICAoaWYgKD49IG9yaWcgYW50bHItc2xvdy1jYWNoZS1kaWZmLXRocmVzaG9sZCkK
LQkgIChiZWdpbm5pbmctb2YtZGVmdW4pCi0JKGdvdG8tY2hhciAocG9pbnQtbWluKSkpCisgICAg
KGdvdG8tY2hhciAocG9pbnQtbWluKSkKIDs7OyAgICAgIChjb25kICgoYW5kIGRpZmYgKDwgZGlm
ZiAwKSkgKGluY2YgYW50bHItc3RhdGlzdGljcy1mdWxsLW5lZykpCiA7OzsJICAgICgoYW5kIGRp
ZmYgKD49IGRpZmYgMzAwMCkpIChpbmNmIGFudGxyLXN0YXRpc3RpY3MtZnVsbC1kaWZmKSkKIDs7
OwkgICAgKHQgKGluY2YgYW50bHItc3RhdGlzdGljcy1mdWxsLW90aGVyKSkpCg==
--000e0cd28a6c2fc26604791f2e67
Content-Type: application/octet-stream; name="silly.g"
Content-Disposition: attachment; filename="silly.g"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g2esfg9g1

Ly8gYW50bHItbW9kZSBpbmRlbnRhdGlvbiBidWcKLy8gdG8gdHJpZ2dlcjoKLy8gKHNldHEgYW50
bHItc2xvdy1jYWNoZS1kaWZmLXRocmVzaG9sZCAwKQovLyBpbmRlbnQgYW55d2hlcmUgaW4gYSBy
dWxlCi8vIGVycm9ycyBbZW1hY3MgMjMuMV0gd2l0aAovLyAgYy13aGVyZS13cnQtYnJhY2UtY29u
c3RydWN0OiBjLXdoZXJlLXdydC1icmFjZS1jb25zdHJ1Y3Q6IGMtYmVnaW5uaW5nLW9mLWRlY2wt
MSByZXR1cm5lZCBsYWJlbApncmFtbWFyIHNpbGx5Owpmb28KICAgIDogKGJhcikKICAgIHwgKGJh
eikKICAgIDsK
--000e0cd28a6c2fc26604791f2e67--




Acknowledgement sent to Mr Kludge <mrkludge@HIDDEN>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#5033; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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