On Wednesday 05 March 2008 12:03 pm, Bert Wesarg wrote:

> You should only use the 'E' in our examples, the '+' should only be
> used for a closed folding.

Yes--you're absolutely right!
 
> anyway, I can't see an advantage for this 'E', so maybe you could give
> an example and an rational for this.

Let me start from the earlier example (and see if I can get there)--did you by 
any chance try to look at that criteria document in kate (with the 
folding .xml file applied)?  

If you did, you'll see--oops, I screwed up--that's embarrassing--I didn't test 
that file in kate after creating it--let me fix that, I'll let you know when 
it's fixed, and then I'll get back to here.  

(Well, actually, I created that file in kate, and it did work, but I didn't 
copy the entire record, forgetting that the folding login in the .xml file 
works only within a record--I'll try to explain more later after I get the 
example fixed.)

In the meantime, maybe I'll try a simple explanation in words, and put the E 
in place of the +:

-  \chapter{1}
|    Introduce chapter 1
-    \section{1.1}
|      Some infos for section 1.1
E      last line of section 1.1
-    \section{1.2}
|      because section 1.2 starts
L      last line of section 1.2 and chapter 1
-  \chapter{2}
L    because chapter 2 starts

In general, an L marks the end of all "current" folding regions.  The E, on 
the other hand, marks the end of a "local" folding region--if you would fold 
that region it could still be folded further.  (Hmm, I think I did a better, 
if wordier, explanation below.)

(BTW, maybe this is exactly what you're getting at below with your question 
about "partial intersected folding regions".)

More specifically, let's look at my example from the WikiLearn page, but with 
ASCII art and a 2nd Level 3 heading added:

- ---+ A level 1 heading
| [optional text]
- ---++ A level 2 heading
| [optional text]
- ---+++ A level 3 heading
E [optional text]
- ---+++ Another level 3 heading
L [optional text] 
- ---+ Another level 1 heading

Similar to the example on WikiLearn, three folding regions end at the end of 
the optional text after the (added) *2nd* Level 3 heading, those being the 
folding regions associated with the first Level 1 heading, the Level 2 
heading, and (now, different than the example on WikiLearn) the *2nd* Level 3 
heading.

Note that the folding region associated with the first Level 3 heading does 
not end there, but instead ends at the end of the optional text associated 
with it.  

And note further, that the "current" Level 1 and Level 2 folding regions do 
not end there, but, as described in the previous paragraph, at the end of the 
optional text associated with the *2nd* Level 3 heading.  

Thus, the end of the folding region associated with the first Level 3 heading 
(marked with an E in the ASCII art) is an intermediate end--it ends some of 
the "current" folding regions (in this case, only one) but not all of them.  
"E"s mark such occurrences, "L"s mark the end of all "current" folding 
regions. 

> A next point I don't understand is, is it right, that the folding
> engine should also handle partial intersected folding regions?
> 
> -
> |
> |-
> ||
> L|
>  |
>  L

I'll have to think about that some more, unless my previous discussion 
answered the question. I mean, in general, folding regions can overlap, and 
nedit should handle such overlapping folding regions, but, trying to think of 
the right words, I expect that overlap is sort of "normalized" or "proper", 
sort of like, iirc, HTML markup can be "proper" (not the word I'm seaching 
for, maybe I mean "properly nested").  

Trying other words, I expect all lower level folds in the hierarchy would end 
at (and not extend beyond) the end of the highest level fold in the 
hierarchy.

If that is your question, I guess the next logical question is, would it be an 
advantage to be able to handle such improperly nested folds, and, off the top 
of my head, I'd say no.  I can think about it some more.

regards,
Randy Kramer

By that, I mean that 




-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to