[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-users
Subject:    Re: [ jEdit-users ] Auto indentation in Ada.
From:       "Peter C. Chapin" <Peter.Chapin () vtc ! vsc ! edu>
Date:       2008-02-12 1:07:35
Message-ID: 47B0F157.2030402 () vtc ! vsc ! edu
[Download RAW message or body]

Kazutoshi Satoda wrote:

> Peter C. Chapin wrote:
>> This doesn't have the desired effect. What I want is for the "end 
>> if;" line to be unindented automatically (it starts out indented, of 
>> course). 
>
> I think the property "electricKeys" might help. Unfortunately it seems
> not documented for now. Please look for other modes which have it.

Cool. The "electricKeys" property does help. I now have

    <PROPS>
        <PROPERTY NAME="lineComment" VALUE="--" />
        <PROPERTY NAME="indentNextLines"
            
VALUE=".*(is|begin|declare|loop|then|else|elsif|with|record|=>|:=)\s*$"/>
        <PROPERTY NAME="unindentThisLine"
            VALUE="^\s*end(\s|;).*"/>
        <PROPERTY NAME="electricKeys" VALUE=";"/>
    </PROPS>

When I type

    if A = B then
       X := Y;
       end if

As soon as I type the ";" at the end of the "end if", the line unindents 
exactly as desired. Great! But... the next line is still indented and it 
shouldn't be. I guess "unindentThisLine" only applies to a single 
line... as might be expected from the name. I recall the documentation 
saying something to that effect as well. I need the change in 
indentation level to be permanent (well... until I type something new 
that requires an increase in indentation of course).

I realize that the "indentOpenBrackets" and "indentCloseBrackets" 
properties were designed for the kind of effect I'm looking for. 
However, the values of those properties are not regular expressions 
(right?) so they really only seem to work when the "close bracket" is 
the same string for all blocks. I tried

    <PROPERTY NAME="indentCloseBrackets" VALUE="end"/>

But that didn't seem to do much.

I looked at some of the other editing modes for languages that use 
multi-character block ending strings. For example, Ada is syntactically 
similar to Pascal and there is a Pascal mode. However, Pascal mode 
doesn't appear to support auto-indentation either. Is it even possible 
to configure a jEdit editing mode in this way? I'm starting to think 
maybe not.

Peter


["Peter_Chapin.vcf" (text/x-vcard)]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

-- 
-----------------------------------------------
jEdit Users' List
jEdit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic