From: Alan M. <ac...@mu...> - 2008-05-04 20:03:16
|
Hi, Étienne! On Sun, May 04, 2008 at 06:06:06PM +0200, Étienne Bersac wrote: > Hi, > I'm writing vala-mode based on csharp-mode. Vala is a language ???with > a syntax similar to C# that output C/GObject code. > This language allow to add extra information for the compiler using > "attribute" with the following synthax : > [Attribute] > public Type? var = null; > I can't get emacs not to increase indentation of line following > [Attribute] :(. How to ? OK. First thing is, "]" doesn't end "statements" in C like languages, so some ad hoc stuff will be needed. Just as a quick test, please try putting a ";" on the line like this: [Attribute] ; , and see whether that fixes the indentation. I think it should. If so, I would suggest writing a routine which would detect a "virtual semicolon" at the end of an "[Attribute]" construct. The "virtual semicolon" mechanism is explained in cc-defs.el starting at about line 745. You'd have to write a vala-mode function for c-at-vsemi-p-fn, and possibly one for c-vsemi-status-unknown-p-fn, two language specific variables in cc-langs.el. The functions for AWK Mode should serve as an example. > Thanks for your help. No problem! Get back to me if you need any more! > Regards, > Étienne. -- Alan Mackenzie (Nuremberg, Germany). |