From unknown Fri Jun 20 17:56:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25608 <25608@debbugs.gnu.org> To: bug#25608 <25608@debbugs.gnu.org> Subject: Status: CC Mode 5.33 (C/l); Incorrect syntactic information and indentation after multi-line comment with parenthesis or keywords Reply-To: bug#25608 <25608@debbugs.gnu.org> Date: Sat, 21 Jun 2025 00:56:31 +0000 retitle 25608 CC Mode 5.33 (C/l); Incorrect syntactic information and inden= tation after multi-line comment with parenthesis or keywords reassign 25608 cc-mode submitter 25608 Chris Wagner severity 25608 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 02 11:34:04 2017 Received: (at submit) by debbugs.gnu.org; 2 Feb 2017 16:34:04 +0000 Received: from localhost ([127.0.0.1]:54191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZKKh-0000Jg-Kb for submit@debbugs.gnu.org; Thu, 02 Feb 2017 11:34:04 -0500 Received: from cambridgeuk-g01.cambridgeconsultants.com ([193.35.222.39]:60960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZHha-0004s1-B6 for submit@debbugs.gnu.org; Thu, 02 Feb 2017 08:45:33 -0500 X-Disclaimed: 58006 To: submit@debbugs.gnu.org MIME-Version: 1.0 Subject: CC Mode 5.33 (C/l); Incorrect syntactic information and indentation after multi-line comment with parenthesis or keywords X-KeepSent: B454BB33:FED6E2EC-802580BB:00480520; type=4; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1FP6 April 21, 2016 Message-ID: From: Chris Wagner Date: Thu, 2 Feb 2017 13:45:36 +0000 X-MIMETrack: S/MIME Sign by NLNOTES.EXE on Chris Wagner/HO/CCL(Release 9.0.1FP6|April 21, 2016) at 02/02/2017 13:45:26, Serialize by NLNOTES.EXE on Chris Wagner/HO/CCL(Release 9.0.1FP6|April 21, 2016) at 02/02/2017 13:45:26, Serialize complete at 02/02/2017 13:45:26, S/MIME Sign failed at 02/02/2017 13:45:26: The cryptographic key was not found, Serialize by Router on CambridgeUK-G01/SVR/CCL(Release 9.0.1FP7|August 17, 2016) at 02/02/2017 13:45:31, Serialize complete at 02/02/2017 13:45:31 Content-Type: multipart/alternative; boundary="=_alternative 004B923E802580BB_=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 02 Feb 2017 11:34:02 -0500 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: 0.0 (/) This is a multipart message in MIME format. --=_alternative 004B923E802580BB_= Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Hello, With the following c code: /*-------------------------------------------------------------------------= ---- (c) Copyright notice containing open parentheses ---------------------------------------------------------------------------= --*/ =20 /*-------------------------------------------------------------------------= --*/ the last line is indented incorrectly, as the identified syntactic information is ((topmost-intro-cont 1) (comment-intro)). I think it should be ((topmost-intro 1) (comment-intro)), which the following code correctly identifies: /*-------------------------------------------------------------------------= ---- Non parenthesis language ---------------------------------------------------------------------------= --*/ /*-------------------------------------------------------------------------= --*/ Similarly, if there is a keyword in the comment, the next comment is incorrectly identified and indented: /*-------------------------------------------------------------------------= ---- (c) Copyright notice containing open parentheses Line containing keyword for ---------------------------------------------------------------------------= --*/ =20 /*-------------------------------------------------------------------------= --*/ Note that indenting the comment region removes the problem: /*-------------------------------------------------------------------------= ---- (c) Copyright notice containing open parentheses Line containing keyword for ---------------------------------------------------------------------------= --*/ /*-------------------------------------------------------------------------= --*/ indents correctly. Best regards, Chris Emacs : GNU Emacs 25.1.1 (x86=5F64-w64-mingw32) of 2016-09-17 Package: CC Mode 5.33 (C/l) Buffer Style: bsd c-emacs-features: (pps-extended-state col-0-paren posix-char-classes=20 gen-string-delim gen-comment-delim syntax-properties 1-bit) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq c-basic-offset 4 c-comment-only-line-offset 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 . "#+")=20 (other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode = . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((brace-list-open) (brace-entry-open)=20 (statement-cont) (substatement-open after) (block-close . c-snug-do-while)=20 (extern-lang-open after) (namespace-open after) (module-open after) (composition-open after)=20 (inexpr-class-open after) (inexpr-class-close before)=20 (arglist-cont-nonempty)) 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 nil c-label-minimum-indentation 1 c-offsets-alist '((inexpr-statement . +) (lambda-intro-cont . +) (inlambda . c-lineup-inexpr-block) (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-close . +) (arglist-cont-nonempty c-lineup-gcc-asm-reg=20 c-lineup-arglist) (arglist-cont c-lineup-gcc-asm-reg 0) (arglist-intro . +) (comment-intro c-lineup-knr-region-comment=20 c-lineup-comment) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (access-label . -) (case-label . 0) (substatement . +) (statement-case-open . 0) (statement-case-intro . +) (statement . 0) (brace-entry-open . 0) (brace-list-entry . 0) (brace-list-intro . +) (brace-list-close . 0) (brace-list-open . 0) (block-close . 0) (block-open . 0) (inher-cont . c-lineup-multi-inher) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (annotation-var-cont . +) (annotation-top-cont . 0) (topmost-intro-cont . c-lineup-topmost-intro-cont) (topmost-intro . 0) (knr-argdecl . 0) (func-decl-cont . +) (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) (inexpr-class . 0) (inline-open . 0) (statement-cont . +) (label . 0) (substatement-label . 0) (substatement-open . 0) (knr-argdecl-intro . +) (statement-block-intro . +) ) c-buffer-is-cc-mode 'c-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 "bsd" c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 4 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 "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([=20 ]*\\([-?!|#%;>*=B7????]+[ ]*\\)*\\)" ) Dr Chris Wagner Senior Consultant, Medical Technology=20 Cambridge Consultants Science Park, Milton Road=20 Cambridge, CB4 0DW, England Switchboard: +44 (0)1223 420024 Direct dial: +44 (0)1223 392497 Fax: +44 (0)1223 423373 chris.wagner@cambridgeconsultants.com www.CambridgeConsultants.com =20 This email is from Cambridge Consultants Limited, Science Park, Milton=20 Road, Cambridge CB4 0DW with registered number 1036298 England. It may=20 contain confidential information. It is intended for the addressee only=20 and may not be copied or disclosed to any third party without our=20 permission. If you are not the intended recipient please contact the=20 sender as soon as possible and delete the material from any computer. If=20 this email has been sent as a personal message to the addressee, the=20 sender is not acting in his/her capacity as an employee or officer of=20 Cambridge Consultants Limited and no liability is accepted for the content = of any such email. Outgoing email may be monitored for the purpose of=20 ensuring compliance with our email policy and relevant laws. --=_alternative 004B923E802580BB_= Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Hello,

