texmacs-dev
[Top][All Lists]
Advanced

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

[Texmacs-dev] trees


From: Michael Lachmann
Subject: [Texmacs-dev] trees
Date: Mon, 1 Oct 2012 16:56:24 +0200

Hi!

I'm having problems with trees. Where is the best documentation of how
to handle them?

I'm trying to do the following:

My document uses the fangle package, so it includes in it things like this
<nf-chunk | name_of_chunk1 | code1 |  cpp | >
<nf-chunk | name_of_chunk2 | code2 |  cpp | >

What I am trying to calculate is the name of the chunk I am on, or
that I'm after.

(This means that after or in the 2nd chunk, I want to get
name_of_chunk2, and in the 1st chunk , or between 1 and 2 I want to
get name_of_chunk1)

The easiest way I found to do this is to take (cursor-path), and
first, go over all its possible heads (0...m), and then check if
(object->string  (car (tree->list( path->tree HEAD-OF-CURSOR_PATH) )) )
contains "nf-chunk".
If not, then go up the same heads, and check if (select Tree
'(nf-chunk)) sees something.

This, in the end will be very complicated....

Is there an easier way to do this? I don't think I'm using 'select',
trees, and the cursor correctly...

Thanks!
Michael

--

Michael Lachmann, Max Planck Institute for Evolutionary Anthropology
Deutscher Platz 6, 04107 Leipzig, Germany.



reply via email to

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