Skip to Content.
Sympa Menu

texmacs-users - [TeXmacs] I need help with scheme + style macros.

Subject: mailing-list for TeXmacs Users

List archive

[TeXmacs] I need help with scheme + style macros.


Chronological Thread 
  • From: Karl Hegbloom <address@hidden>
  • To: texmacs-users <address@hidden>
  • Subject: [TeXmacs] I need help with scheme + style macros.
  • Date: Thu, 19 May 2016 13:26:38 -0600

I'm working on a connector between TeXmacs and Zotero, using the OpenOffice connector wire protocol. It needs to be able to send the noteindex when it makes a new field. My style macros look at the CSL style type gotten by parsing the xml document preferences data that Zotero sends for storage inside the document,  and behave differently for an in-text citation style vs a note style citation format. For note styles,  it makes a footnote inside of the citation rendering macro. Behind the text of the citation it calls a set-binding to create a reference binding with it's key based on the field's ID string and value based on the footnote number.

The problem is that the scheme code that inserts it after picking a menu item that initiates the protocol communication exchange with Zotero can not get a valid reference binding until the typesetter had run to set it. There's a race,  and a need to give up control for the gui refresh to call the typesetter,  right?

What just occurred to me,  before I forget,  is that I can have it insert the zcite tree right when the button is pushed in the menu,  then leaving cursor-path there, send the message to Zotero that asks it to call back to manage insertion of the new citation field. The subroutine that sends it starts a delayed form in the GUI mainloop runq, which listens for an available return message over the same still open tcp port. Meanwhile, I will wait-call (synchronously) update-current-buffer, then return from the menu callback.

When Zotero calls back,  goes through its setup caps and finally asks my side to insert the new cite field tag,  it will already be there, and hopefully by now will have a valid reference binding holding the correct noteIndex to send back.

If that solution works I'll try to remember to acknowledge it here.

address@hidden
http://karlhegbloom.blogspot.com




Archive powered by MHonArc 2.6.19.

Top of Page