unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* howw does work c-special-indent-hook, from cc-engine?
@ 2005-05-17 11:49 na frederic
  0 siblings, 0 replies; 3+ messages in thread
From: na frederic @ 2005-05-17 11:49 UTC (permalink / raw)


is anyone have a sample of code using
c-special-indent-hook to customize indentation of a
derived C-mode.



	

	
		
_____________________________________________________________________________ 
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

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

* Re: howw does work c-special-indent-hook, from cc-engine?
       [not found] <mailman.20.1116348802.5177.help-gnu-emacs@gnu.org>
@ 2005-05-18 15:08 ` Alan Mackenzie
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Mackenzie @ 2005-05-18 15:08 UTC (permalink / raw)


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

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

* Re: howw does work c-special-indent-hook, from cc-engine?
@ 2005-05-19 12:32 na frederic
  0 siblings, 0 replies; 3+ messages in thread
From: na frederic @ 2005-05-19 12:32 UTC (permalink / raw)


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

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

end of thread, other threads:[~2005-05-19 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.20.1116348802.5177.help-gnu-emacs@gnu.org>
2005-05-18 15:08 ` howw does work c-special-indent-hook, from cc-engine? Alan Mackenzie
2005-05-19 12:32 na frederic
  -- strict thread matches above, loose matches on Subject: below --
2005-05-17 11:49 na frederic

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