From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#23053: 25.0.92; error in cc-mode when editing C# file with a generic class inheritance Date: Fri, 25 Mar 2016 18:54:45 +0000 Message-ID: <20160325185445.GA5003@acm.fritz.box> References: <1458336813.1207699.553441090.44208CA4@webmail.messagingengine.com> <87wpozbd0r.fsf@acer.localhost.com> <1458372574.1341144.553674538.3D65409A@webmail.messagingengine.com> <1458376039.1351011.553705922.10F4D27F@webmail.messagingengine.com> <20160321122641.GA3641@acm.fritz.box> <1458564356.2685887.555173674.7F6E345D@webmail.messagingengine.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1458931947 28286 80.91.229.3 (25 Mar 2016 18:52:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Mar 2016 18:52:27 +0000 (UTC) Cc: Ingo Lohmar , 23053@debbugs.gnu.org To: jostein@kjonigsen.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 25 19:52:14 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ajWqD-0003TK-49 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Mar 2016 19:52:13 +0100 Original-Received: from localhost ([::1]:57533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajWqC-0003vo-H8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Mar 2016 14:52:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajWq8-0003ui-62 for bug-gnu-emacs@gnu.org; Fri, 25 Mar 2016 14:52:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajWq6-00077u-RD for bug-gnu-emacs@gnu.org; Fri, 25 Mar 2016 14:52:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajWq2-00077C-Nl; Fri, 25 Mar 2016 14:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ajWq2-0006nQ-Bm; Fri, 25 Mar 2016 14:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Fri, 25 Mar 2016 18:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23053 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 23053-submit@debbugs.gnu.org id=B23053.145893191826114 (code B ref 23053); Fri, 25 Mar 2016 18:52:02 +0000 Original-Received: (at 23053) by debbugs.gnu.org; 25 Mar 2016 18:51:58 +0000 Original-Received: from localhost ([127.0.0.1]:38129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajWpy-0006n8-Gm for submit@debbugs.gnu.org; Fri, 25 Mar 2016 14:51:58 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:15675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajWpx-0006n0-0d for 23053@debbugs.gnu.org; Fri, 25 Mar 2016 14:51:57 -0400 Original-Received: (qmail 2421 invoked by uid 3782); 25 Mar 2016 18:51:55 -0000 Original-Received: from acm.muc.de (p579E9C5D.dip0.t-ipconnect.de [87.158.156.93]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 25 Mar 2016 19:51:54 +0100 Original-Received: (qmail 13969 invoked by uid 1000); 25 Mar 2016 18:54:45 -0000 Content-Disposition: inline In-Reply-To: <1458564356.2685887.555173674.7F6E345D@webmail.messagingengine.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115494 Archived-At: Hello, Jostein. On Mon, Mar 21, 2016 at 01:45:56PM +0100, Jostein Kjønigsen wrote: > On Mon, Mar 21, 2016, at 01:26 PM, Alan Mackenzie wrote: > I've been tracking Emacs git master. > > commit 58862751bde2611d9ea99a33ecb5b0c13a7513b9 > > Author: Glenn Morris > > Date: Thu Mar 17 00:14:11 2016 -0700 > After each "git pull", I've done a "make distclean && make". > > Can we be absolutely clear here, please. Have you observed this bug in > > Java Mode yourself? > Yes. I've created a new file called test.java with the following > contents: > > package Test; > > public class A extends B$ > Pressing enter at this point will trigger a similar error, and the same > will typing { following that enter. Thanks. That was useful, and enabled me to reproduce the problem. It's a separate bug from the one Saulius reported with csharp-mode, and occurs only in the Emacs master branch. To be precise, a new variable introduced in that branch hadn't been given a proper initial value for Java (or, indeed, C#), so had the default value nil, which led to the error happening. This bug has now been fixed and committed to the master branch of the Emacs git repository. Would you please get the latest version, and confirm that the bug has been satisfactorally fixed. Thanks! > > I suspect the interface between CC Mode and csharp-mode. :-) > > My working hypothesis is that the compiled csharp-mode.elc was compiled > > on an earlier revision of the emacs-25 branch, hence didn't pick up a > > newly introduced c-lang-defvar properly, thus leaving its value at nil. > > This nil value is what triggered the error in > > c-forward-<>-arglist-recur. > That's a good theory and I decided to completely wiping csharp-mode and > reevaluating it inside Emacs to verify that stale data is not the cause > of the errors. > I'm still getting "wrong argument: stringp, nil" everywhere when > pressing enter interactively inside Emacs csharp-mode buffers. I hope that's now fixed. > I therefore tried to look into the build-system to see what it reports. > Byte-compiling csharp-mode triggers a warning which so far haven't been > an issue for csharp-mode: > > $ make csharp-mode.elc > > ... > > csharp-mode.el:1772:17:Warning: looking-back called with 1 argument, but > > requires 2-3 Yes. Somebody in the Emacs team has decided that the second argument, previously optional, is now mandatory. I wish people wouldn't do things like that. The only thing sensible here is to add a second argument, nil, to each call to looking-back. Can I ask you, as maintainer of csharp-mode: (i) To insert "(eval-when-compile (require 'cc-langs))" near the top of csharp-mode.el. (ii) To add something to the manual telling users to compile csharp-mode.el with the Emacs it's going to be run with. (i) should help ensure csharp-mode gets properly compiled. (ii) should also help ensure csharp-mode is properly compiled. :-) > Trying to run a "make test" of csharp-mode against git master, most of > the tests breaks: > > Test indentation-rules-should-be-as-specified-in-test-doc backtrace: > > c-forward-label() > > c-guess-basic-syntax() > > c-indent-region(1 1390) > > indent-region(1 1390) > > (let* ((buffer (find-file "test-files/indentation-tests.cs")) (orig- > > (lambda nil (let* ((buffer (find-file "test-files/indentation-tests. > > ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc > > ert-run-test([cl-struct-ert-test indentation-rules-should-be-as-spec > > ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test a > > ert-run-tests(t #[385 "\306\307\"\203G\211\211G\310U\203\211@\20 > > ert-run-tests-batch(nil) > > ert-run-tests-batch-and-exit() > > command-line-1(("-L" "." "-l" "csharp-mode-tests.el" "-f" "ert-run-t > > command-line() > > normal-top-level() > > Test indentation-rules-should-be-as-specified-in-test-doc condition: > > (wrong-type-argument stringp nil) > > FAILED 15/15 indentation-rules-should-be-as-specified-in-test-doc Please let me know if this still happens. > I haven't looked into Saulius's C# file to reproduce this issue, so I > can't say if that is why you cannot reproduce or not. > Are the changes between between Emacs-25 and master so significant that > they could the big differences between our observations? I find that > hard to believe. Yes, that is indeed the case. Two variables in master weren't properly initialised for Java, Pike, ...., and derived modes. Sorry about that! > -- > Jostein Kjønigsen > jostein@kjonigsen.net / jostein@secure.kjonigsen.net -- Alan Mackenzie (Nuremberg, Germany).