With the following c code:

/*----------------------------------= -------------------------------------------
(c) Copyright notice containing open parentheses
------------------------------------= -----------------------------------------*/

 /*----------------------------= -----------------------------------------------*/


the last line is indented incorrectl= y, as the identified syntactic
information is ((topmost-intro-cont 1) (comment-intro)). I think it
should be ((topmost-intro 1) (commen= t-intro)), which the following code
correctly identifies:

/*----------------------------------= -------------------------------------------
Non parenthesis language
------------------------------------= -----------------------------------------*/

/*----------------------------------= -----------------------------------------*/


Similarly, if there is a keyword in the comment, the next comment is
incorrectly identified and indented:=

/*----------------------------------= -------------------------------------------
(c) Copyright notice containing open parentheses
Line containing keyword for
------------------------------------= -----------------------------------------*/

          &= nbsp;             /*-------------------------------= --------------------------------------------*/

Note that indenting the comment regi= on removes the problem:

/*----------------------------------= -------------------------------------------
  (c) Copyright notice containi= ng open parentheses
  Line containing keyword for
------------------------------------= -----------------------------------------*/

/*----------------------------------= -----------------------------------------*/

indents correctly.

Best regards,
Chris


Emacs  : GNU Emacs 25.1.1 (x86= =5F64-w64-mingw32)
 of 2016-09-17
Package: CC Mode 5.33 (C/l)
Buffer Style: bsd
c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-pr= operties 1-bit)

