Subject: mailing-list for TeXmacs Users
List archive
From : Karl Hegbloom <address@hidden>- To: texmacs-users <address@hidden>
- Subject: Re: [TeXmacs] I need help with scheme + style macros.
- Date: Thu, 19 May 2016 13:39:25 -0600
Just to clarify, "the race" I describe above is when I wait for Zotero's message to insert the new citation, because immediately after the new tag is inserted the macro expansion had not run yet. After lunch I will try making the menu insert the new field tag pronto, rather than waiting for Zotero to initiate that event. That's good because now the sequence chart will be more similar to keyboard typing then activating the tag as a hybrid or shortcut key interactive command.
What I'm going to have to do is filter the new field out of the document wide list of them it may call for in the interrum, until after the point in time where Zotero sends the insert field message, which is when it can officially know the tag's fieldID and noteIndex.
address@hidden
http://karlhegbloom.blogspot.com
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.
- [TeXmacs] I need help with scheme + style macros., Karl Hegbloom, 05/19/2016
- Re: [TeXmacs] I need help with scheme + style macros., Karl Hegbloom, 05/19/2016
- Re: [TeXmacs] I need help with scheme + style macros., Karl Hegbloom, 05/19/2016
- Re: [TeXmacs] I need help with scheme + style macros., Karl Hegbloom, 05/19/2016
Archive powered by MHonArc 2.6.19.