GNU bug report logs - #1953
Syntax Highlighting Problem in c++-mode

Previous Next

Packages: cc-mode, emacs;

Reported by: "Jordan Saunders" <jmsaunders <at> gmail.com>

Date: Mon, 19 Jan 2009 04:00:04 UTC

Severity: normal

Tags: moreinfo

Done: Glenn Morris <rgm <at> gnu.org>

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 1953 in the body.
You can then email your comments to 1953 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#1953; Package emacs. (Mon, 19 Jan 2009 04:00:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Jordan Saunders" <jmsaunders <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 19 Jan 2009 04:00:04 GMT) Full text and rfc822 format available.

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

From: "Jordan Saunders" <jmsaunders <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Syntax Highlighting Problem in c++-mode
Date: Sun, 18 Jan 2009 22:28:04 -0500
[Message part 1 (text/plain, inline)]
Given the following circumstance in c++-mode:

class blah
{
    blah(int) {}
};

blah::blah is not recognized by the syntax highlighter as a constructor and
the syntax highlighting is incorrect. If we give the first parameter an
actual name (i.e. int a, for example), it is recognized and things are
peachy.

Thank you.


In GNU Emacs 22.3.1 (i386-mingw-nt6.0.6001)
 of 2008-09-06 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 6.0.6001
configured using `configure --with-gcc (3.4)'

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: ENC
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: C++/l

Minor modes in effect:
  encoded-kbd-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t
  abbrev-mode: t

Recent input:
<wheel-down> <wheel-down> <wheel-down> <wheel-down>
<wheel-down> <wheel-down> <wheel-up> <double-wheel-up>
<triple-wheel-up> <wheel-down> <help-echo> <C-up> <C-up>
<C-up> <C-up> <down> <down> <end> <left> <left> SPC
b a <backspace> l a h <C-backspace> <backspace> C-x
C-s <help-echo> <help-echo> <help-echo> M-x r e p o
r t - e m <tab> <return>

Recent messages:
("C:\\emacs-22.3\\bin\\emacs.exe" "C:\\home\\ogawd\\util\\matrix.h")
Loading encoded-kb...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading cc-mode...done
Wrote c:/home/ogawd/util/matrix.h
Loading emacsbug...done
[Message part 2 (text/html, inline)]

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1953; Package emacs. (Mon, 19 Jan 2009 15:25:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 19 Jan 2009 15:25:04 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Alan Mackenzie  <acm <at> muc.de>
Cc: "Jordan Saunders" <jmsaunders <at> gmail.com>, 1953 <at> debbugs.gnu.org
Subject: Re: Syntax Highlighting Problem in c++-mode
Date: Mon, 19 Jan 2009 10:18:16 -0500
Hi Alan,

Here's a bug report about C++ highlighting (for Emacs 22, I didn't check
if it exists with CVS Emacs).


"Jordan Saunders" <jmsaunders <at> gmail.com> wrote:

> Given the following circumstance in c++-mode:
>
> class blah
> {
>     blah(int) {}
> };
>
> blah::blah is not recognized by the syntax highlighter as a constructor
> and
> the syntax highlighting is incorrect. If we give the first parameter an
> actual name (i.e. int a, for example), it is recognized and things are
> peachy.




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1953; Package emacs. (Tue, 20 Jan 2009 12:05:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Tue, 20 Jan 2009 12:05:05 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: Jordan Saunders <jmsaunders <at> gmail.com>, 1953 <at> debbugs.gnu.org
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#1953: Syntax Highlighting Problem in c++-mode
Date: Tue, 20 Jan 2009 12:13:47 +0000
Hi, Jordan,

On Sun, Jan 18, 2009 at 10:28:04PM -0500, Jordan Saunders wrote:
> Given the following circumstance in c++-mode:

> class blah
> {
>     blah(int) {}
> };

> blah::blah is not recognized by the syntax highlighter as a constructor and
> the syntax highlighting is incorrect.

I'm not quite sure what you mean here.  When a function is used (as
opposed to being declared), it is not given a special font; when it is
declared, it gets font-lock-function-name-face.  Class members, including
its constructors, count as "functions" here.

> If we give the first parameter an actual name (i.e. int a, for
> example), it is recognized and things are peachy.

Would you please supply an actual short example of what is going wrong.
C++ is an unusually difficult and complicated language to parse, and
there are certainly some bugs in C++ Mode at the moment.  It would be
nice to fix them.

> Thank you.

Thanks for taking the trouble to report the bug.

-- 
Alan Mackenzie (Nuremberg, Germany).





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1953; Package emacs. (Tue, 20 Jan 2009 12:05:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Tue, 20 Jan 2009 12:05:07 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. (Tue, 20 Jan 2009 21:05:05 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 1953 <at> debbugs.gnu.org and "Jordan Saunders" <jmsaunders <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 17 Feb 2013 02:14:02 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. (Sun, 17 Mar 2013 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 160 days ago.

Previous Next


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