current state:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
(setq
 c-basic-offset 4
 c-comment-only-line-offset 0
 c-indent-comment-alist '((anch= ored-comment column . 0) (end-block space . 1) (cpp-end-block space . 2))
 c-indent-comments-syntacticall= y-p nil
 c-block-comment-prefix "* "
 c-comment-prefix-regexp '((pik= e-mode . "//+!?\\|\\**") (awk-mode . "#+") (other . "//+\= \|\\**"))
 c-doc-comment-style '((java-mo= de . javadoc) (pike-mode . autodoc) (c-mode . gtkdoc))
 c-cleanup-list '(scope-operato= r)
 c-hanging-braces-alist '((brac= e-list-open) (brace-entry-open) (statement-cont) (substatement-open after)
          &= nbsp;               (block-close . c-snug-do-w= hile) (extern-lang-open after) (namespace-open after)
          &= nbsp;               (module-open after) (compo= sition-open after) (inexpr-class-open after)
          &= nbsp;               (inexpr-class-close before) (arglist-cont-nonempty))
 c-hanging-colons-alist nil
 c-hanging-semi&comma-crite= ria '(c-semi&comma-inside-parenlist)
 c-backslash-column 48
 c-backslash-max-column 72
 c-special-indent-hook nil
 c-label-minimum-indentation 1<= /font>
 c-offsets-alist '((inexpr-stat= ement . +)
          &= nbsp;        (lambda-intro-cont . +)
          &= nbsp;        (inlambda . c-lineup-inexpr-block)
          &= nbsp;        (template-args-cont c-lineup-template-args +)
          &= nbsp;        (incomposition . +)
          &= nbsp;        (inmodule . +)
          &= nbsp;        (innamespace . +)
          &= nbsp;        (inextern-lang . +)
          &= nbsp;        (composition-close . 0)
          &= nbsp;        (module-close . 0)
          &= nbsp;        (namespace-close . 0)
          &= nbsp;        (extern-lang-close . 0)
          &= nbsp;        (composition-open . 0)
          &= nbsp;        (module-open . 0)
          &= nbsp;        (namespace-open . 0)
          &= nbsp;        (extern-lang-open . 0)
          &= nbsp;        (objc-method-call-cont c-lineup-ObjC-method-call= -colons c-lineup-ObjC-method-call +)
          &= nbsp;        (objc-method-args-cont . c-lineup-ObjC-method-ar= gs)
          &= nbsp;        (objc-method-intro . [0])
          &= nbsp;        (friend . 0)
          &= nbsp;        (cpp-define-intro c-lineup-cpp-define +)
          &= nbsp;        (cpp-macro-cont . +)
          &= nbsp;        (cpp-macro . [0])
          &= nbsp;        (inclass . +)
          &= nbsp;        (stream-op . c-lineup-streamop)
          &= nbsp;        (arglist-close . +)
          &= nbsp;        (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist)
          &= nbsp;        (arglist-cont c-lineup-gcc-asm-reg 0)
          &= nbsp;        (arglist-intro . +)
          &= nbsp;        (comment-intro c-lineup-knr-region-comment c-lin= eup-comment)
          &= nbsp;        (catch-clause . 0)
          &= nbsp;        (else-clause . 0)
          &= nbsp;        (do-while-closure . 0)
          &= nbsp;        (access-label . -)
          &= nbsp;        (case-label . 0)
          &= nbsp;        (substatement . +)
          &= nbsp;        (statement-case-open . 0)
          &= nbsp;        (statement-case-intro . +)
          &= nbsp;        (statement . 0)
          &= nbsp;        (brace-entry-open . 0)
          &= nbsp;        (brace-list-entry . 0)
          &= nbsp;        (brace-list-intro . +)
          &= nbsp;        (brace-list-close . 0)
          &= nbsp;        (brace-list-open . 0)
          &= nbsp;        (block-close . 0)
          &= nbsp;        (block-open . 0)
          &= nbsp;        (inher-cont . c-lineup-multi-inher)
          &= nbsp;        (inher-intro . +)
          &= nbsp;        (member-init-cont . c-lineup-multi-inher)
          &= nbsp;        (member-init-intro . +)
          &= nbsp;        (annotation-var-cont . +)
          &= nbsp;        (annotation-top-cont . 0)
          &= nbsp;        (topmost-intro-cont . c-lineup-topmost-intro-con= t)
          &= nbsp;        (topmost-intro . 0)
          &= nbsp;        (knr-argdecl . 0)
          &= nbsp;        (func-decl-cont . +)
          &= nbsp;        (inline-close . 0)
          &= nbsp;        (class-close . 0)
          &= nbsp;        (class-open . 0)
          &= nbsp;        (defun-block-intro . +)
          &= nbsp;        (defun-close . 0)
          &= nbsp;        (defun-open . 0)
          &= nbsp;        (c . c-lineup-C-comments)
          &= nbsp;        (string . c-lineup-dont-change)
          &= nbsp;        (inexpr-class . 0)
          &= nbsp;        (inline-open . 0)
          &= nbsp;        (statement-cont . +)
          &= nbsp;        (label . 0)
          &= nbsp;        (substatement-label . 0)
          &= nbsp;        (substatement-open . 0)
          &= nbsp;        (knr-argdecl-intro . +)
          &= nbsp;        (statement-block-intro . +)
          &= nbsp;        )
 c-buffer-is-cc-mode 'c-mode
 c-tab-always-indent t
 c-syntactic-indentation t
 c-syntactic-indentation-in-mac= ros 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<= /font>
 c-default-style "bsd"= ;
 c-enable-xemacs-performance-kl= udge-p nil
 c-old-style-variable-behavior nil
 defun-prompt-regexp nil
 tab-width 4
 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 "[         ]*\\(//+\\|\\**\\)[         ]*$\\|^\f"
 adaptive-fill-mode t
 adaptive-fill-regexp "[ &= nbsp;       ]*\\(//+\\|\\**\\)[         ]*\\([         ]*\\([-–!|#%;>*=B7•‣= ;⁃◦]+[         ]*\\)*\\)"
 )


