---- On Thu, 16 Aug 2018 20:19:16 +0200 Hans Hagen
Hi,
btw, you probably noticed that mlist_to_hlist is called recursively so you might use that fact
I had some experiments in this area but it is quite hard to avoid side effects here. Anyway it seems to be the most promising way. Related to this: Strict reading of the manual would imply that node.mlist_to_hlist only accepts 'display' or 'text' as style parameter. While you could emulate everything else by adding style nodes, the implementation accepts other styles too and it seemed to make sense to pass the specific style directly. Is this officially supported?
conceptually one could have callbacks at the make_* level (the wrapping things) which is kind of clean but that has not much use as work happens in those and duplicating all that happens in there in lua makes no sense
a do_delimiter callback is only a partial solution as it is used in several places and also works in tandem with other constructs (rules for instance); also, you'd always have to keep in mind that other mechanisms expect (for instance) attributes to be retained, character properties to migrate to unicode (cut and paste), etc, but that can be dealt with, in that sense the name 'delimiter' is somewhat confusing
(fwfw, in context we hardly use these constructs because we want to have more control and do fancy things)
I certainly have to take me some time to look more into ConTeXt but I generally try to avoid using too much GPL licensed stuff... Anyway, that's completely off-topic.
anyway, a dodelimiter callback is in some sense not so much a delimiter one, but more a constructor one as it kind of relates to fonts and not so much to math ... basically it could be something "create_extensible" or so which is then triggered inside e.g. do_delimiter
i'll play with that a bit when i have time (i.e. what is the context we need to pass and what do we want back and what wrapup afterwards is needed) to see if it makes sense at all
Just in case you are interested in my code I attached a patch I am currently experimenting with which moves this completely into the font and triggers it in `get_delim_box` to avoid interference for "easy" delimiters. It a hack which probably fails completely if you try dumping the font during format generation and it does some mostly untested and improvised reference counting, but for easy cases it seems to work quite reliable. Anyway I agree that adding that adding anything here might not be worth it so I will see if I continue with using custom patches or if I find a sufficiently nice `mlist_to_hlist` solution.
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Best regards Marcel