GNU bug report logs -
#63328
CC Mode 5.35.2 (Java//l); Constructor function not fontified as such
Previous Next
Reported by: Po Lu <luangruo <at> yahoo.com>
Date: Sat, 6 May 2023 11:24:01 UTC
Severity: normal
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hello, Po.
On Fri, May 12, 2023 at 10:42:21 +0800, Po Lu wrote:
> Alan Mackenzie <acm <at> muc.de> writes:
[ .... ]
> > To fix this reuired some tweaking of the low level syntactic analysis
> > code. Could I ask you, please, to test the enclosed patch (which should
> > apply cleanly to either master or the emacs-29 branch). Then please let
> > me know how the test went.
> It seems to work, but perhaps it would be safer to change that code only
> in Java mode, and not in the rest of the CC modes?
Sorry it's taken me so long. I wasn't really happy with that last patch
I sent you - it slowed Java Mode's fontification by around 15%, because
it was testing every function call for being a constructor. I've settled
on a scheme where the code checks for an argument list and the opening
brace of the statement block before fontifying as a constructor. So, on
typing a new constructor, the fontification gets delayed until the brace
gets typed. This isn't ideal, though I think it's better than the 15%
slowdown.
After consideration, I think it's better to leave the check in for all
modes, not just Java Mode. I don't think there's any valid syntax in any
CC Mode mode which could accidentally trigger the mechanism, and the
problem with the lack of fontification might well occur in some derived
mode, too.
Anyhow, I have attached a patch, so would you please test it on your real
code and let me know how well it works. Thanks!
--
Alan Mackenzie (Nuremberg, Germany).
[diff.20230526.diff (text/plain, attachment)]
This bug report was last modified 2 years and 51 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.