bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Indentation in c++-mode.


From: Lute Kamstra
Subject: Indentation in c++-mode.
Date: Wed, 16 May 2001 14:17:55 +0200 (CEST)

This bug report will be sent to the Free Software Foundation,
 not to your local site managers!!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Dear people,

In GNU Emacs 20.3.1 (mips-sgi-irix6.2, Motif)
 of Do sep  3 1998 on zeus
configured using `configure  --with-x-toolkit=motif --with-gcc=no 
--prefix=/usr/local/emacs --with-pop'

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

After launching emacs from a shell (under X11) by:

emacs newfile.cc &

I end up in c++-mode in a clean buffer (since the file newfile.cc is
non existent). Then I type the following two lines.

/*/,*/
/*

The first line (as a whole) is a valid c++ comment. The second line is
the opening of a c++ comment. After typing the last '*' (in the second
line), the second line is indented by two spaces. The result looks
like this:

/*/,*/
  /*

I consider this a bug. For one thing, the comment in the first line
was closed and should not affect the comment in the second line. For
another, c++ comments of the type '/*' ... '*/' are not allowed to
nest and as a result should not be indented.

Interestingly, had I typed a space instead of a comma in the first
line, the indentation would not have happened. So had I typed:

/*/ */
/*

then the second line would not be indented.

Note: This behaviour is the same when emacs is invoked with the -q
option (so without using my .emacs file) and in version 20.7 on my
linux box.

Recent input:
/ * / , * / return / * menu-bar help-menu report-e
macs-bug

Recent messages:
For information about the GNU Project and its goals, type C-h C-p.
newfile.cc has auto save data; consider M-x recover-file
Loading cc-mode...
Loading cc-mode...done
Loading outline...
Loading outline...done
Loading regexp-opt...
Loading regexp-opt...done
Loading emacsbug...
Loading emacsbug...done

Hope you find this useful.

Kind regards and happy hacking,

  Lute Kamstra.

----------------------------------------------------------------------
Lute Kamstra                                      "Mailed from Emacs, 
CWI department PNA4                               the One True Editor"
Office M233
email: Lute.Kamstra@cwi.nl                    phone: (+31) 20 592 4214
----------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]