help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tabs and Spaces


From: Pascal J. Bourguignon
Subject: Re: Tabs and Spaces
Date: Mon, 25 May 2009 18:38:00 +0200
User-agent: Gnus/5.101 (Gnus v5.10.10) Emacs/22.2 (gnu/linux)

use.address@my.homepage.invalid (Chris Gordon-Smith) writes:

> Teemu Likonen <tlikonen@iki.fi> wrote:
>> On 2009-05-25 14:58 (UTC), Chris Gordon-Smith wrote:
>> 
>>> C++. But I had already established before my original post that the
>>> standard emacs indenting would not suit me. Perhaps I should have
>>> mentioned this.
>> 
>> Fortunately C++ indentation is very much configurable. There are several
>> predefined styles which you can change with "C-c ." (c-set-style)
>> command. If none of them suit you you can create your own. For more info
>> see the CC Mode info node
>> 
>>    C-h i d m CC Mode RET
>
> Thanks.
>
> I think the complicating factor for me is that I use my own syntax, with 
> macros instead of curly brackets ({}). This is not generally liked in the 
> C++ world, but it works well for me. For example:-
>
> #define THEN {  // Macro for modified syntax
> // etc...
>
> int x = 10;
> if (x ==9)
> THEN    
> //    Do Something
> ELSEIF (x == 9)
> THEN
> //    Do something else
> ELSE
> //    Do yet another thisg
> ENDIF
>
> I doubt whether any of the existing indenting styles can cope with this, so 
> I suppose I'll need to write a new configuration.
>
> Until I know how to do this, I would like a very simple behaviour in which 
> pressing tab simply causes the relevant number of spaces to be inserted.

Yes, indeed you will have to implement your own parsing.

If your macros could result in a syntax close enough to Pascal or
Modula-2 you could try to use one of these language mode.  But it
won't work well until you code your own indentation stuff.

Check cedet!


-- 
__Pascal Bourguignon__


reply via email to

[Prev in Thread] Current Thread [Next in Thread]