[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: howw does work c-special-indent-hook, from cc-engine?
From: |
na frederic |
Subject: |
Re: howw does work c-special-indent-hook, from cc-engine? |
Date: |
Thu, 19 May 2005 14:32:31 +0200 (CEST) |
I'm actually trying to setup indentation of a language
which have C-like syntax but with some specific blocks
delimiters
Here is a sample of what I want:
-------------
action my_action
{`
if (a)
{
....
}
else
{
....
}
`};
-------------
when I try to indent this code with native
c-indent-line I have this result:
(this result is due to {` and `}; braces)
-------------
action my_action
{`
if (a)
{
....
}
else
{
....
}
`};
---------------
So I think I've to add a c-special-indent-hook to take
account of this braces and indent correctly this code.
An other particularity of this language is that I've
to set some properties in code with [].
for example:
-------
[
singleton,
createaccess = granted,
deleteaccess = granted,
extentaccess = granted
]
interface my_interface
{
boolean start();
boolean stop();
boolean "refresh"();
};
------
but when I ty to indent this line with native
c-indent-line I 've this result:
[
singleton,
createaccess = granted,
deleteaccess = granted,
extentaccess = granted
]
interface my_interface
{
boolean start();
boolean stop();
boolean "refresh"();
};
----------------
I dont't know very well lisp and cc-engine so if
someon could help me to solve this problem....
--- Alan Mackenzie <acm@muc.de> a écrit:
> na frederic <f_frederic_f_52@yahoo.fr> wrote on Tue,
> 17 May 2005 13:49:20
> +0200 (CEST):
> > is anyone have a sample of code using
> c-special-indent-hook to
> > customize indentation of a derived C-mode.
>
> CC Mode itself does. In "gnu" style, the function
> on
> c-special-indent-hook (that's c-gnu-impose-minimum)
> checks that certain
> lines of code are indented _at least_ one space.
> c-gnu-impose-minimum is
> in cc-align.el, and the setting of the hook is in
> cc-styles.el.
>
> Is there anything in particular which is causing
> problems?
>
> --
> 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").
>
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>
_____________________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails,
photos et vidéos !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com