all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: Kevin Burge <kevin.burge@systemware.com>
Cc: 12926@debbugs.gnu.org
Subject: bug#12926: emacs 4.2: cc-mode confused by indented preprocessor statements
Date: Sun, 14 Aug 2016 15:03:24 -0600	[thread overview]
Message-ID: <87a8gfqd0j.fsf@gmail.com> (raw)
In-Reply-To: <87haomygr3.wl%kevin.burge@systemware.com> (Kevin Burge's message of "Sun, 18 Nov 2012 11:15:28 -0600")

close 12926 24.5
quit

Kevin Burge <kevin.burge@systemware.com> writes:

> - If you indent the following code with gcc 4.2, by highlighting lines 06-10
> and indenting, it confuses line 07 as the first line of a function rather than
> the first line of a statement, and so everything is shifted left.
>
> - If you move the preprocessor lines 02 and 04 back to column 1, it indents
> correctly.
>
> - If you change "#if defined(A)" to "#if 0" while still indented, it indents
> correctly.
>
> There is just something that cc-mode does not like about indented preprocessor
> statements.  4.1 exhibited the same behavior, and prevents us from upgrading
> from 23.4.
>
> IMPORTANT: you MUST close and re-open the file between these tests because the
> caching in cc-mode interferes with the results.
>
> 01 int f(void) {
> 02    #if defined(A)
> 03    printf("test\n");
> 04    #endif
> 05
> 06    if (test) {
> 07        int i = 0;
> 08        printf();
> 09    }
> 10 }
>
> The source:
>
> int f(void) {
>     #if defined(A)
>     printf("test\n");
>     #endif
>
>     if (test) {
>         int i = 0;
>         printf();
>     }
> }
>
> Thank you,
> Kevin Burge

This appears to work correctly in Emacs 24.5.





      reply	other threads:[~2016-08-14 21:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-18 17:15 bug#12926: emacs 4.2: cc-mode confused by indented preprocessor statements Kevin Burge
2016-08-14 21:03 ` Alex [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

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

  git send-email \
    --in-reply-to=87a8gfqd0j.fsf@gmail.com \
    --to=agrambot@gmail.com \
    --cc=12926@debbugs.gnu.org \
    --cc=kevin.burge@systemware.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.