GNU bug report logs - #710
qt-special labels not syntactically recognized?

Previous Next

Packages: cc-mode, emacs;

Reported by: dejfson <at> gmail.com

Date: Wed, 13 Aug 2008 14:35:03 UTC

Severity: normal

Tags: unreproducible

Merged with 715, 9544

Found in version 24.0.50

Done: Andrew Hyatt <ahyatt <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 710 in the body.
You can then email your comments to 710 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#710; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to bug-gnu-emacs <at> gnu.org:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: dejfson <dejfson <at> gmail.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: qt-special labels not syntactically recognized?
Date: Wed, 13 Aug 2008 14:31:48 +0000
Hi, dejfson!

On Mon, Aug 11, 2008 at 01:05:40PM +0200, dejfson wrote:
> Dear All,

> i've been working for some time on elisp and c++-mode and I have
> noticed one thing. When using `c-show-syntactic-information' against
> QT class header files, the label structures as 'protected slots:' and
> 'signals:' are not recognized correctly.

> I know that these are not C++ standards, however is there any way how
> to include them to the indent-parser to be recognized?

CC Mode does handle the QT constructs like "signals:" and "slots:",
though there could well be bugs in that bit of the code.

> The 'signals:' label is correctly recognized, however
> indentation/coloring is not the same of kind as
> 'public/protected/private:' labels in class declaration.  The combined
> form 'protected slots' is not recognized at all. It is identified as
> 'statement', colored as the other statements.

These things are handled OK in one of CC Mode's test files.

Could you send me some sample C++ code, preferably reduced to just a few
lines, which illustrates all these problems, please.  Please describe
exactly what you get, and also say what you expect, and how that differs
from what you actually get.

Also, most importantly, would you supply information on what versions of
(X)Emacs/CC Mode you're using.  The easiest way to do that is with C-c
C-b, which initialises an email buffer.  Please do this and send me all
the configuration information that this generates.  This will help me
track down the problem and fix it.

> thanks

> d.

-- 
Alan Mackenzie (Nuremberg, Germany).





bug reassigned from package `emacs' to `emacs,cc-mode'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 13 Aug 2008 17:05:07 GMT) Full text and rfc822 format available.

bug reassigned from package `emacs,cc-mode' to `emacs'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Fri, 15 Aug 2008 01:30:03 GMT) Full text and rfc822 format available.

Forcibly Merged 710 715. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Fri, 15 Aug 2008 01:30:03 GMT) Full text and rfc822 format available.

bug reassigned from package `emacs' to `emacs,cc-mode'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Fri, 15 Aug 2008 01:30:03 GMT) Full text and rfc822 format available.

Changed bug submitter to 'dejfson <at> gmail.com' from 'bug-gnu-emacs <at> gnu.org' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 28 Jan 2010 20:28:02 GMT) Full text and rfc822 format available.

Added tag(s) unreproducible and moreinfo. Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Thu, 24 Jun 2010 18:24:03 GMT) Full text and rfc822 format available.

Merged 710 715 9544. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 03 Oct 2011 22:55:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#710; Package emacs,cc-mode. (Tue, 29 Dec 2015 04:07:05 GMT) Full text and rfc822 format available.

Message #22 received at 710 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Hyatt <ahyatt <at> gmail.com>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: Christoph Scholtes <cschol2112 <at> googlemail.com>, 9544 <at> debbugs.gnu.org,
 710 <at> debbugs.gnu.org
Subject: Re: bug#9544: 24.0.50; cc-mode does not indent Qt class correctly
Date: Mon, 28 Dec 2015 22:15:24 -0500
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ärv <jan.h.d <at> swipnet.se> 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 = 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<tab>  <tab>  <tab>  <backspace>  <backspace>
>> <backspace>  <backspace>  <tab>  <backspace>  <backspace>
>> <backspace>  <backspace>  <backspace>  <backspace>  <backspace>
>> r e o<backspace>  p o r t - b u<tab>  <tab>  <tab>  <tab>
>> <tab>  <backspace>  <backspace>  <backspace>  C-g C-t C-/
>> M-x r e p o r t<tab>  <return>
>>
>> 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)
>>
>>




Added tag(s) unreproducible. Request was from Andrew Hyatt <ahyatt <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 29 Dec 2015 04:07:06 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 710 <at> debbugs.gnu.org and dejfson <at> gmail.com Request was from Andrew Hyatt <ahyatt <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 29 Dec 2015 04:07:07 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 26 Jan 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 148 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.