unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: bug-gnu-emacs@gnu.org (Emacs bug Tracking System)
To: Steve Revilak <steve@srevilak.net>
Cc: emacs-bug-tracker@debbugs.gnu.org
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	[thread overview]
Message-ID: <handler.5209.D5209.126230695017465.ackdone@debbugs.gnu.org> (raw)
In-Reply-To: 20091213162210.GC376@srevilak.net

[-- Attachment #1: Type: text/plain, Size: 909 bytes --]

Your message dated Thu, 31 Dec 2009 14:39:02 -0500
with message-id <20091231193902.GB24581@srevilak.net>
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 bug-gnu-emacs@gnu.org
immediately.)


-- 
5209: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5209
Emacs Bug Tracking System
Contact bug-gnu-emacs@gnu.org with problems

[-- Attachment #2: Type: message/rfc822, Size: 8892 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 6337 bytes --]

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 emacs-pretest-bug@gnu.org 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
("Otherwise reindent just the current line"). 




In buffer "foo.c",  "M-x desribe-mode" produces:
---------------------------------
Enabled minor modes: Abbrev Auto-Composition Auto-Compression
Auto-Encryption File-Name-Shadow Font-Lock Global-Auto-Composition
Global-Font-Lock Line-Number Menu-Bar Mouse-Wheel Tool-Bar Tooltip
Transient-Mark

(Information about these minor modes follows the major mode info.)

C/l mode:
Major mode for editing K&R and ANSI C code.
To submit a problem report, enter `C-c C-b' from a
c-mode buffer.  This automatically sets up a mail buffer with version
information already added.  You just need to add a description of the
problem, including a reproducible test case, and send the message.

To see what version of CC Mode you are running, enter `M-x c-version'.

The hook `c-mode-common-hook' is run with no args at mode
initialization, then `c-mode-hook'.

   [rest of describe-mode output omitted]
---------------------------------




M-x c-version produces the following:
---------------------------------
Using CC Mode version 5.31.8
---------------------------------

Finally, the same behavior occurs when emacs is started as "emacs -Q"
(i.e., if the -nw option is ommitted from the command line).


                                 * * *

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
     `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/Applications/Emacs.app/Contents/Resources/etc/DEBUG.


In GNU Emacs 23.1.90.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
  of 2009-12-09 on oatmeal.ma.runwaynine.com
Windowing system distributor `Apple', version 10.3.949
configured using `configure  '--with-ns''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: C
   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: nil
   value of $XMODIFIERS: nil
   locale-coding-system: nil
   default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
   tooltip-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   global-auto-composition-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

Recent input:
ESC x r e p o r t - e m a c s - b u TAB RET

Recent messages:
("/Applications/Emacs.app/Contents/MacOS/Emacs")
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow mail-extr message ecomplete rfc822 mml mml-sec password-cache
mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045
qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util
mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash
mail-utils warnings emacsbug sendmail regexp-opt tooltip ediff-hook
vc-hooks lisp-float-type mwheel ns-win easymenu tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mldrag 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 loaddefs button minibuffer faces cus-face text-properties
overlay md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process ns multi-tty
emacs)

[-- Attachment #2.1.2: Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #3: Type: message/rfc822, Size: 3484 bytes --]

[-- Attachment #3.1.1: Type: text/plain, Size: 849 bytes --]

I've tried this test case with 

   GNU Emacs 23.1.91.1 (powerpc-apple-darwin8.11.0, NS apple-appkit-824.48) of 2009-12-31 on spud
   GNU Emacs 23.1.91.1 (x86_64-apple-darwin10.2.0, NS apple-appkit-1038.25) of 2009-12-31 on oatmeal
   GNU Emacs 23.1.91.1 (i686-pc-linux-gnu, GTK+ Version 2.18.1) of 2009-12-31 on srevilak

The indentation problem no longer occurs with Emacs 23.1.91.1.

Relative to the original "Steps to Reproduce", 

  * 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

[-- Attachment #3.1.2: Type: application/pgp-signature, Size: 195 bytes --]

      parent reply	other threads:[~2010-01-01  0:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20091231193902.GB24581@srevilak.net>
2009-12-13 16:22 ` bug#5209: 23.1.90; CC Mode version 5.31.8 does not indent properly when writing new C files Steve Revilak
2009-12-13 20:33   ` Alan Mackenzie
2009-12-14  1:17     ` Steve Revilak
2010-01-01  0:50   ` Emacs bug Tracking System [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=handler.5209.D5209.126230695017465.ackdone@debbugs.gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=emacs-bug-tracker@debbugs.gnu.org \
    --cc=steve@srevilak.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).