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

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

bug#23053: 25.0.92; error in cc-mode when editing C# file with a generic


From: Alan Mackenzie
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
User-agent: Mutt/1.5.24 (2015-08-30)

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 <rgm@gnu.org>
> > 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<T>$

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





reply via email to

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