mailing-list for TeXmacs Users

Text archives Help


Q: HOWTO: add a menu entry only when a certain package is used


Chronological Thread 
  • From: Jeremy Henty <address@hidden>
  • To: TeXmacs users <address@hidden>
  • Subject: Q: HOWTO: add a menu entry only when a certain package is used
  • Date: Sun, 23 Sep 2007 20:17:08 +0100


I've been having fun writing plugins that install packages and add
things to menus. *But*, sometimes I'd really like the menu items to
appear *only* when the current buffer uses certain packages.

For example, I have a "To Do" plugin that (a) supplies a package with
a "to-do" macro and (b) adds an "Insert 'To Do' macro" menu item. It
works nicely enough, but I'd really like the menu item that inserts
the macro to appear only when the current document is using the
package that defines the macro.

The documentation says:

<verbatim|extend-menu> support[s] overloading on mode and cursor
context.

but doesn't say how to make it depend on the packages of the current
document. Can it be done? Does the TeXmacs API include a convenient
way to get the current list of packages?

Regards,

Jeremy Henty



Archive powered by MHonArc 2.6.19.

Top of page