From: Alan Mackenzie <acm@muc.de>
Subject: Re: indenting for managed c++
Date: Wed, 12 Oct 2005 08:29:14 +0000 [thread overview]
Message-ID: <qghiid.46.ln@acm.acm> (raw)
In-Reply-To: mailman.10838.1129017766.20277.help-gnu-emacs@gnu.org
Yogesh.Sajanikar@bentley.com wrote on Tue, 11 Oct 2005 10:01:42 +0200:
> Can anybody tell me how to indent managed c++ code (.NET 2003)
> correctly. The access specifiers are incorrectly classified as
> inher-cont. For example, look at the following code,
> public class C : // ((inher-cont 19))
> private A =20
> {
> private public: // ((inher-cont 134))
> };
What is the "public" on the first line for? Is "Managed C++" a
non-standard extension of C++?
Supporting this properly would mean extending the indentation engine in
CC Mode. If you want to try this, the function is `c-guess-basic-syntax'
in the file cc-engine.el. Fair warning: this isn't something for the
faint-hearted. ;-)
Alternatively, you could write a line-up function for inher-cont which
would recognise that the line is really a topmost-intro (or whatever),
and then call c-indent-line, giving this tweaked syntactic context as a
parameter: Something like this:
You take the "((inher-cont 19))", change it to "((topmost-intro 19))",
then call "(c-indent-line '((topmost-intro 19)))".
I know, it's not very satisfactory. But it's possible.
> Regards,
> ~Yogesh
--
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").
next parent reply other threads:[~2005-10-12 8:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.10838.1129017766.20277.help-gnu-emacs@gnu.org>
2005-10-12 8:29 ` Alan Mackenzie [this message]
2005-10-11 8:01 indenting for managed c++ Yogesh.Sajanikar
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=qghiid.46.ln@acm.acm \
--to=acm@muc.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.
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).