From unknown Sat Jun 21 03:04:39 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#9544 <9544@debbugs.gnu.org> To: bug#9544 <9544@debbugs.gnu.org> Subject: Status: 24.0.50; cc-mode does not indent Qt class correctly Reply-To: bug#9544 <9544@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:04:39 +0000 retitle 9544 24.0.50; cc-mode does not indent Qt class correctly reassign 9544 emacs,cc-mode submitter 9544 Christoph Scholtes severity 9544 normal tag 9544 unreproducible thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 11:17:36 2011 Received: (at submit) by debbugs.gnu.org; 18 Sep 2011 15:17:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5J7f-0004Fy-IP for submit@debbugs.gnu.org; Sun, 18 Sep 2011 11:17:36 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5J7a-0004Fp-Nl for submit@debbugs.gnu.org; Sun, 18 Sep 2011 11:17:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5J2n-0002hh-Bd for submit@debbugs.gnu.org; Sun, 18 Sep 2011 11:12:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:52850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5J2n-0002hd-9m for submit@debbugs.gnu.org; Sun, 18 Sep 2011 11:12:33 -0400 Received: from eggs.gnu.org ([140.186.70.92]:53072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5J2l-00085i-Q3 for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 11:12:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5J2k-0002ge-3R for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 11:12:31 -0400 Received: from mail-yx0-f169.google.com ([209.85.213.169]:64149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5J2j-0002gJ-VF for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 11:12:30 -0400 Received: by yxi19 with SMTP id 19so4336968yxi.0 for ; Sun, 18 Sep 2011 08:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:subject:user-agent:date:message-id:mime-version :content-type; bh=ULvsSZfNKgo/MWzD8iJ04I5OcUwLVrEGyj9qo9d7b8A=; b=BAi8vOVqiqWPQaHsxMM1KV0dAYJs6sgkoOx435pnxzgOqI11UCuXjCS0OJaGS3TwHf +wZYmEwA1XUhLV6Q5WSd3yC9+T0k2uFlad47GaQU1zm1OM/1LfctMuqdaRMFjGv1oBDd ydinqCdJN7jb68UIsLQFLneQ1zP8DOclCD7cE= Received: by 10.151.40.17 with SMTP id s17mr1316176ybj.140.1316358748946; Sun, 18 Sep 2011 08:12:28 -0700 (PDT) Received: from MARVIN (71-208-69-86.hlrn.qwest.net [71.208.69.86]) by mx.google.com with ESMTPS id m10sm21700412ang.12.2011.09.18.08.12.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Sep 2011 08:12:28 -0700 (PDT) From: Christoph Scholtes To: bug-gnu-emacs@gnu.org Subject: 24.0.50; cc-mode does not indent Qt class correctly User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt) Date: Sun, 18 Sep 2011 09:12:22 -0600 Message-ID: <86y5xllwa1.fsf@googlemail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) With the latest emacs trunk, from `emacs -Q' open *.hpp file with this content: class Counter : public QObject { Q_OBJECT public: Counter() { m_value = 0; } int value() const { return m_value; } public slots: void setValue(int value); signals: void valueChanged(int newValue); private: int m_value; }; Note, that the first access modifier `public' is not indented properly. All Qt other extension modifiers are indented correctly. The indentation should look like this: class Counter : public QObject { Q_OBJECT public: Counter() { m_value = 0; } [snip] The indentation works correctly when the `Q_OBJECT' macro is removed. Since cc-mode does support the Qt extensions, it should also correctly indent this class with the `Q_OBJECT' macro present. In GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7601) of 2011-09-17 on MARVIN Windowing system distributor `Microsoft Corp.', version 6.1.7601 configured using `configure --with-gcc (4.5) --no-opt --cflags -I"C:/Program Files (x86)/GnuWin32/include" -ID:/devel/emacs/libXpm-3.5.8/include -ID:/devel/emacs/libXpm-3.5.8/src -ID:/devel/emacs/gnutls-2.10.5-x86/include --ldflags -LD:/devel/emacs/gnutls-2.10.5-x86/lib' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENU value of $XMODIFIERS: nil locale-coding-system: cp1252 default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: paredit-mode: t my-keys-minor-mode: t erc-autojoin-mode: t erc-track-mode: t erc-match-mode: t erc-pcomplete-mode: t erc-stamp-mode: t recentf-mode: t desktop-save-mode: t autopair-mode: t autopair-global-mode: t ido-everywhere: t yas/global-mode: t yas/minor-mode: t global-auto-revert-mode: t delete-selection-mode: t tooltip-mode: t mouse-wheel-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 size-indication-mode: t column-number-mode: t line-number-mode: t Recent input: M-x c c - m o d e r e o p o r t - b u C-g C-t C-/ M-x r e p o r t Recent messages: Quit Undo! Loading system routine info in idle time... Failed to convert XML routine info, falling back on idlw-rinfo. Could not locate any system routine information. Loading system routine info in idle time...done Normalizing idlwave-system-routines in idle time...done Loading and normalizing library catalogs in idle time...done Finishing initialization in idle time... Scanning all buffers... Load-path shadows: None found. Features: (shadow sort gnus-cite mail-extr gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime password-cache dig mailcap emacsbug idlwave imenu idlwave-help idlw-help browse-url cc-mode cc-fonts cc-guess cc-menus cc-cmds vc-hg paredit my-zenburn-theme erc-join erc-track erc-match erc-pcomplete erc-stamp erc-goodies erc erc-backend erc-compat thingatpt ispell bookmark+ bookmark+-key dired-x dired bookmark+-1 nnir gnus-sum nnoo gnus-group gnus-undo nnmail mail-source gnus-start gnus-spec gnus-int gnus-range message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader gnus-util mail-utils mm-util mail-prsvr bookmark+-bmu help-mode view bookmark+-lit pp+ bookmark+-mac bookmark pp recentf tree-widget wid-edit midnight desktop ibuffer uniquify autopair google-c-style cc-styles cc-align cc-engine cc-vars cc-defs browse-kill-ring+ browse-kill-ring second-sel ido yasnippet dropdown-list derived edmacro kmacro assoc cl org-habit org-agenda org byte-opt warnings bytecomp byte-compile cconv macroexp ob-emacs-lisp ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint comint ring ob-keys ob ob-eval org-pcomplete pcomplete org-list org-faces org-compat org-entities org-macs noutline outline easy-mmode regexp-opt cal-menu easymenu calendar cal-loaddefs org-install server advice help-fns advice-preload debbugs-autoloads package tabulated-list autorevert delsel time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 12:32:00 2011 Received: (at 9544) by debbugs.gnu.org; 18 Sep 2011 16:32:00 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5KHe-0008CS-Tl for submit@debbugs.gnu.org; Sun, 18 Sep 2011 12:32:00 -0400 Received: from smtprelay-b11.telenor.se ([62.127.194.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5KHb-0008CK-PX for 9544@debbugs.gnu.org; Sun, 18 Sep 2011 12:31:57 -0400 Received: from ipb4.telenor.se (ipb4.telenor.se [195.54.127.167]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id 57989E9F99 for <9544@debbugs.gnu.org>; Sun, 18 Sep 2011 18:26:58 +0200 (CEST) X-SENDER-IP: [85.225.45.201] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AllnAIMbdk5V4S3JPGdsb2JhbABCiRucIIF+CwEBAQE3MoFTAQEFOB4TAQ4BEAsOEw8HDwkDAgECARsMChQGDQEHAQEah1u0O4NxgwcEmGaMEg X-IronPort-AV: E=Sophos;i="4.68,401,1312149600"; d="scan'208";a="1760596224" Received: from c-c92de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.201]) by ipb4.telenor.se with ESMTP; 18 Sep 2011 18:26:54 +0200 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id CA3897FA057; Sun, 18 Sep 2011 18:26:53 +0200 (CEST) Message-ID: <4E761BCD.9060706@swipnet.se> Date: Sun, 18 Sep 2011 18:26:53 +0200 From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Christoph Scholtes Subject: Re: bug#9544: 24.0.50; cc-mode does not indent Qt class correctly References: <86y5xllwa1.fsf@googlemail.com> In-Reply-To: <86y5xllwa1.fsf@googlemail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 9544 Cc: 9544@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.2 (--) Hi. Can't you put a ; after Q_OBJECT, i.e: class Counter : public QObject { Q_OBJECT; public: ? public will then be correctly indented. Non-syntactical macros like this are a pain. I don't think it is possible to handle them except by emulating the preprocessor, which cc-mode does not (I think). Jan D. Christoph Scholtes skrev 2011-09-18 17:12: > With the latest emacs trunk, from `emacs -Q' open *.hpp file with this > content: > > class Counter : public QObject > { > Q_OBJECT > > public: > Counter() { m_value = 0; } > > int value() const { return m_value; } > > public slots: > void setValue(int value); > > signals: > void valueChanged(int newValue); > > private: > int m_value; > }; > > > Note, that the first access modifier `public' is not indented > properly. All Qt other extension modifiers are indented correctly. > > The indentation should look like this: > > class Counter : public QObject > { > Q_OBJECT > > public: > Counter() { m_value = 0; } > > [snip] > > The indentation works correctly when the `Q_OBJECT' macro is > removed. Since cc-mode does support the Qt extensions, it should > also correctly indent this class with the `Q_OBJECT' macro present. > > > > In GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7601) > of 2011-09-17 on MARVIN > Windowing system distributor `Microsoft Corp.', version 6.1.7601 > configured using `configure --with-gcc (4.5) --no-opt --cflags -I"C:/Program Files (x86)/GnuWin32/include" -ID:/devel/emacs/libXpm-3.5.8/include -ID:/devel/emacs/libXpm-3.5.8/src -ID:/devel/emacs/gnutls-2.10.5-x86/include --ldflags -LD:/devel/emacs/gnutls-2.10.5-x86/lib' > > Important settings: > value of $LC_ALL: nil > value of $LC_COLLATE: nil > value of $LC_CTYPE: nil > value of $LC_MESSAGES: nil > value of $LC_MONETARY: nil > value of $LC_NUMERIC: nil > value of $LC_TIME: nil > value of $LANG: ENU > value of $XMODIFIERS: nil > locale-coding-system: cp1252 > default enable-multibyte-characters: t > > Major mode: Emacs-Lisp > > Minor modes in effect: > paredit-mode: t > my-keys-minor-mode: t > erc-autojoin-mode: t > erc-track-mode: t > erc-match-mode: t > erc-pcomplete-mode: t > erc-stamp-mode: t > recentf-mode: t > desktop-save-mode: t > autopair-mode: t > autopair-global-mode: t > ido-everywhere: t > yas/global-mode: t > yas/minor-mode: t > global-auto-revert-mode: t > delete-selection-mode: t > tooltip-mode: t > mouse-wheel-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 > size-indication-mode: t > column-number-mode: t > line-number-mode: t > > Recent input: > M-x c c - m o d e > > > r e o p o r t - b u > C-g C-t C-/ > M-x r e p o r t > > Recent messages: > Quit > Undo! > Loading system routine info in idle time... > Failed to convert XML routine info, falling back on idlw-rinfo. > Could not locate any system routine information. > Loading system routine info in idle time...done > Normalizing idlwave-system-routines in idle time...done > Loading and normalizing library catalogs in idle time...done > Finishing initialization in idle time... > Scanning all buffers... > > Load-path shadows: > None found. > > Features: > (shadow sort gnus-cite mail-extr gnus-msg gnus-art mm-uu mml2015 > epg-config mm-view mml-smime smime password-cache dig mailcap emacsbug > idlwave imenu idlwave-help idlw-help browse-url cc-mode cc-fonts > cc-guess cc-menus cc-cmds vc-hg paredit my-zenburn-theme erc-join > erc-track erc-match erc-pcomplete erc-stamp erc-goodies erc erc-backend > erc-compat thingatpt ispell bookmark+ bookmark+-key dired-x dired > bookmark+-1 nnir gnus-sum nnoo gnus-group gnus-undo nnmail mail-source > gnus-start gnus-spec gnus-int gnus-range message format-spec rfc822 mml > mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 > ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems > nnheader gnus-util mail-utils mm-util mail-prsvr bookmark+-bmu help-mode > view bookmark+-lit pp+ bookmark+-mac bookmark pp recentf tree-widget > wid-edit midnight desktop ibuffer uniquify autopair google-c-style > cc-styles cc-align cc-engine cc-vars cc-defs browse-kill-ring+ > browse-kill-ring second-sel ido yasnippet dropdown-list derived edmacro > kmacro assoc cl org-habit org-agenda org byte-opt warnings bytecomp > byte-compile cconv macroexp ob-emacs-lisp ob-tangle ob-ref ob-lob > ob-table org-footnote org-src ob-comint comint ring ob-keys ob ob-eval > org-pcomplete pcomplete org-list org-faces org-compat org-entities > org-macs noutline outline easy-mmode regexp-opt cal-menu easymenu > calendar cal-loaddefs org-install server advice help-fns advice-preload > debbugs-autoloads package tabulated-list autorevert delsel time-date > tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table > ls-lisp w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode > register page menu-bar rfn-eshadow timer select scroll-bar mouse > jit-lock font-lock syntax facemenu font-core frame cham georgian > utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean > japanese hebrew greek romanian slovak czech european ethiopic indian > cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev > minibuffer button faces cus-face files text-properties overlay sha1 md5 > base64 format env code-pages mule custom widget hashtable-print-readable > backquote make-network-process multi-tty emacs) > > From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 03 18:54:12 2011 Received: (at control) by debbugs.gnu.org; 3 Oct 2011 22:54:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RArOm-0000kg-Jh for submit@debbugs.gnu.org; Mon, 03 Oct 2011 18:54:12 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RArOj-0000kX-4n for control@debbugs.gnu.org; Mon, 03 Oct 2011 18:54:10 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RArNL-0007ab-IH for control@debbugs.gnu.org; Mon, 03 Oct 2011 18:52:43 -0400 Date: Mon, 03 Oct 2011 18:52:43 -0400 Message-Id: Subject: control message for bug 715 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) merge 9544 715 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 28 23:07:02 2015 Received: (at 9544) by debbugs.gnu.org; 29 Dec 2015 04:07:02 +0000 Received: from localhost ([127.0.0.1]:47179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aDlYr-0008NM-Hq for submit@debbugs.gnu.org; Mon, 28 Dec 2015 23:07:02 -0500 Received: from mail-qg0-f48.google.com ([209.85.192.48]:36166) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aDkl3-0006lU-TV; Mon, 28 Dec 2015 22:15:34 -0500 Received: by mail-qg0-f48.google.com with SMTP id e32so67060097qgf.3; Mon, 28 Dec 2015 19:15:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=uBHrMXVzs52xs6S1G0E6hVH7fdWriGo2Utg6CbuNt/A=; b=Wg58KJlA/GFkJIaDE3N+crahbTKyV/TNZUMGNYfo0Y+LXvJseD1p+6KxAmyYH43IKX VVA9401HKX9t5/ycIy1Z5G6CDgq0FKoVC60XBJb9A8VDaFb8PBZUYFDFp2ace8GpBoF5 0jiriKrdVJIMLm//HM8Urhr0D4nxV1vaw5JQUxSFYL8Ne4ScUtYLMJ2agvKXYgLviKAt GeMob3cKUNo5INX+o84mCtcul6HFCyFtjqqEbp9/YzYOu1O5KuQUuyg6t6yVlS/QaLnZ ecdOjUhc41JPQ1zNVuk+gkfk7+nSRfyOjnlnbPrpnpxp+QGHmpeEdHzvZcQYbo8vs2Iw 6cTw== X-Received: by 10.140.104.65 with SMTP id z59mr13854697qge.26.1451358928234; Mon, 28 Dec 2015 19:15:28 -0800 (PST) Received: from Andrews-MacBook-Pro.local.ahyatt-laptop (cpe-74-73-128-199.nyc.res.rr.com. [74.73.128.199]) by smtp.gmail.com with ESMTPSA id t47sm28403360qgt.28.2015.12.28.19.15.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Dec 2015 19:15:26 -0800 (PST) From: Andrew Hyatt To: Jan =?utf-8?Q?Dj=C3=A4rv?= Subject: Re: bug#9544: 24.0.50; cc-mode does not indent Qt class correctly References: <86y5xllwa1.fsf@googlemail.com> <4E761BCD.9060706@swipnet.se> Date: Mon, 28 Dec 2015 22:15:24 -0500 In-Reply-To: <4E761BCD.9060706@swipnet.se> ("Jan \=\?utf-8\?Q\?Dj\=C3\=A4rv\=22's\?\= message of "Sun, 18 Sep 2011 18:26:53 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 9544 X-Mailman-Approved-At: Mon, 28 Dec 2015 23:06:57 -0500 Cc: Christoph Scholtes , 9544@debbugs.gnu.org, 710@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.7 (/) This seems to work fine out of the box for me in Emacs 25. Reading the manual, if you have further problems, the variable c-macro-names-with-semicolon should help (see the info node about this: "Macros with ;"). I'm closing this as unreproducible, but please update if both Emacs 25 and this variable fail to solve the issue. Jan Dj=C3=A4rv writes: > Hi. > > Can't you put a ; after Q_OBJECT, i.e: > > class Counter : public QObject > { > Q_OBJECT; > > public: > > ? > > public will then be correctly indented. Non-syntactical macros like this= are a > pain. I don't think it is possible to handle them except by emulating the > preprocessor, which cc-mode does not (I think). > > Jan D. > > > Christoph Scholtes skrev 2011-09-18 17:12: >> With the latest emacs trunk, from `emacs -Q' open *.hpp file with this >> content: >> >> class Counter : public QObject >> { >> Q_OBJECT >> >> public: >> Counter() { m_value =3D 0; } >> >> int value() const { return m_value; } >> >> public slots: >> void setValue(int value); >> >> signals: >> void valueChanged(int newValue); >> >> private: >> int m_value; >> }; >> >> >> Note, that the first access modifier `public' is not indented >> properly. All Qt other extension modifiers are indented correctly. >> >> The indentation should look like this: >> >> class Counter : public QObject >> { >> Q_OBJECT >> >> public: >> Counter() { m_value =3D 0; } >> >> [snip] >> >> The indentation works correctly when the `Q_OBJECT' macro is >> removed. Since cc-mode does support the Qt extensions, it should >> also correctly indent this class with the `Q_OBJECT' macro present. >> >> >> >> In GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7601) >> of 2011-09-17 on MARVIN >> Windowing system distributor `Microsoft Corp.', version 6.1.7601 >> configured using `configure --with-gcc (4.5) --no-opt --cflags -I"C:/Pro= gram Files (x86)/GnuWin32/include" -ID:/devel/emacs/libXpm-3.5.8/include -I= D:/devel/emacs/libXpm-3.5.8/src -ID:/devel/emacs/gnutls-2.10.5-x86/include = --ldflags -LD:/devel/emacs/gnutls-2.10.5-x86/lib' >> >> Important settings: >> value of $LC_ALL: nil >> value of $LC_COLLATE: nil >> value of $LC_CTYPE: nil >> value of $LC_MESSAGES: nil >> value of $LC_MONETARY: nil >> value of $LC_NUMERIC: nil >> value of $LC_TIME: nil >> value of $LANG: ENU >> value of $XMODIFIERS: nil >> locale-coding-system: cp1252 >> default enable-multibyte-characters: t >> >> Major mode: Emacs-Lisp >> >> Minor modes in effect: >> paredit-mode: t >> my-keys-minor-mode: t >> erc-autojoin-mode: t >> erc-track-mode: t >> erc-match-mode: t >> erc-pcomplete-mode: t >> erc-stamp-mode: t >> recentf-mode: t >> desktop-save-mode: t >> autopair-mode: t >> autopair-global-mode: t >> ido-everywhere: t >> yas/global-mode: t >> yas/minor-mode: t >> global-auto-revert-mode: t >> delete-selection-mode: t >> tooltip-mode: t >> mouse-wheel-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 >> size-indication-mode: t >> column-number-mode: t >> line-number-mode: t >> >> Recent input: >> M-x c c - m o d e >> >> >> r e o p o r t - b u >> C-g C-t C-/ >> M-x r e p o r t >> >> Recent messages: >> Quit >> Undo! >> Loading system routine info in idle time... >> Failed to convert XML routine info, falling back on idlw-rinfo. >> Could not locate any system routine information. >> Loading system routine info in idle time...done >> Normalizing idlwave-system-routines in idle time...done >> Loading and normalizing library catalogs in idle time...done >> Finishing initialization in idle time... >> Scanning all buffers... >> >> Load-path shadows: >> None found. >> >> Features: >> (shadow sort gnus-cite mail-extr gnus-msg gnus-art mm-uu mml2015 >> epg-config mm-view mml-smime smime password-cache dig mailcap emacsbug >> idlwave imenu idlwave-help idlw-help browse-url cc-mode cc-fonts >> cc-guess cc-menus cc-cmds vc-hg paredit my-zenburn-theme erc-join >> erc-track erc-match erc-pcomplete erc-stamp erc-goodies erc erc-backend >> erc-compat thingatpt ispell bookmark+ bookmark+-key dired-x dired >> bookmark+-1 nnir gnus-sum nnoo gnus-group gnus-undo nnmail mail-source >> gnus-start gnus-spec gnus-int gnus-range message format-spec rfc822 mml >> mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 >> ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems >> nnheader gnus-util mail-utils mm-util mail-prsvr bookmark+-bmu help-mode >> view bookmark+-lit pp+ bookmark+-mac bookmark pp recentf tree-widget >> wid-edit midnight desktop ibuffer uniquify autopair google-c-style >> cc-styles cc-align cc-engine cc-vars cc-defs browse-kill-ring+ >> browse-kill-ring second-sel ido yasnippet dropdown-list derived edmacro >> kmacro assoc cl org-habit org-agenda org byte-opt warnings bytecomp >> byte-compile cconv macroexp ob-emacs-lisp ob-tangle ob-ref ob-lob >> ob-table org-footnote org-src ob-comint comint ring ob-keys ob ob-eval >> org-pcomplete pcomplete org-list org-faces org-compat org-entities >> org-macs noutline outline easy-mmode regexp-opt cal-menu easymenu >> calendar cal-loaddefs org-install server advice help-fns advice-preload >> debbugs-autoloads package tabulated-list autorevert delsel time-date >> tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table >> ls-lisp w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode >> register page menu-bar rfn-eshadow timer select scroll-bar mouse >> jit-lock font-lock syntax facemenu font-core frame cham georgian >> utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean >> japanese hebrew greek romanian slovak czech european ethiopic indian >> cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev >> minibuffer button faces cus-face files text-properties overlay sha1 md5 >> base64 format env code-pages mule custom widget hashtable-print-readable >> backquote make-network-process multi-tty emacs) >> >> From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 28 23:07:03 2015 Received: (at control) by debbugs.gnu.org; 29 Dec 2015 04:07:03 +0000 Received: from localhost ([127.0.0.1]:47185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aDlYs-0008Nn-Tk for submit@debbugs.gnu.org; Mon, 28 Dec 2015 23:07:03 -0500 Received: from mail-qg0-f54.google.com ([209.85.192.54]:34399) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aDklT-0006mh-VZ for control@debbugs.gnu.org; Mon, 28 Dec 2015 22:16:00 -0500 Received: by mail-qg0-f54.google.com with SMTP id 6so80269371qgy.1 for ; Mon, 28 Dec 2015 19:15:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:to:from:subject; bh=jshl/9GCxDNWkeqtVLVl7S/wY5ApGPdHHG1dKGXHc2c=; b=luX+GhF+B4hQRZmhBUEmNfvGRw3vzsg3a9xF7KVYV97UuQOYZsaC1tfFzQXt94OOqM zhXUlYIra8smyJMUUK4IVRzhz166JnjFdAbIkgKN6mlJcYPJ5ZDcXhOyMMtvLyX3ynq4 l5jwmpuU7qVTJPSx1OlF8MJ3CSros+nythTBAfTIMA70UPD35G92FqYoRH5SRn8aMRYP ekzTr0nBZRkLy2YmFop+FNk9L3yzdk1uI+vvw9nArZhY0cCGhkpilqLo420U6mHuWeXl QDP4sy3DvFYWeYZfubO90OaIXtuzwc6SAdo9f5T5sHD+hpUg7LmbO2VsYewlBXaXGOtU J5CA== X-Received: by 10.140.43.135 with SMTP id e7mr73616274qga.11.1451358954714; Mon, 28 Dec 2015 19:15:54 -0800 (PST) Received: from Andrews-MacBook-Pro.local.ahyatt-laptop (cpe-74-73-128-199.nyc.res.rr.com. [74.73.128.199]) by smtp.gmail.com with ESMTPSA id i136sm6247499qhc.42.2015.12.28.19.15.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Dec 2015 19:15:54 -0800 (PST) Date: Mon, 28 Dec 2015 22:15:52 -0500 Message-Id: To: control@debbugs.gnu.org From: Andrew Hyatt Subject: control message for bug #710 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-Mailman-Approved-At: Mon, 28 Dec 2015 23:06:57 -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.7 (/) tags 710 unreproducible close 710 From unknown Sat Jun 21 03:04:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 26 Jan 2016 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator