From unknown Fri Aug 15 20:52:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63328: CC Mode 5.35.2 (Java//l); Constructor function not fontified as such Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-cc-mode@gnu.org Resent-Date: Sat, 06 May 2023 11:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63328 X-GNU-PR-Package: cc-mode X-GNU-PR-Keywords: To: 63328@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16833722328873 (code B ref -1); Sat, 06 May 2023 11:24:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 May 2023 11:23:52 +0000 Received: from localhost ([127.0.0.1]:59565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvG12-0002J3-7Q for submit@debbugs.gnu.org; Sat, 06 May 2023 07:23:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:35626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvG0z-0002Iu-DT for submit@debbugs.gnu.org; Sat, 06 May 2023 07:23:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvG0z-00057n-4J for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 07:23:49 -0400 Received: from sonic309-20.consmr.mail.ne1.yahoo.com ([66.163.184.146]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pvG0m-0004VS-Fu for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 07:23:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683372214; bh=lXMdDQVSdMZEYSUS5LsZ8Ut5fUSDOWwAcBIjmFrsBP8=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=kiZfuLwvSv5v/c12LUodwxSIZ4FtDo5KALMOEmcJOqrrdop7+5D0XMQwv8MNiTGigPL26QMkwQIxw4nAsj9NHMmwlV+dlT054+EDcRXbDdTqVSZluo2IRbT6RvbaEC99WB0itRt3jLWu1GaM55ypoAKwg5tfPfawG4pTd2pQv/liYP+s6rDxXBmcY6BC3Ju/OH32FmYLspckWANBJYptUG317+0txCmSXzeLWz1DmZJljAu15szxhi+sNO7X9+GT9zkKd9KDHDXfJgkio4F7dBFN/Cm+TGhPav2xJ7sErOjXk635vrk0Mt4JcP5DUibI0vZNYM+opFJleEsQDftqzA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683372214; bh=lfTIDveuW5WF2O296LHSpkNN8iGqcGn/UVPRPVUa72v=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=hg2oC2NAW4QZ6/CCwYIBQFNBd4rY27KzaVBnXEoHj3COxE1FmeOHW9PUpiNhFvSqGnXgt0CDzGQhaw7rvDidjGYv9+sYmB4iJDOqEEU9SG8T+bQV+iHVto0NwR2omJdAl7OMhRFyS/lugaQmOZai6MVhSrIsn3fBqRXeJYmJLiFRI4urNSCN93kiWlSBeDM+U8hi8h4KJijL79tlkRKF3Y3Vzl5Rndbz4I03l4oRLVlpFZg+a1/Ay86a0we9lX+pYlvrkZx9mn+4A5YW5/qPwms4prBjAoxujZPpLB6vzAZVhcJux2t2s0mYcQsmoPevQmPjEtFPlOc0N0mthLrYRw== X-YMail-OSG: P0erLnUVM1lZFUnFuZ4_pBnzU.g4hbww5l35uUXaug0EVtpbnw_iCtBXzl97kYA xqouXNVyyJhGkMMS0cFS7MGYGAXzut3w78jfwI0kosDjxvGNY5F4gjSPIH0QG_bjxtkX_Jf.eDAf Vjf8sbGvEuhY43KrjD28fx6gngmUneNY6seNitWxW0Y4t8K6Y9ZDvVrEImeHTbV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a1b9-d468-489b-9f77-c2dcef10716c Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Sat, 6 May 2023 11:23:34 +0000 Received: by hermes--production-sg3-6d6fb994f6-7thcs (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 52c9b5cdc8b5e6e7c9b8c79793d03799; Sat, 06 May 2023 11:23:32 +0000 (UTC) From: Po Lu Date: Sat, 06 May 2023 19:23:27 +0800 Message-ID: <87bkixk8k0.fsf@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable References: <87bkixk8k0.fsf.ref@yahoo.com> X-Mailer: WebService/1.1.21417 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 4648 Received-SPF: pass client-ip=66.163.184.146; envelope-from=luangruo@yahoo.com; helo=sonic309-20.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.6 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.6 (-) Package: cc-mode In the following code: public EmacsInputConnection (EmacsView view) { super (view, true); `EmacsInputConnection', a constructor function, is not fontified as such. Its parameter list is not fontified either. Emacs : GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu) of 2023-04-29 Package: CC Mode 5.35.2 (Java//l) Buffer Style: GNU c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-st= ring-delim gen-comment-delim syntax-properties category-properties 1-bit) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq c-basic-offset 2 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . = 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "" c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+") (= other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode = . gtkdoc) (c++-mode . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((substatement-open before after) (arglist-cont-no= nempty)) c-hanging-colons-alist nil c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) c-backslash-column 48 c-backslash-max-column 72 c-special-indent-hook '(t c-gnu-impose-minimum) c-label-minimum-indentation 1 c-offsets-alist '((inexpr-class . +) (inexpr-statement . +) (lambda-intro-cont . +) (inlambda . 0) (template-args-cont c-lineup-template-args +) (incomposition . +) (inmodule . +) (innamespace . +) (inextern-lang . +) (composition-close . 0) (module-close . 0) (namespace-close . 0) (extern-lang-close . 0) (composition-open . 0) (module-open . 0) (namespace-open . 0) (extern-lang-open . 0) (objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-= method-call +) (objc-method-args-cont . c-lineup-ObjC-method-args) (objc-method-intro . [0]) (friend . 0) (cpp-define-intro c-lineup-cpp-define +) (cpp-macro-cont . +) (cpp-macro . [0]) (inclass . +) (stream-op . c-lineup-streamop) (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist) (arglist-cont c-lineup-gcc-asm-reg 0) (comment-intro c-lineup-knr-region-comment c-lineup-comment) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (case-label . 0) (substatement . +) (statement-case-intro . +) (statement . 0) (brace-entry-open . 0) (brace-list-entry . 0) (brace-list-close . 0) (brace-list-open . +) (block-close . 0) (block-open . 0) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (annotation-var-cont . +) (annotation-top-cont . 0) (topmost-intro . 0) (knr-argdecl . 0) (inline-close . 0) (class-close . 0) (class-open . 0) (defun-block-intro . +) (defun-close . 0) (defun-open . 0) (c . c-lineup-C-comments) (string . c-lineup-dont-change) (func-decl-cont . +) (inher-cont . c-lineup-multi-inher) (access-label . -) (brace-list-intro first c-lineup-2nd-brace-entry-in-arglist c-lineup-c= lass-decl-init-+ +) (arglist-close . c-lineup-arglist) (arglist-intro . c-lineup-arglist-intro-after-paren) (statement-cont . +) (statement-case-open . +) (label . 0) (substatement-label . 0) (substatement-open . +) (knr-argdecl-intro . 5) (statement-block-intro . +) (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEF= UN-intro-cont) (inline-open . 0) ) c-buffer-is-cc-mode 'java-mode c-tab-always-indent t c-syntactic-indentation t c-syntactic-indentation-in-macros t c-ignore-auto-fill '(string cpp code) c-auto-align-backslashes t c-backspace-function 'backward-delete-char-untabify c-delete-function 'delete-char c-electric-pound-behavior nil c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu")) c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 8 comment-column 32 parse-sexp-ignore-comments t parse-sexp-lookup-properties t auto-fill-function nil comment-multi-line t comment-start-skip "\\(?://+\\|/\\*+\\)\\s *" fill-prefix nil fill-column 70 paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*\\(@[a-zA-Z]+\\>\\|$\\)\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-=E2=80=93!|#%= ;>*=C2=B7=E2=80=A2=E2=80=A3=E2=81=83=E2=97=A6]+[ ]*\\)*\\)" ) From unknown Fri Aug 15 20:52:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63328: CC Mode 5.35.2 (Java//l); Constructor function not fontified as such Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-cc-mode@gnu.org Resent-Date: Thu, 11 May 2023 17:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63328 X-GNU-PR-Package: cc-mode X-GNU-PR-Keywords: To: Po Lu Cc: 63328@debbugs.gnu.org Received: via spool by 63328-submit@debbugs.gnu.org id=B63328.168382694431206 (code B ref 63328); Thu, 11 May 2023 17:43:01 +0000 Received: (at 63328) by debbugs.gnu.org; 11 May 2023 17:42:24 +0000 Received: from localhost ([127.0.0.1]:53295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxAJ6-00087E-CF for submit@debbugs.gnu.org; Thu, 11 May 2023 13:42:24 -0400 Received: from mx3.muc.de ([193.149.48.5]:55815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxAJ3-000870-J1 for 63328@debbugs.gnu.org; Thu, 11 May 2023 13:42:22 -0400 Received: (qmail 57863 invoked by uid 3782); 11 May 2023 19:42:14 +0200 Received: from acm.muc.de (p4fe157de.dip0.t-ipconnect.de [79.225.87.222]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 11 May 2023 19:42:13 +0200 Received: (qmail 19392 invoked by uid 1000); 11 May 2023 17:42:12 -0000 Date: Thu, 11 May 2023 17:42:12 +0000 Message-ID: References: <87bkixk8k0.fsf.ref@yahoo.com> <87bkixk8k0.fsf@yahoo.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="iG0gzfrL/zQsyWTw" Content-Disposition: inline In-Reply-To: <87bkixk8k0.fsf@yahoo.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --iG0gzfrL/zQsyWTw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, Po. Thanks for yet another bug report! On Sat, May 06, 2023 at 19:23:27 +0800, Po Lu via CC-Mode-help wrote: > Package: cc-mode > In the following code: > public > EmacsInputConnection (EmacsView view) > { > super (view, true); > `EmacsInputConnection', a constructor function, is not fontified as > such. Its parameter list is not fontified either. I actually put a class around these lines for testing, as follows: class EmacsInputConnection { public EmacsInputConnection (EmacsView view) { super (view, true); } } .. I don't think Java classes can have constructors anywhere but inside the class of the same name (please correct me if I'm wrong, here). 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. Thanks! > Emacs : GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu) > of 2023-04-29 > Package: CC Mode 5.35.2 (Java//l) > Buffer Style: GNU > c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties category-properties 1-bit) [ .... ] -- Alan Mackenzie (Nuremberg, Germany). --iG0gzfrL/zQsyWTw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diff.20230511.diff" diff -r 3d663572d4bf cc-engine.el --- a/cc-engine.el Wed May 03 09:45:37 2023 +0000 +++ b/cc-engine.el Thu May 11 16:11:36 2023 +0000 @@ -10880,9 +10880,16 @@ (not (memq context '(arglist decl)))) (or (and new-style-auto (looking-at c-auto-ops-re)) - (and (or maybe-typeless backup-maybe-typeless) - (not got-prefix) - at-type))) + (and (not got-prefix) + at-type + (or maybe-typeless backup-maybe-typeless + ;; Do we have a (typeless) constructor? + (save-excursion + (goto-char type-start) + (and + (looking-at c-identifier-key) + (c-directly-in-class-called-p + (match-string 0)))))))) ;; Have found no identifier but `c-typeless-decl-kwds' has ;; matched so we know we're inside a declaration. The ;; preceding type must be the identifier instead. @@ -12561,7 +12568,8 @@ (looking-at c-class-key)) (goto-char (match-end 1)) (c-forward-syntactic-ws) - (looking-at name)))))) + (and (looking-at c-identifier-key) + (string= (match-string 0) name))))))) (defun c-search-uplist-for-classkey (paren-state) ;; Check if the closest containing paren sexp is a declaration --iG0gzfrL/zQsyWTw-- From unknown Fri Aug 15 20:52:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63328: CC Mode 5.35.2 (Java//l); Constructor function not fontified as such Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-cc-mode@gnu.org Resent-Date: Fri, 12 May 2023 02:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63328 X-GNU-PR-Package: cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 63328@debbugs.gnu.org Received: via spool by 63328-submit@debbugs.gnu.org id=B63328.16838593592831 (code B ref 63328); Fri, 12 May 2023 02:43:02 +0000 Received: (at 63328) by debbugs.gnu.org; 12 May 2023 02:42:39 +0000 Received: from localhost ([127.0.0.1]:53694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxIjv-0000jb-71 for submit@debbugs.gnu.org; Thu, 11 May 2023 22:42:39 -0400 Received: from sonic301-30.consmr.mail.ne1.yahoo.com ([66.163.184.199]:44305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxIjs-0000jM-PC for 63328@debbugs.gnu.org; Thu, 11 May 2023 22:42:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683859350; bh=bfwFl2p5TvVJcBx5g3sKrKZKm8uiTsxpM69S82s/PmQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=GIsp6Z0UGk7EpO6IjNRbfIRv/F0vscVah+AXK7HQQGlUNQqdgDAa0YQQezPrsNcHmswFGqxwsHn77e/Z1CsAVN87nWiUzydVyejsvFyqGkExZqX/o9ArLFD4pb3Qp+1ORbGZNDeEQq3DHUTAvdlPQwVvjp/Z+mh/daaQkI7kP2Jv9Hx1aS3EFKzg+nCOy3D2GpukOOtpnjsEo5HCF35fO/yui+2kly6RabcZHHrVH1iG3Wtild9nULjoN9gbN74hXkoVlyITx+X0Ul72vQK5YXJXsP+n07qSAEiIiVgmg4IyuVMlip7brndgxHdBy8LDtwrXPWsn6bs34CcJYp4PNw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683859350; bh=LDS8GcEq1TxaVOH0l282MvGCjpa/QdriDdwrFg7lrOc=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=RpvrmdCIB6yoTZsr8xMMtEIAy4KltPzXKnOJX58FlOmvVT5nCPjiS3tEmI0SQ9VgrLEQwS7/PVHUFY6ZPM4A4sYHPBGmlsBJKawHJb2MjLWYxZEe4imCTgdw+MfOxziihWtUDsOXlMcJ4JTYHP9/ZY9muvWAqPD2ri+PVuWPUVitzRX+xN2pjnUVkeLvikqm1pMWYJabzI+o/efBna6fFxe5wceOqesu7AbNHk/vFbpQ1mEjLjD8ZZDnWJipqd4/89L4KAoEf1liQIBJPr9h08jNsUJLWzNJyN6oVN5lFYj13kwqMXrpBjUgOewuC3feLDw6AB7fpRlxKYMjKIBejg== X-YMail-OSG: j4fat8sVM1lHt7wSJ5m6heEREh9slb7y52q0.RZOWtEnmSb7.J0c3NMYgYpXDw9 U91OhENPOY78nW.K3peU88kxx99Cv8k0TUe.lo9__MwkrpOnwdTvkvD7Y7yVPVsYPGchf0alIxZ7 fWyCmoZek6bx.47FhGztZD3YMgybaxLANEUPQawRkhOWSyEEOssZxlkJ.NWUM7pcHzbv2IWMUt0J .ldTJBNungANlWnaNqbvailAfNWoGZ8LHBAZTvsLIou2DkjSeYXg30Ag77.EnpeAEc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ahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Fri, 12 May 2023 02:42:30 +0000 Received: by hermes--production-sg3-748897c457-v5xjh (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f6b9f2500b9fc4656c9541407efffeb7; Fri, 12 May 2023 02:42:25 +0000 (UTC) From: Po Lu In-Reply-To: (Alan Mackenzie's message of "Thu, 11 May 2023 17:42:12 +0000") References: <87bkixk8k0.fsf.ref@yahoo.com> <87bkixk8k0.fsf@yahoo.com> Date: Fri, 12 May 2023 10:42:21 +0800 Message-ID: <871qjmb78y.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.21471 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 840 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > I actually put a class around these lines for testing, as follows: > > class EmacsInputConnection { > public > EmacsInputConnection (EmacsView view) > { > super (view, true); > } > } > > .. I don't think Java classes can have constructors anywhere but inside > the class of the same name (please correct me if I'm wrong, here). Sorry for that confusion. > 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. > > Thanks! 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? From unknown Fri Aug 15 20:52:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63328: CC Mode 5.35.2 (Java//l); Constructor function not fontified as such Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-cc-mode@gnu.org Resent-Date: Fri, 26 May 2023 10:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63328 X-GNU-PR-Package: cc-mode X-GNU-PR-Keywords: To: Po Lu Cc: 63328@debbugs.gnu.org Received: via spool by 63328-submit@debbugs.gnu.org id=B63328.168509605520855 (code B ref 63328); Fri, 26 May 2023 10:15:02 +0000 Received: (at 63328) by debbugs.gnu.org; 26 May 2023 10:14:15 +0000 Received: from localhost ([127.0.0.1]:48906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2USc-0005QG-Lg for submit@debbugs.gnu.org; Fri, 26 May 2023 06:14:15 -0400 Received: from mx3.muc.de ([193.149.48.5]:42361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2USa-0005Pt-LL for 63328@debbugs.gnu.org; Fri, 26 May 2023 06:14:13 -0400 Received: (qmail 20816 invoked by uid 3782); 26 May 2023 12:14:05 +0200 Received: from acm.muc.de (p4fe15872.dip0.t-ipconnect.de [79.225.88.114]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 26 May 2023 12:14:05 +0200 Received: (qmail 19774 invoked by uid 1000); 26 May 2023 10:14:04 -0000 Date: Fri, 26 May 2023 10:14:04 +0000 Message-ID: References: <87bkixk8k0.fsf.ref@yahoo.com> <87bkixk8k0.fsf@yahoo.com> <871qjmb78y.fsf@yahoo.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="RK3ZlMxBPR7O8tJP" Content-Disposition: inline In-Reply-To: <871qjmb78y.fsf@yahoo.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --RK3ZlMxBPR7O8tJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, Po. On Fri, May 12, 2023 at 10:42:21 +0800, Po Lu wrote: > Alan Mackenzie 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). --RK3ZlMxBPR7O8tJP Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diff.20230526.diff" diff -r 3d663572d4bf cc-engine.el --- a/cc-engine.el Wed May 03 09:45:37 2023 +0000 +++ b/cc-engine.el Fri May 26 09:54:22 2023 +0000 @@ -10646,6 +10646,10 @@ got-parens ;; True if there is a terminated argument list. got-arglist + ;; True when `got-arglist' and the token after the end of the + ;; arglist is an opening brace. Used only when we have a + ;; suspected typeless function name. + got-stmt-block ;; True if there is an identifier in the declarator. got-identifier ;; True if we find a number where an identifier was expected. @@ -10798,6 +10802,10 @@ (setq got-arglist t)) t) (when (cond + ((and (eq (char-after) ?\() + (c-safe (c-forward-sexp 1) t)) + (when (eq (char-before) ?\)) + (setq got-arglist t))) ((save-match-data (looking-at "\\s(")) (c-safe (c-forward-sexp 1) t)) ((save-match-data @@ -10812,6 +10820,11 @@ (setq got-suffix-after-parens (match-beginning 0))) (setq got-suffix t)))) + ((and got-arglist + (eq (char-after) ?{)) + (setq got-stmt-block t) + nil) + (t ;; No suffix matched. We might have matched the ;; identifier as a type and the open paren of a @@ -10880,9 +10893,17 @@ (not (memq context '(arglist decl)))) (or (and new-style-auto (looking-at c-auto-ops-re)) - (and (or maybe-typeless backup-maybe-typeless) - (not got-prefix) - at-type))) + (and (not got-prefix) + at-type + (or maybe-typeless backup-maybe-typeless + ;; Do we have a (typeless) constructor? + (and got-stmt-block + (save-excursion + (goto-char type-start) + (and + (looking-at c-identifier-key) + (c-directly-in-class-called-p + (match-string 0))))))))) ;; Have found no identifier but `c-typeless-decl-kwds' has ;; matched so we know we're inside a declaration. The ;; preceding type must be the identifier instead. @@ -12561,7 +12582,8 @@ (looking-at c-class-key)) (goto-char (match-end 1)) (c-forward-syntactic-ws) - (looking-at name)))))) + (and (looking-at c-identifier-key) + (string= (match-string 0) name))))))) (defun c-search-uplist-for-classkey (paren-state) ;; Check if the closest containing paren sexp is a declaration --RK3ZlMxBPR7O8tJP-- From unknown Fri Aug 15 20:52:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63328: CC Mode 5.35.2 (Java//l); Constructor function not fontified as such Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-cc-mode@gnu.org Resent-Date: Fri, 26 May 2023 11:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63328 X-GNU-PR-Package: cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 63328@debbugs.gnu.org Received: via spool by 63328-submit@debbugs.gnu.org id=B63328.168510195212781 (code B ref 63328); Fri, 26 May 2023 11:53:01 +0000 Received: (at 63328) by debbugs.gnu.org; 26 May 2023 11:52:32 +0000 Received: from localhost ([127.0.0.1]:49025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2Vzk-0003K4-6x for submit@debbugs.gnu.org; Fri, 26 May 2023 07:52:32 -0400 Received: from sonic310-23.consmr.mail.ne1.yahoo.com ([66.163.186.204]:44881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2Vzh-0003JX-HA for 63328@debbugs.gnu.org; Fri, 26 May 2023 07:52:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1685101941; bh=wKZ3EjXjpgFdPKbO0IgVNeLd2y2un0iKVzl8THYSTKY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=Y/NXy5LnQSJA3z9DPf4LQ6ENObyjm5aXuB5I0QUfYwKsNiXkv0fs1iDtDiL1OO4Z6dz25lQniL7fW1g4q+qvGapithk+d1iVnMH97f/DiBwjC+3CnJcEvzM+lwt4bQs1jdVEQFKSnYsk5TKVekOzoA670MBibGGtilzupk9c/Qf9emGsgVdoK8C0xPoVDYD+ryhZ0PxTRZmlA+kchBJ+qGxzMNNUSRiHUWh+TMLXnnAdVEgy4ZL8+8YDRlvzakoYUThn9g7tAgBFpwAOj5ntXYloZjAXQatSBTe1lL1bNag+ENgx3UaBLegA1uZcnBB6X8BTZsE5fCN1eFexdXRFyw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1685101941; bh=m1jThESMZpUx3XblWgZYypEIaVIG9weVb72mY+IAYRo=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=ZzSJHhYDdDaiufAPlrSrxsw0BncFcHFXM3L5NxiqbozcgFEBZoeSzoBS9bVg/GBRDm0Z5F1t9sU0cbEKSzgnf/TgcYtiPcfkdHp75WNC1irKeW3ylh6r2psqDx0o4GpblfQ3kO+L0kONhIpOd67CmWj+LVmA8PjVAcTGg6wYHB+8i69jQmouaCHnN7NN2BjG88m8iaid3IUEpkek47GsdGA1i7nBX0S36/FG29HVSLu02MH4tH5089wZjx7ZUwAfT1JtjoAzxy8tcv+g8cvewnlhRW4l26rN5Ni4haMXrPcMpExTfpy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X2FZ6zzIWL431p2HE1pL2ydmCbMAC04PChuH0Rt.UX_6JN2BNCAOGGo856kQI1xDpMF4qDeak rSTZNNIibkEEiIDt8xK72CSk.iXDX4scRuput2P18UtR5Lna8etivSG7hlJVcHhpiUaum9QL4Afo aDyrojAA38R8dphsHDh9.2KphryIlLDOgTPEpOsaSlxGk8pU3d.Dqay5fGHm27NDZDQ-- X-Sonic-MF: X-Sonic-ID: 4d4778fc-2b62-4739-833a-9365c20b7cf3 Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Fri, 26 May 2023 11:52:21 +0000 Received: by hermes--production-sg3-748897c457-fp9l7 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID c8dad544398252588fcdfb73d228ee5e; Fri, 26 May 2023 11:52:19 +0000 (UTC) From: Po Lu In-Reply-To: (Alan Mackenzie's message of "Fri, 26 May 2023 10:14:04 +0000") References: <87bkixk8k0.fsf.ref@yahoo.com> <87bkixk8k0.fsf@yahoo.com> <871qjmb78y.fsf@yahoo.com> Date: Fri, 26 May 2023 19:52:09 +0800 Message-ID: <87y1lbpaxi.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.21495 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 1698 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > Hello, Po. > > On Fri, May 12, 2023 at 10:42:21 +0800, Po Lu wrote: >> Alan Mackenzie 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! I don't have time to try this right now. Would you quickly run it over the code in `java' on Emacs's feature/android branch, and install it if it seems to work? TIA. From unknown Fri Aug 15 20:52:03 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Po Lu Subject: bug#63328: closed (Re: bug#63328: CC Mode 5.35.2 (Java//l); Constructor function not fontified as such) Message-ID: References: <87bkixk8k0.fsf@yahoo.com> X-Gnu-PR-Message: they-closed 63328 X-Gnu-PR-Package: cc-mode Reply-To: 63328@debbugs.gnu.org Date: Fri, 26 May 2023 16:57:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1685120222-16101-1" This is a multi-part message in MIME format... ------------=_1685120222-16101-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #63328: CC Mode 5.35.2 (Java//l); Constructor function not fontified as such which was filed against the cc-mode package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 63328@debbugs.gnu.org. --=20 63328: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63328 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1685120222-16101-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 63328-done) by debbugs.gnu.org; 26 May 2023 16:56:35 +0000 Received: from localhost ([127.0.0.1]:50714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2ajz-0004B1-DH for submit@debbugs.gnu.org; Fri, 26 May 2023 12:56:35 -0400 Received: from mx3.muc.de ([193.149.48.5]:55121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2ajx-0004Aa-7m for 63328-done@debbugs.gnu.org; Fri, 26 May 2023 12:56:34 -0400 Received: (qmail 82152 invoked by uid 3782); 26 May 2023 18:56:26 +0200 Received: from acm.muc.de (p4fe15872.dip0.t-ipconnect.de [79.225.88.114]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 26 May 2023 18:56:26 +0200 Received: (qmail 14430 invoked by uid 1000); 26 May 2023 16:56:25 -0000 Date: Fri, 26 May 2023 16:56:25 +0000 To: Po Lu Subject: Re: bug#63328: CC Mode 5.35.2 (Java//l); Constructor function not fontified as such Message-ID: References: <87bkixk8k0.fsf.ref@yahoo.com> <87bkixk8k0.fsf@yahoo.com> <871qjmb78y.fsf@yahoo.com> <87y1lbpaxi.fsf@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y1lbpaxi.fsf@yahoo.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63328-done Cc: 63328-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Po. On Fri, May 26, 2023 at 19:52:09 +0800, Po Lu wrote: > Alan Mackenzie writes: [ .... ] > > 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! > I don't have time to try this right now. Would you quickly run it over > the code in `java' on Emacs's feature/android branch, and install it if > it seems to work? OK, I gave it a quick run over, and it appears to work. I've committed the patch and I'm closing the bug. > TIA. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1685120222-16101-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 6 May 2023 11:23:52 +0000 Received: from localhost ([127.0.0.1]:59565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvG12-0002J3-7Q for submit@debbugs.gnu.org; Sat, 06 May 2023 07:23:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:35626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvG0z-0002Iu-DT for submit@debbugs.gnu.org; Sat, 06 May 2023 07:23:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvG0z-00057n-4J for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 07:23:49 -0400 Received: from sonic309-20.consmr.mail.ne1.yahoo.com ([66.163.184.146]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pvG0m-0004VS-Fu for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 07:23:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683372214; bh=lXMdDQVSdMZEYSUS5LsZ8Ut5fUSDOWwAcBIjmFrsBP8=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=kiZfuLwvSv5v/c12LUodwxSIZ4FtDo5KALMOEmcJOqrrdop7+5D0XMQwv8MNiTGigPL26QMkwQIxw4nAsj9NHMmwlV+dlT054+EDcRXbDdTqVSZluo2IRbT6RvbaEC99WB0itRt3jLWu1GaM55ypoAKwg5tfPfawG4pTd2pQv/liYP+s6rDxXBmcY6BC3Ju/OH32FmYLspckWANBJYptUG317+0txCmSXzeLWz1DmZJljAu15szxhi+sNO7X9+GT9zkKd9KDHDXfJgkio4F7dBFN/Cm+TGhPav2xJ7sErOjXk635vrk0Mt4JcP5DUibI0vZNYM+opFJleEsQDftqzA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683372214; bh=lfTIDveuW5WF2O296LHSpkNN8iGqcGn/UVPRPVUa72v=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=hg2oC2NAW4QZ6/CCwYIBQFNBd4rY27KzaVBnXEoHj3COxE1FmeOHW9PUpiNhFvSqGnXgt0CDzGQhaw7rvDidjGYv9+sYmB4iJDOqEEU9SG8T+bQV+iHVto0NwR2omJdAl7OMhRFyS/lugaQmOZai6MVhSrIsn3fBqRXeJYmJLiFRI4urNSCN93kiWlSBeDM+U8hi8h4KJijL79tlkRKF3Y3Vzl5Rndbz4I03l4oRLVlpFZg+a1/Ay86a0we9lX+pYlvrkZx9mn+4A5YW5/qPwms4prBjAoxujZPpLB6vzAZVhcJux2t2s0mYcQsmoPevQmPjEtFPlOc0N0mthLrYRw== X-YMail-OSG: P0erLnUVM1lZFUnFuZ4_pBnzU.g4hbww5l35uUXaug0EVtpbnw_iCtBXzl97kYA xqouXNVyyJhGkMMS0cFS7MGYGAXzut3w78jfwI0kosDjxvGNY5F4gjSPIH0QG_bjxtkX_Jf.eDAf Vjf8sbGvEuhY43KrjD28fx6gngmUneNY6seNitWxW0Y4t8K6Y9ZDvVrEImeHTbVE45SeaaJmErIH 3BBe1AR.w.n5_C1j8of5mQ2MTIpP03UiGPmNe5L22agLbbi6la_3hgyIya2uvPvGbiiH2YHzj4yk V6K2j_N8TbIo873fiplvnvGz7nqisM.odoLAfHKT89AOFp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Bg.jMRXKQOhMSP9DPnRRy14M9c NodtNVRsr0w1TQOyCoX2g_GPFwx9_6UGEBRSn4NrXJ6IrQWG1ZQek6zl6V59tA6RtfJtOpKR6Zmh lxPq2h4jJRLlPDpo4FceBUzG1_XASpgqBI6MnLcpbpVxDNiZaz66IaWt_GFux7rJ2rqWl6nKiEnN Ku1tK4smHdfFvOcJ5OpGqP7.OINbEXXlxQGcTYDw08v0FeiaYV73BFDIFHvyTJOwx4CcEcDLH5VA gWpKFl.nE0V3Djn19RjwmtrUDgwezr1tjhd9jU0cltPwFIIBGO9PCBIaZk3crV6UV4Mep4VrrlMC mpEqZ1AZAhJ3miNalKDe0xhINkUl.Kxi5qj.xPQ3aZbHXv_WePMopc5vzBVTHqMI7H0EFrdA5o6H BF2Pecv6f4B.mR8O_6yBOmajrUCHssEI_BTfkSDstuE4aa2SLggvogl3JcSC85gNv1tH183Mthaa tgNvbszbg4T2tONs.xrHpcfjNdNhMulyKrmn0gjLM8NmlOJhfV8q1T1ibhh5JvYO9ATn5Zp1yNrz 23QKsz6yRRqwRXLBRyB1RPajwHenAUrd88iuR9BPzgaXuGPJmQMmP3VPGF7UWhx86C9QPZtv53OV c9zwXoN0nkEbhXxCcbs4X8M3kF_6lprZDAWQijGu15PiDjktzWFHfCFwsuq.moQDWXOZ9HNLaPG7 Wr4HD51bYh54pwYabY92fGNaqgIqHXLiS7PPs3nvpbkk4H9ErFwnAsBCbHaRxrw5EswNG6vJxgFq ns85sM6In9ZIWgZcU9d5kiyI1CEuJOgoLZZjAbuEewrH07pXh5cEdRUUey8Hx0IxAqXFpy6YARO8 xbLVN0s5JRvd4o5WvWoFS2TMs1QBaVc9f.M1g9KoE_JfnKvp95sxs X-Sonic-MF: X-Sonic-ID: 2502a1b9-d468-489b-9f77-c2dcef10716c Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Sat, 6 May 2023 11:23:34 +0000 Received: by hermes--production-sg3-6d6fb994f6-7thcs (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 52c9b5cdc8b5e6e7c9b8c79793d03799; Sat, 06 May 2023 11:23:32 +0000 (UTC) From: Po Lu To: bug-gnu-emacs@gnu.org Subject: CC Mode 5.35.2 (Java//l); Constructor function not fontified as such X-Debbugs-Package: cc-mode Date: Sat, 06 May 2023 19:23:27 +0800 Message-ID: <87bkixk8k0.fsf@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable References: <87bkixk8k0.fsf.ref@yahoo.com> X-Mailer: WebService/1.1.21417 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 4648 Received-SPF: pass client-ip=66.163.184.146; envelope-from=luangruo@yahoo.com; helo=sonic309-20.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.6 (-) Package: cc-mode In the following code: public EmacsInputConnection (EmacsView view) { super (view, true); `EmacsInputConnection', a constructor function, is not fontified as such. Its parameter list is not fontified either. Emacs : GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu) of 2023-04-29 Package: CC Mode 5.35.2 (Java//l) Buffer Style: GNU c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-st= ring-delim gen-comment-delim syntax-properties category-properties 1-bit) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq c-basic-offset 2 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . = 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "" c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+") (= other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode = . gtkdoc) (c++-mode . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((substatement-open before after) (arglist-cont-no= nempty)) c-hanging-colons-alist nil c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) c-backslash-column 48 c-backslash-max-column 72 c-special-indent-hook '(t c-gnu-impose-minimum) c-label-minimum-indentation 1 c-offsets-alist '((inexpr-class . +) (inexpr-statement . +) (lambda-intro-cont . +) (inlambda . 0) (template-args-cont c-lineup-template-args +) (incomposition . +) (inmodule . +) (innamespace . +) (inextern-lang . +) (composition-close . 0) (module-close . 0) (namespace-close . 0) (extern-lang-close . 0) (composition-open . 0) (module-open . 0) (namespace-open . 0) (extern-lang-open . 0) (objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-= method-call +) (objc-method-args-cont . c-lineup-ObjC-method-args) (objc-method-intro . [0]) (friend . 0) (cpp-define-intro c-lineup-cpp-define +) (cpp-macro-cont . +) (cpp-macro . [0]) (inclass . +) (stream-op . c-lineup-streamop) (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist) (arglist-cont c-lineup-gcc-asm-reg 0) (comment-intro c-lineup-knr-region-comment c-lineup-comment) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (case-label . 0) (substatement . +) (statement-case-intro . +) (statement . 0) (brace-entry-open . 0) (brace-list-entry . 0) (brace-list-close . 0) (brace-list-open . +) (block-close . 0) (block-open . 0) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (annotation-var-cont . +) (annotation-top-cont . 0) (topmost-intro . 0) (knr-argdecl . 0) (inline-close . 0) (class-close . 0) (class-open . 0) (defun-block-intro . +) (defun-close . 0) (defun-open . 0) (c . c-lineup-C-comments) (string . c-lineup-dont-change) (func-decl-cont . +) (inher-cont . c-lineup-multi-inher) (access-label . -) (brace-list-intro first c-lineup-2nd-brace-entry-in-arglist c-lineup-c= lass-decl-init-+ +) (arglist-close . c-lineup-arglist) (arglist-intro . c-lineup-arglist-intro-after-paren) (statement-cont . +) (statement-case-open . +) (label . 0) (substatement-label . 0) (substatement-open . +) (knr-argdecl-intro . 5) (statement-block-intro . +) (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEF= UN-intro-cont) (inline-open . 0) ) c-buffer-is-cc-mode 'java-mode c-tab-always-indent t c-syntactic-indentation t c-syntactic-indentation-in-macros t c-ignore-auto-fill '(string cpp code) c-auto-align-backslashes t c-backspace-function 'backward-delete-char-untabify c-delete-function 'delete-char c-electric-pound-behavior nil c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu")) c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 8 comment-column 32 parse-sexp-ignore-comments t parse-sexp-lookup-properties t auto-fill-function nil comment-multi-line t comment-start-skip "\\(?://+\\|/\\*+\\)\\s *" fill-prefix nil fill-column 70 paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*\\(@[a-zA-Z]+\\>\\|$\\)\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-=E2=80=93!|#%= ;>*=C2=B7=E2=80=A2=E2=80=A3=E2=81=83=E2=97=A6]+[ ]*\\)*\\)" ) ------------=_1685120222-16101-1--