unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23775: 25.0.95.2; c-mode: Incorrect indentation and function bundery detection
@ 2016-06-16  1:05 Rolf Ade
  2016-06-16  1:34 ` Noam Postavsky
       [not found] ` <mailman.1576.1466039228.1216.bug-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Rolf Ade @ 2016-06-16  1:05 UTC (permalink / raw)
  To: 23775


emacs -Q

Open some empty buffer foo.c and put it into c-mode if already is
(M-x c-mdoe). Insert this C code into it:

#define foo
int main (void) {
  int a=0;
  int b=0;
#ifdef foo
  if (a==0) {
#else
    if (b==0) {
#endif
      return 0;
    }
  }

I've inserted it here as emacs -Q indents it, this is the indentation
part of the report.

Place the point at the beginning of function foo, then call
c-end-of-defun, C-M-e by default in emacs -Q. Bell rings, point is
before the last charater of the first line of main, here:

int main (void) _P_{

(which is clearly not the end of the function) and prompts me in the
mini-buffer: "forward-sexp: Scan error: "Unbalanced parentheses", 29,
133"

However well advised such code is, gcc foo.c just compilies.





^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <20160616091839.6925.qmail@mail.muc.de>]

end of thread, other threads:[~2016-06-21 23:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16  1:05 bug#23775: 25.0.95.2; c-mode: Incorrect indentation and function bundery detection Rolf Ade
2016-06-16  1:34 ` Noam Postavsky
     [not found] ` <mailman.1576.1466039228.1216.bug-gnu-emacs@gnu.org>
2016-06-16  9:18   ` Alan Mackenzie
     [not found] <20160616091839.6925.qmail@mail.muc.de>
2016-06-21 23:16 ` Rolf Ade

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).