On Sunday, February 28, 2016 at 2:31:47 PM UTC-8, Mat wrote: > > Eric - thank you for a very informative and 'solving' reply! :-) > ... > It is depressing to realize that this basic problem is something that > requires special js code and I therefore simply *cannot* solve myself > (and this after hours and hours of trying different circumventions). >
It's not really "special js code". The <$count> widget has much more involved js code than this tiny filter does.... and certainly less code than would be needed to extend the core macro processing to "evaluate" the macro output and extract a return value from the result. You should think of the "count" filter as merely an add-on enhancement to the set of filters you have available. The real problem you encountered is that the "count" filter isn't in the standard core set of filters, so you were looking for a workaround based on re-purposing existing features (i.e., the $count widget). However, I think what you are trying to "kill a fly with a sledgehammer." You are proposing that we radically extend the purpose and behavior of the macro mechanism on a system-wide basis, just so you can re-use an existing widget in a way that widgets aren't intended to be used. I'm also wondering how such an extended macro processor would handle refresh events? To "evaluate and return" macro content, the core processing would need to generate a separate, temporary parse tree for the macro content (after substitution of params and variables), extract the "output value" from the tree and then discard the parse tree before returning the extracted content. The problem here is that without preserving the parse tree, there's no way to know that there are widgets *inside* the macro that need to be refreshed. In my opinion, this entire approach seems like it would be a "can of worms", creating more problems than it solves. -e -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6f12ee89-d06c-4ca5-b933-3a71e7c66eeb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

