texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] List of all bookmarks


From: Victor Porton
Subject: Re: [Texmacs-dev] List of all bookmarks
Date: Thu, 28 Jul 2011 01:17:15 +0400

Thanks a lot.
 
I also need code for:
- inserting a tag
- deleting a tag
- moving cursor to a position of a tag
28.07.2011, 00:54, "Miguel de Benito Delgado" <address@hidden>:
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

_______________________________________________
Texmacs-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/texmacs-dev

--
Victor Porton - http://portonvictor.org

reply via email to

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