Vincent van Ravesteijn wrote:
Jean-Marc Lasgouttes schreef:
Le 25 avr. 09 à 00:07, Vincent van Ravesteijn a écrit :
I think this is a battle we cannot win (not tested, but you get the idea):
inset-forall Note note-insert
So... you look for all Note insets, and execute note-insert for each and you'll end up with the double amount of Notes ?

No, you find Note1, qnd you insert a note in front of it. Then you find this new note, and you insert
a note in front of it, etc.

Yes, that's why I implicitly proposed to search for all Note insets, store them in a list and then execute the command for each of them.

Would that be an alternative to prevent the infinite loops ?

Robust against infinite loops, but may have some problems of its own.

Because now you have to keep that list of insets up-to-date during processing. The operations done by "inset-forall" may change the document structure - and the list of "all notes" get outdated. At least the inset positions move around, and some of the notes might get deleted /dissolved/moved before processing.

Helge Hafting

Reply via email to