From: Alan Mackenzie <acm@muc.de>
To: "Tobias.Schlueter"
<Tobias.Schlueter@zuppc13.physik.uni-muenchen.de>,
4187@emacsbugs.donarmstrong.com
Cc: bug-cc-mode@gnu.org, bug-gnu-emacs@gnu.org, tobi@schlueters.de
Subject: bug#4187: Bug with indentation / parens matching in C++-mode
Date: Fri, 21 Aug 2009 14:56:54 +0000 [thread overview]
Message-ID: <20090821145654.GA1897@muc.de> (raw)
In-Reply-To: <20090818120421.D52BD58182@zuppc13.physik.uni-muenchen.de>
Hi, Tobias!
On Tue, Aug 18, 2009 at 02:04:21PM +0200, Tobias.Schlueter wrote:
> In GNU Emacs 21.4.1 (i686-redhat-linux-gnu, X toolkit, Xaw3d scroll bars)
> of 2008-01-04 on norob.fnal.gov
OK, Emacs 21.4. That's very old. Emacs 22 was released in June 2007.
Emacs 23 was released a few weeks ago, on 30th July. You could do worse
than upgrading (or persuading your sysadmins to upgrade). Emacs 21
contained CC Mode 28, which is so old as to be barely supportable. If
you can't upgrade your Emacs, you could certainly install a newer version
of CC Mode in one of your own directories (see
<http://cc-mode.sf.net/release.php>).
> Type the following into a buffer which is in C++ mode.
What version of CC Mode are you using (M-x c-version)? Have you or
anybody else customised CC Mode at all? It might well help to see your
complete CC Mode configuration (C-c C-b from within your C++ buffer,
followed by cutting and pasting).
> Try to get correct indentation for the second line of the while
> condition or the line following it by hitting the TAB key. In my case
> this fails miserably. Modifying the while condition to fix this
> behaves rather erratically, adding parentheses at least doesn't fix it.
Just as a suggestion, it might help things if you put a proper function
header before the opening "{". It might not, though.
People's opinions differ on what "correct" indentation is, which is why
you can (and, sadly, MUST) configure it. So could you please say how you
would like the line to be indented.
One thing you could do is, with point on the "&& count" line, C-c C-s.
This will give the syntactic analysis of the line, something like:
Syntactic analysis: ((arglist-cont-nonempty 347 355))
. This says "the line is a continued argument list whose "anchor points"
are at buffer positions 347 and 355". This is explained in the CC Mode
manual in full detail.
Now try C-c C-o. It will prompt you with something like:
Syntactic symbol to change: arglist-cont-nonempty
, and when you hit <CR>, you'll get, say,:
arglist-cont-nonempty offset (default (c-lineup-gcc-asm-reg c-lineup-arglist)):
, where you can type the new "offset" that you want. Try entering "+",
or "++" or "*" or "-" here, just to get an idea of how this works. Then
hit the <tab> key. Again, the full details of all this stuff are in the
CC Mode manual. I can give you better help once you've replied with the
details I've asked for.
> {
> do {
> } while (fabs(chi2 - oldChi2) > 0
> && count < iterMax);
> x= 1;
> }
> You can reach me under tobi@schlueters.de, I don't know if this
> interface will place the right sender address on the mail.
It didn't, but I have. :-) I've also directed your reply to
bug-cc-mode@gnu.org, which is a more specific mailing list.
> I guess the stuff emacs put below will not be of much help, so I'm
> cutting it (recent input, the bug appears independent of my input).
Thanks!
> Cheers,
> - Tobias Schlüter
Schöne Grüße aus Nürnberg!
--
Alan Mackenzie.
next prev parent reply other threads:[~2009-08-21 14:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-18 12:04 bug#4187: Bug with indentation / parens matching in C++-mode Tobias.Schlueter
2009-08-21 14:56 ` Alan Mackenzie [this message]
2009-09-22 8:51 ` Tobias Schlüter
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=20090821145654.GA1897@muc.de \
--to=acm@muc.de \
--cc=4187@emacsbugs.donarmstrong.com \
--cc=Tobias.Schlueter@zuppc13.physik.uni-muenchen.de \
--cc=bug-cc-mode@gnu.org \
--cc=bug-gnu-emacs@gnu.org \
--cc=tobi@schlueters.de \
/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.