Dr Chris Wagner
Senior Consultant, Medical Technology

Cambridge Consultants
Science Park, Milton Road
Cambridge, CB4 0DW, England
Switchboard: +44 (0)1223 420024
Direct dial: +44 (0)1223 392497
Fax: +44 (0)1223 423373
chris.wagner@cambridgeconsultants.com
www.CambridgeConsultants.com
 








This email is from Cambridge Consultants Limited, Science Park, Milton Road, Cambridge CB4 0DW with registered number 1036298 England. It may contain confidential information. It is intended for the addressee only and may not be copied or disclosed to any third party without our permissio= n. If you are not the intended recipient please contact the sender as soon as possible and delete the material from any computer. If this email has been sent as a personal message to the addressee, the sender is not acting in his/her capacity as an employee or officer of Cambridge Consultants Limited and no liability is accepted for the content of any such email. Outgoing email may be monitored for the purpose of ensuring compliance with our email policy and relevant laws.



--=_alternative 004B923E802580BB_=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 02 13:34:46 2017 Received: (at 25608) by debbugs.gnu.org; 2 Feb 2017 18:34:46 +0000 Received: from localhost ([127.0.0.1]:54249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZMDW-00036R-6v for submit@debbugs.gnu.org; Thu, 02 Feb 2017 13:34:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47049) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZMDU-00036D-3I for 25608@debbugs.gnu.org; Thu, 02 Feb 2017 13:34:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZMDN-00048k-50 for 25608@debbugs.gnu.org; Thu, 02 Feb 2017 13:34:38 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZMDN-00048Z-1Z; Thu, 02 Feb 2017 13:34:37 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cZMDM-00067Y-Ij; Thu, 02 Feb 2017 13:34:36 -0500 From: Glenn Morris To: 25608@debbugs.gnu.org Subject: Re: bug#25608: CC Mode 5.33 (C/l); Incorrect syntactic information and indentation after multi-line comment with parenthesis or keywords References: Mail-Followup-To: 25608@debbugs.gnu.org, chris.wagner@cambridgeconsultants.com X-Spook: Mahmoud Ahmadinejad ASO Chemical burn Uzi MS13 Toxic Law X-Ran: Lo\UX|It`&#U^qZwiUIr8P[jKbFxA\o1&?1 X-Hue: cyan X-Attribution: GM Date: Thu, 02 Feb 2017 13:34:36 -0500 In-Reply-To: (Chris Wagner's message of "Thu, 2 Feb 2017 13:45:36 +0000") Message-ID: <4gd1f0qw5f.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 25608 Cc: Chris Wagner 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: , Reply-To: 25608@debbugs.gnu.org, chris.wagner@cambridgeconsultants.com Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) I've reassigned this report to the right package in debbugs.gnu.org, and am sending this reply so it appears on the right mailing list. (It is of course impossible to comply with the meaningless legal disclaimer at the end of the mssage.) Chris Wagner wrote: > Hello, > > With the following c code: > > /*-----------------------------------------------------------------------= ------ > (c) Copyright notice containing open parentheses > -------------------------------------------------------------------------= ----*/ > >=20=20 > /*-----------------------------------------------------------------------= ----*/ > > > the last line is indented incorrectly, as the identified syntactic > information is ((topmost-intro-cont 1) (comment-intro)). I think it > should be ((topmost-intro 1) (comment-intro)), which the following code > correctly identifies: > > /*-----------------------------------------------------------------------= ------ > Non parenthesis language > -------------------------------------------------------------------------= ----*/ > > /*-----------------------------------------------------------------------= ----*/ > > > Similarly, if there is a keyword in the comment, the next comment is > incorrectly identified and indented: > > /*-----------------------------------------------------------------------= ------ > (c) Copyright notice containing open parentheses > Line containing keyword for > -------------------------------------------------------------------------= ----*/ > >=20=20 > /*-----------------------------------------------------------------------= ----*/ > > Note that indenting the comment region removes the problem: > > /*-----------------------------------------------------------------------= ------ > (c) Copyright notice containing open parentheses > Line containing keyword for > -------------------------------------------------------------------------= ----*/ > > /*-----------------------------------------------------------------------= ----*/ > > indents correctly. > > Best regards, > Chris > > > Emacs : GNU Emacs 25.1.1 (x86_64-w64-mingw32) > of 2016-09-17 > Package: CC Mode 5.33 (C/l) > Buffer Style: bsd > c-emacs-features: (pps-extended-state col-0-paren posix-char-classes=20 > gen-string-delim gen-comment-delim syntax-properties 1-bit) > > current state: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > (setq > c-basic-offset 4 > c-comment-only-line-offset 0 > c-indent-comment-alist '((anchored-comment column . 0) (end-block space = .=20 > 1) (cpp-end-block space . 2)) > c-indent-comments-syntactically-p nil > c-block-comment-prefix "* " > c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+")= =20 > (other . "//+\\|\\**")) > c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mod= e=20 > . gtkdoc)) > c-cleanup-list '(scope-operator) > c-hanging-braces-alist '((brace-list-open) (brace-entry-open)=20 > (statement-cont) (substatement-open after) > (block-close . c-snug-do-while)=20 > (extern-lang-open after) (namespace-open after) > (module-open after) (composition-open after)=20 > (inexpr-class-open after) > (inexpr-class-close before)=20 > (arglist-cont-nonempty)) > 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 nil > c-label-minimum-indentation 1 > c-offsets-alist '((inexpr-statement . +) > (lambda-intro-cont . +) > (inlambda . c-lineup-inexpr-block) > (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-colon= s=20 > 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-close . +) > (arglist-cont-nonempty c-lineup-gcc-asm-reg=20 > c-lineup-arglist) > (arglist-cont c-lineup-gcc-asm-reg 0) > (arglist-intro . +) > (comment-intro c-lineup-knr-region-comment=20 > c-lineup-comment) > (catch-clause . 0) > (else-clause . 0) > (do-while-closure . 0) > (access-label . -) > (case-label . 0) > (substatement . +) > (statement-case-open . 0) > (statement-case-intro . +) > (statement . 0) > (brace-entry-open . 0) > (brace-list-entry . 0) > (brace-list-intro . +) > (brace-list-close . 0) > (brace-list-open . 0) > (block-close . 0) > (block-open . 0) > (inher-cont . c-lineup-multi-inher) > (inher-intro . +) > (member-init-cont . c-lineup-multi-inher) > (member-init-intro . +) > (annotation-var-cont . +) > (annotation-top-cont . 0) > (topmost-intro-cont . c-lineup-topmost-intro-cont) > (topmost-intro . 0) > (knr-argdecl . 0) > (func-decl-cont . +) > (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) > (inexpr-class . 0) > (inline-open . 0) > (statement-cont . +) > (label . 0) > (substatement-label . 0) > (substatement-open . 0) > (knr-argdecl-intro . +) > (statement-block-intro . +) > ) > c-buffer-is-cc-mode 'c-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 "bsd" > c-enable-xemacs-performance-kludge-p nil > c-old-style-variable-behavior nil > defun-prompt-regexp nil > tab-width 4 > 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 "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" > adaptive-fill-mode t > adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([=20 > ]*\\([-?!|#%;>*=C2=B7????]+[ ]*\\)*\\)" > ) > > > > Dr Chris Wagner > Senior Consultant, Medical Technology=20 > Cambridge Consultants > Science Park, Milton Road=20 > Cambridge, CB4 0DW, England > Switchboard: +44 (0)1223 420024 > Direct dial: +44 (0)1223 392497 > Fax: +44 (0)1223 423373 > chris.wagner@cambridgeconsultants.com > www.CambridgeConsultants.com >=20=20 > > > > > > This email is from Cambridge Consultants Limited, Science Park, Milton=20 > Road, Cambridge CB4 0DW with registered number 1036298 England. It may=20 > contain confidential information. It is intended for the addressee only=20 > and may not be copied or disclosed to any third party without our=20 > permission. If you are not the intended recipient please contact the=20 > sender as soon as possible and delete the material from any computer. If= =20 > this email has been sent as a personal message to the addressee, the=20 > sender is not acting in his/her capacity as an employee or officer of=20 > Cambridge Consultants Limited and no liability is accepted for the conten= t=20 > of any such email. Outgoing email may be monitored for the purpose of=20 > ensuring compliance with our email policy and relevant laws. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 02 17:03:41 2017 Received: (at 25608) by debbugs.gnu.org; 2 Feb 2017 22:03:41 +0000 Received: from localhost ([127.0.0.1]:54289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZPTg-0007zA-QW for submit@debbugs.gnu.org; Thu, 02 Feb 2017 17:03:41 -0500 Received: from ocolin.muc.de ([193.149.48.4]:34295 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1cZPTe-0007z1-Gv for 25608@debbugs.gnu.org; Thu, 02 Feb 2017 17:03:39 -0500 Received: (qmail 93967 invoked by uid 3782); 2 Feb 2017 22:03:37 -0000 Received: from acm.muc.de (p548C71DF.dip0.t-ipconnect.de [84.140.113.223]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 02 Feb 2017 23:03:36 +0100 Received: (qmail 19662 invoked by uid 1000); 2 Feb 2017 22:03:19 -0000 Date: Thu, 2 Feb 2017 22:03:19 +0000 To: Chris Wagner Subject: Re: bug#25608: CC Mode 5.33 (C/l); Incorrect syntactic information and indentation after multi-line comment with parenthesis or keywords Message-ID: <20170202220319.GA3435@acm> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 25608 Cc: 25608@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: -0.0 (/) Hello, Chris. On Thu, Feb 02, 2017 at 13:45:36 +0000, Chris Wagner wrote: > Hello, > With the following c code: > /*----------------------------------------------------------------------------- > (c) Copyright notice containing open parentheses > -----------------------------------------------------------------------------*/ > /*---------------------------------------------------------------------------*/ > the last line is indented incorrectly, as the identified syntactic > information is ((topmost-intro-cont 1) (comment-intro)). I think it > should be ((topmost-intro 1) (comment-intro)), which the following code > correctly identifies: > /*----------------------------------------------------------------------------- > Non parenthesis language > -----------------------------------------------------------------------------*/ > /*---------------------------------------------------------------------------*/ > Similarly, if there is a keyword in the comment, the next comment is > incorrectly identified and indented: > /*----------------------------------------------------------------------------- > (c) Copyright notice containing open parentheses > Line containing keyword for > -----------------------------------------------------------------------------*/ > /*---------------------------------------------------------------------------*/ > Note that indenting the comment region removes the problem: > /*----------------------------------------------------------------------------- > (c) Copyright notice containing open parentheses > Line containing keyword for > -----------------------------------------------------------------------------*/ > /*---------------------------------------------------------------------------*/ > indents correctly. > Best regards, > Chris The problem in all these cases which fail is the open parenthesis at column zero inside the comment. This (currently) causes mis-analysis of the code around it, as detailed in the Emacs manual on page "Left Margin Paren". However, I would be the first to agree with you that this is a fault in Emacs rather than anything wrong with your source code, which is perfectly normal C. There is a fix for this problem, and I have some hope that this fix will be incorporated into Emacs 26. [ CC Mode configuration dump snipped, but appreciated. ] > Dr Chris Wagner > Senior Consultant, Medical Technology > Cambridge Consultants > Science Park, Milton Road > Cambridge, CB4 0DW, England > Switchboard: +44 (0)1223 420024 > Direct dial: +44 (0)1223 392497 > Fax: +44 (0)1223 423373 > chris.wagner@cambridgeconsultants.com > www.CambridgeConsultants.com -- Alan Mackenzie (Nuremberg, Germany).