From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: indenting for managed c++ Date: Wed, 12 Oct 2005 08:29:14 +0000 Organization: muc.de e.V. -- private internet access Message-ID: References: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1129109598 632 80.91.229.2 (12 Oct 2005 09:33:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 12 Oct 2005 09:33:18 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 12 11:33:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EPcwx-0002yK-9V for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Oct 2005 11:31:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EPcww-0002SL-D6 for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Oct 2005 05:31:02 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed.freenet.de!ecngs!feeder2.ecngs.de!newsfeed.stueberl.de!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1129105454 40198 193.149.49.134 (12 Oct 2005 08:24:14 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 12 Oct 2005 08:24:14 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:134580 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:30160 Archived-At: 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").