From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Hyatt Newsgroups: gmane.emacs.bugs Subject: bug#710: bug#9544: 24.0.50; cc-mode does not indent Qt class correctly Date: Mon, 28 Dec 2015 22:15:24 -0500 Message-ID: References: <86y5xllwa1.fsf@googlemail.com> <4E761BCD.9060706@swipnet.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1451362054 22266 80.91.229.3 (29 Dec 2015 04:07:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Dec 2015 04:07:34 +0000 (UTC) Cc: Christoph Scholtes , 9544@debbugs.gnu.org, 710@debbugs.gnu.org To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 29 05:07:25 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aDlZC-00084C-Rg for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Dec 2015 05:07:23 +0100 Original-Received: from localhost ([::1]:47017 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDlZC-0005nF-6O for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Dec 2015 23:07:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDlYz-0005RB-Pd for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2015 23:07:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aDlYw-0002rt-8p for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2015 23:07:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDlYw-0002rp-5E; Mon, 28 Dec 2015 23:07:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aDlYw-0008Oy-0h; Mon, 28 Dec 2015 23:07:06 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Hyatt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 29 Dec 2015 04:07:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 710 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 710-submit@debbugs.gnu.org id=B710.145136202332230 (code B ref 710); Tue, 29 Dec 2015 04:07:05 +0000 Original-Received: (at 710) by debbugs.gnu.org; 29 Dec 2015 04:07:03 +0000 Original-Received: from localhost ([127.0.0.1]:47182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aDlYs-0008NZ-7n for submit@debbugs.gnu.org; Mon, 28 Dec 2015 23:07:02 -0500 Original-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 Original-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) Original-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) 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") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:110944 Archived-At: 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) >> >>