X-Loop: help-debbugs@HIDDEN Subject: bug#52340: Improper auto-indentation in C++-mode Resent-From: Vince West <dvincentwest@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 06 Dec 2021 23:31:02 +0000 Resent-Message-ID: <handler.52340.B.163883342824968 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 52340 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 52340 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.163883342824968 (code B ref -1); Mon, 06 Dec 2021 23:31:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Dec 2021 23:30:28 +0000 Received: from localhost ([127.0.0.1]:35662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1muNRD-0006Ud-KP for submit <at> debbugs.gnu.org; Mon, 06 Dec 2021 18:30:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:39502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <dvincentwest@HIDDEN>) id 1muMBR-0002GA-3V for submit <at> debbugs.gnu.org; Mon, 06 Dec 2021 17:10:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <dvincentwest@HIDDEN>) id 1muMBQ-0007NG-34 for bug-gnu-emacs@HIDDEN; Mon, 06 Dec 2021 17:10:04 -0500 Received: from [2a00:1450:4864:20::42a] (port=41607 helo=mail-wr1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <dvincentwest@HIDDEN>) id 1muMBN-0004sX-VT for bug-gnu-emacs@HIDDEN; Mon, 06 Dec 2021 17:10:03 -0500 Received: by mail-wr1-x42a.google.com with SMTP id a9so25291494wrr.8 for <bug-gnu-emacs@HIDDEN>; Mon, 06 Dec 2021 14:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=ro3h2F8acimtINQar3EsxegjN7ctxRzR1tJ8zy3CENw=; b=MXlUY65yt5zmNdHaaKlXcXc5wezUeWewaIrv1Gf3DiQzzvAagL+yBcZBndKCApkzfB /x40e5P9Hu+h1RI3eMG/BxsbZKyQcrQO0XeXCjrGODoRPDD8XT4+X3S1qlFRYvsRZBZT hTLB+wMOkRxsUNkaol8q4pNsf4Z8Flk95g+dZkEuCzUO5QCSIQkD3F3KdvlV6yiF/jCk 73dAr2YIVl5GjMc28jGql85gY30PZ3B16ZEUAP8JUeB51cQs8hl75E1WyD6qftstmL9Q qhhmhyEZflXC+HNTQoEieU2WmU4wk2ZgnszUC7Y6bI4Ik8Ct5g1bWbJFD0eB698TFRrU NtwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ro3h2F8acimtINQar3EsxegjN7ctxRzR1tJ8zy3CENw=; b=Qwph2L/llMQzHGAjlzFdxqVtC02Hp95/ELqXpcT1UMmx12XLQUk3Rh+K3YlqUjOOAy B9IzvX4/Ql55o0BVMlFZkapDP3czLjfDtKc7vINya4lUudI/lYt+G3zNbcWr096shPC+ Ts36dMH66HluAalo+fgRZsHuzlXlVpzWy4KL34/KomExEpOKp2s7qJ0DwnYa+ge4Lw/G /YQ43YMwuZxrdwXASLwrLvjX6b91CxaNf8jpY/Z07p5xJl5N4GAKbzULLXh+9brnU/G8 hdZRMjxOWuhb7oXKgQZWiLrkpQAYEpQpKWbclYyt4qmR9woJSgY85md0BSH2DrcwJ55J q3Ew== X-Gm-Message-State: AOAM531RwE6reMalyA/kSNWBIoRJd4+Lj5+68bG9zWyPSJcTaILoGPuY PaMzoV6pJMtI3XvcB993Zs3EJ5u0YCfZHSXHRH4JLI/cX/0= X-Google-Smtp-Source: ABdhPJzXG0Z/LJQ9rJTYgFG0IyQC/PiPQJK9cvqcD9QKTl2hk3hjZNIxpOGO+L3HB0tfbO1LWzcEW63d/KS+scolhOw= X-Received: by 2002:adf:e391:: with SMTP id e17mr45982431wrm.613.1638828599094; Mon, 06 Dec 2021 14:09:59 -0800 (PST) MIME-Version: 1.0 From: Vince West <dvincentwest@HIDDEN> Date: Mon, 6 Dec 2021 16:09:32 -0600 Message-ID: <CAPfAwJXhbWkNwEUGtgBzs4vFkJ8=OTZP2orvvr2SzFvSU2FXvQ@HIDDEN> Content-Type: multipart/alternative; boundary="0000000000007f316505d2818402" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=dvincentwest@HIDDEN; helo=mail-wr1-x42a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.0 (/) X-Mailman-Approved-At: Mon, 06 Dec 2021 18:30:27 -0500 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) --0000000000007f316505d2818402 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable `indent-region` is giving some weird results in c++-mode. I will just paste the main function here: ```C++ int main() { // looks good to me float nums[9] =3D { 1., 2., 3., 4., 5., 6., 7., 8., 9., }; // wtf float * numsp =3D new float[9] { 1., 2., 3., 4., 5., 6., 7., 8., 9., }; } ``` In c-mode, the indentation looks fine: ```C int main() { // looks good to me float nums[9] =3D { 1., 2., 3., 4., 5., 6., 7., 8., 9., }; // looks fine in C-mode float * numsp =3D new float[9] { 1., 2., 3., 4., 5., 6., 7., 8., 9., }; } ``` In GNU Emacs 27.2 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2021-03-27 built on builder10-14.porkrind.org Windowing system distributor 'Apple', version 10.3.2022 System Description: macOS 11.6.1 Recent messages: Undo Making completion list... Indenting region... done You can run the command =E2=80=98indent-region=E2=80=99 with C-M-\ Indenting region... done previous-line: Beginning of buffer Mark activated Indenting region... done previous-line: Beginning of buffer [2 times] Making completion list... [2 times] Configured using: 'configure --with-ns '--enable-locallisppath=3D/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules' Configured features: NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS JSON PDUMPER GMP Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: C++//l Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Load-path shadows: None found. Features: (shadow sort emacsbug sendmail mail-extr message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader thingatpt cl-extra seq byte-opt gv bytecomp byte-compile cconv help-mode novice cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 69710 8231) (symbols 48 8632 1) (strings 32 22129 1555) (string-bytes 1 831409) (vectors 16 13165) (vector-slots 8 160910 15816) (floats 8 31 31) (intervals 56 433 6) (buffers 1000 14)) --0000000000007f316505d2818402 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><br>`indent-region` is giving some weird results in c++-mo= de.=C2=A0 I will just<br>paste the main function here:<br><br><font face=3D= "monospace">```C++<br>int main() {<br><br>=C2=A0 // looks good to me<br>=C2= =A0 float nums[9] =3D<br>=C2=A0 =C2=A0 {<br>=C2=A0 =C2=A0 =C2=A0 1., 2., 3.= ,<br>=C2=A0 =C2=A0 =C2=A0 4., 5., 6.,<br>=C2=A0 =C2=A0 =C2=A0 7., 8., 9.,<b= r>=C2=A0 =C2=A0 };<br><br>=C2=A0 // wtf<br>=C2=A0 float * numsp =3D new flo= at[9]<br>=C2=A0 {<br>=C2=A0 =C2=A0 1., 2., 3.,<br>=C2=A0 =C2=A0 =C2=A0 4., = 5., 6.,<br>=C2=A0 =C2=A0 =C2=A0 7., 8., 9.,<br>=C2=A0 =C2=A0 =C2=A0 };<br><= br>}<br>```</font><br><br>In c-mode, the indentation looks fine:<br><font f= ace=3D"monospace">```C<br>int main() {<br><br>=C2=A0 // looks good to me<br= >=C2=A0 float nums[9] =3D<br>=C2=A0 =C2=A0 {<br>=C2=A0 =C2=A0 =C2=A0 1., 2.= , 3.,<br>=C2=A0 =C2=A0 =C2=A0 4., 5., 6.,<br>=C2=A0 =C2=A0 =C2=A0 7., 8., 9= .,<br>=C2=A0 =C2=A0 };<br><br>=C2=A0 // looks fine in C-mode<br>=C2=A0 floa= t * numsp =3D new float[9]<br>=C2=A0 =C2=A0 {<br>=C2=A0 =C2=A0 =C2=A0 1., 2= ., 3.,<br>=C2=A0 =C2=A0 =C2=A0 4., 5., 6.,<br>=C2=A0 =C2=A0 =C2=A0 7., 8., = 9.,<br>=C2=A0 =C2=A0 };<br><br>}<br><br>```</font><br><br><br>In GNU Emacs = 27.2 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6= (Build 18G95))<br>=C2=A0of 2021-03-27 built on <a href=3D"http://builder10= -14.porkrind.org">builder10-14.porkrind.org</a><br>Windowing system distrib= utor 'Apple', version 10.3.2022<br>System Description: =C2=A0macOS = 11.6.1<br><br>Recent messages:<br>Undo<br>Making completion list...<br>Inde= nting region... done<br>You can run the command =E2=80=98indent-region=E2= =80=99 with C-M-\<br>Indenting region... done<br>previous-line: Beginning o= f buffer<br>Mark activated<br>Indenting region... done<br>previous-line: Be= ginning of buffer [2 times]<br>Making completion list... [2 times]<br><br>C= onfigured using:<br>=C2=A0'configure --with-ns '--enable-locallispp= ath=3D/Library/Application<br>=C2=A0Support/Emacs/${version}/site-lisp:/Lib= rary/Application<br>=C2=A0Support/Emacs/site-lisp' --with-modules'<= br><br>Configured features:<br>NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKI= T_SCROLL_BARS NS MODULES<br>THREADS JSON PDUMPER GMP<br><br>Important setti= ngs:<br>=C2=A0 value of $LANG: en_US.UTF-8<br>=C2=A0 locale-coding-system: = utf-8-unix<br><br>Major mode: C++//l<br><br>Minor modes in effect:<br>=C2= =A0 tooltip-mode: t<br>=C2=A0 global-eldoc-mode: t<br>=C2=A0 electric-inden= t-mode: t<br>=C2=A0 mouse-wheel-mode: t<br>=C2=A0 tool-bar-mode: t<br>=C2= =A0 menu-bar-mode: t<br>=C2=A0 file-name-shadow-mode: t<br>=C2=A0 global-fo= nt-lock-mode: t<br>=C2=A0 font-lock-mode: t<br>=C2=A0 blink-cursor-mode: t<= br>=C2=A0 auto-composition-mode: t<br>=C2=A0 auto-encryption-mode: t<br>=C2= =A0 auto-compression-mode: t<br>=C2=A0 line-number-mode: t<br>=C2=A0 transi= ent-mark-mode: t<br>=C2=A0 abbrev-mode: t<br><br>Load-path shadows:<br>None= found.<br><br>Features:<br>(shadow sort emacsbug sendmail mail-extr messag= e rmc puny dired<br>dired-loaddefs format-spec rfc822 mml mml-sec password-= cache epa derived<br>epg epg-config gnus-util rmail rmail-loaddefs text-pro= perty-search<br>time-date subr-x mm-decode mm-bodies mm-encode mail-parse r= fc2231<br>rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-uti= ls<br>gmm-utils mailheader thingatpt cl-extra seq byte-opt gv bytecomp<br>b= yte-compile cconv help-mode novice cc-mode cc-fonts easymenu cc-guess<br>cc= -menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs<br>cl-loaddefs = cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks<br>lisp-float-ty= pe mwheel term/ns-win ns-win ucs-normalize mule-util<br>term/common-win too= l-bar dnd fontset image regexp-opt fringe<br>tabulated-list replace newcomm= ent text-mode elisp-mode lisp-mode<br>prog-mode register page tab-bar menu-= bar rfn-eshadow isearch timer<br>select scroll-bar mouse jit-lock font-lock= syntax facemenu font-core<br>term/tty-colors frame minibuffer cl-generic c= ham georgian utf-8-lang<br>misc-lang vietnamese tibetan thai tai-viet lao k= orean japanese eucjp-ms<br>cp51932 hebrew greek romanian slovak czech europ= ean ethiopic indian<br>cyrillic chinese composite charscript charprop case-= table epa-hook<br>jka-cmpr-hook help simple abbrev obarray cl-preloaded nad= vice loaddefs<br>button faces cus-face macroexp files text-properties overl= ay sha1 md5<br>base64 format env code-pages mule custom widget hashtable-pr= int-readable<br>backquote threads kqueue cocoa ns multi-tty make-network-pr= ocess emacs)<br><br>Memory information:<br>((conses 16 69710 8231)<br>=C2= =A0(symbols 48 8632 1)<br>=C2=A0(strings 32 22129 1555)<br>=C2=A0(string-by= tes 1 831409)<br>=C2=A0(vectors 16 13165)<br>=C2=A0(vector-slots 8 160910 1= 5816)<br>=C2=A0(floats 8 31 31)<br>=C2=A0(intervals 56 433 6)<br>=C2=A0(buf= fers 1000 14))<br></div> --0000000000007f316505d2818402--
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Vince West <dvincentwest@HIDDEN> Subject: bug#52340: Acknowledgement (Improper auto-indentation in C++-mode) Message-ID: <handler.52340.B.163883342824968.ack <at> debbugs.gnu.org> References: <CAPfAwJXhbWkNwEUGtgBzs4vFkJ8=OTZP2orvvr2SzFvSU2FXvQ@HIDDEN> X-Gnu-PR-Message: ack 52340 X-Gnu-PR-Package: emacs Reply-To: 52340 <at> debbugs.gnu.org Date: Mon, 06 Dec 2021 23:31:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 52340 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 52340: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D52340 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.