bug#5209: marked as done (23.1.90; CC Mode version 5.31.8 does not inden

From:

Emacs bug Tracking System

Subject:

bug#5209: marked as done (23.1.90; CC Mode version 5.31.8 does not indent properly when writing new C files)

Date:

Fri, 01 Jan 2010 00:50:03 +0000

Your message dated Thu, 31 Dec 2009 14:39:02 -0500
with message-id <address@hidden>
and subject line Re: CC Mode version 5.31.8 does not indent properly when
writing new C files
has caused the Emacs bug report #5209,
regarding 23.1.90; CC Mode version 5.31.8 does not indent properly when writing
new C files
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact address@hidden
immediately.)
--
5209: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5209
Emacs Bug Tracking System
Contact address@hidden with problems

--- Begin Message ---

Subject:

23.1.90; CC Mode version 5.31.8 does not indent properly when writing new C files

Date:

Sun, 13 Dec 2009 11:22:10 -0500

User-agent:

Mutt/1.5.19 (2009-01-05)

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.
Your bug report will be posted to the address@hidden mailing list.
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug. If you can, give
a recipe starting from `emacs -Q':
* * *
STEPS TO REPRODUCE
------------------
(1) Start emacs with the command line "emacs -nw -Q foo.c".
foo.c should be a new file, which does not exist prior to starting
emacs.
(2) Type "#include <stdio.h>" and RETURN
(3) Type RETURN to leave a blank line
(4) type "static void add_one(int * x) {" and RETURN
(5) type "*x += 1;" and RETURN
(6) type "}" and RETURN (to close the function definition)
NOTE: the statement written in step (5) is left-aligned to column
zero. The statement should be indented.
(7) Place point in column zero of the line "*x += 1;". Press TAB.
Before pressing TAB, "*x += 1;" is aligned to column zero. After
pressing TAB, "*x += 1;" is still aligned to column zero. TAB did
not indent the statement.
(8) Type "C-x h TAB" (i.e., to select and re-indent the entire
buffer).
The minibuffer displays "Indenting region... done". However, the
statement "*x += 1;" is still aligned to column zero.
After step 8, buffer "foo.c" looks like this:
---------------------------------
#include <stdio.h>
static void add_one(int * x) {
*x += 1;
}
---------------------------------
NOTE: the fourth line is not indented (but it should be).
NOTES:
-----
In buffer "foo.c", "M-x describe-key RET TAB" produces:
---------------------------------
TAB runs the command c-indent-line-or-region, which is an interactive
compiled Lisp function in `cc-cmds.el'.
It is bound to TAB, <menu-bar> <C> <Indent Line or Region>.
(c-indent-line-or-region &optional ARG REGION)
Indent active region, current line, or block starting on this line.
In Transient Mark mode, when the region is active, reindent the region.
Otherwise, with a prefix argument, rigidly reindent the expression
starting on the current line.
Otherwise reindent just the current line.
---------------------------------
NOTE: In step (8), when the entire buffer was selected, with transient
mark mode enabled, TAB did not re-indent the region correctly.
Likewise, in step (7) TAB did not re-indent the current line

* In step (5), typing the final semicolon causes the line "*x += 1;"
to be indented properly
* If I delete leading whitespace from "*x += 1;" and perform step (7),
then pressing TAB correctly indents the line.
* If I delete leading whitespace from "*x += 1;" and perform step
(8), then I find C-x h ESC C-\ correctly re-indents the entire
buffer.
Nice work!
Steve