all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* indenting for managed c++
@ 2005-10-11  8:01 Yogesh.Sajanikar
  0 siblings, 0 replies; 2+ messages in thread
From: Yogesh.Sajanikar @ 2005-10-11  8:01 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 368 bytes --]

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               
    {
    private public:             // ((inher-cont 134))
    };

Regards,
~Yogesh
 

[-- Attachment #1.2: Type: text/html, Size: 1414 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: indenting for managed c++
       [not found] <mailman.10838.1129017766.20277.help-gnu-emacs@gnu.org>
@ 2005-10-12  8:29 ` Alan Mackenzie
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Mackenzie @ 2005-10-12  8:29 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-12  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.10838.1129017766.20277.help-gnu-emacs@gnu.org>
2005-10-12  8:29 ` indenting for managed c++ Alan Mackenzie
2005-10-11  8:01 Yogesh.Sajanikar

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.