[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] List of all bookmarks
From: |
Miguel de Benito Delgado |
Subject: |
Re: [Texmacs-dev] List of all bookmarks |
Date: |
Wed, 27 Jul 2011 22:54:41 +0200 |
Hi Victor,
I think you should use scheme. The variable holding the buffer is buffer-tree. Assuming you've defined a \bookmark macro, you can get a list of tree objects with all your \bookmarks using:
(select (buffer-tree) '(:* bookmark))
Then you can iterate it, and access it using tree-ref, for instance. Look for tree-ref in the documentation and read the file "High level modification routines". Say your bookmark macro has one argument, then you could display on the console all the arguments to bookmark tags with something like:
(for-each (lambda (item)
(display (tree->string (tree-ref item 0))))
(select (buffer-tree) '(:* bk)))
I doubt this is the best way to achieve it, but it's the one I came up with when looking for a way to update all the references I was automatically generating in my document.
________________
Miguel de Benito.
On Wed, Jul 27, 2011 at 21:18, Victor Porton
<address@hidden> wrote:
How can i get quickly the list of all <bookmark> tags in a document?
I want to make a menu which lists all bookmarks but don't know where to start.
Should I parse the entire document finding <bookmark> tags before every show of the menu. Isn't this to slow?
Should I code it in Scheme or in C++?
I think it is similar to the menu with choice of a section of the document, as it is in the focus toolbar. But where is the code which implements that?
--
Victor Porton - http://portonvictor.org