GNU bug report logs - #23901
CC Mode 5.33 (Java/l); Wrong indentation of fallthrough switch/case with strings

Previous Next

Package: cc-mode;

Reported by: Åsmund Grammeltvedt <asmundg <at> big-oil.org>

Date: Tue, 5 Jul 2016 20:04:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


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

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: Alan Mackenzie <acm <at> muc.de>, jostein <at> kjonigsen.net
Cc: 23901 <at> debbugs.gnu.org, Vasilij Schneidermann <v.schneidermann <at> gmail.com>,
 Åsmund Grammeltvedt <asmundg <at> big-oil.org>
Subject: Re: bug#23901: CC Mode 5.33 (Java/l);
 Wrong indentation of fallthrough switch/case with strings
Date: Thu, 07 Jul 2016 15:15:12 +0200
On Thu, Jul 7, 2016, at 02:33 PM, Alan Mackenzie wrote:
> Yes, I have a good idea as to what's going wrong.  The backslash is not
> getting marked with a syntax-table text property.  The reason for this
> is, I think, that csharp-mode is trying to use
> `syntax-propertize-function' to do this.  The problem is that nothing is
> triggering a call to this function.  This is one of the reasons that the
> CC Mode core doesn't use the `syntax-propertize-function' mechanism - it
> is fairly random when and whether it gets run.  Officially it describes
> itself as a "lazy" function, as if that were a positive aspect.
> 
> I would recommend you to replace csharp-mode-syntax-propertize-function
> with a function to be called directly from after-change-functions, and
> to place this function in the csharp-mode value of
> `c-before-font-lock-functions'.  It should be clear enough from
> `c-before-font-lock-functions''s doc string, and from the existing
> functions for other modes (including Java Mode) how this should work.  A
> similar function to be called from before-change-functions could be
> placed on `c-get-state-before-change-functions', but I don't think you
> will need this.
> 
> --
> Alan Mackenzie (Nuremberg, Germany).

Thanks again for your help. It's very much appreciated.

What you say explain a few inconsistencies we've observed in the past,
and I agree with your recommendation about trying to find other
functions/hooks to cover our needs.

If this has not helped you asses whether your patch is "safe" or not,
sorry for wasting your time. :)

We'll see if we can work our way around this, and then hopefully when
your patch lands, our code should be ready for whatever changes it
brings too.

--
Jostein Kjønigsen
jostein <at> kjonigsen.net / jostein <at> secure.kjonigsen.net





This bug report was last modified 8 years and 356 days ago.

Previous Next


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