Yes, thank you Tobias for understanding and formalizing my idea!
Should we open an issue about that?


On 06/11/15 16:31, Tobias Beer wrote:
Hi Erwan,

    Steve I think that your use case is interesting because it shows a
    limitation of sorting with TW filters (although imho in this
    specific case the best solution would be to sort the list of tags
    automatically every time a tag is added to a tiddler).


I think TiddlyWiki should *never* sort a list-field when adding or removing an item, unless specifically instructed to do so via something like Matabele's listops, the tags field being just a special case of a generic list-field.

    I think another case with the same limitation is when one wants to
    sort a list of tiddlers by the number of times they are used as
    tags (i.e. number of tiddlers tagged with them).

    ...

    I wonder if it would be possible to implement new "sort" filter
    operators which would allow the usage of a sub-filter like this


This sounds to me that -- for the purposes of sorting -- we wish for something like a "virtual field", by which we can sort after we've created it "in-memory". A *sortby* filter could "sort by the output of filter expression evaluated against an item". This filter expression could be passed to the operand as either a variable or text reference as we'd have no other way to chuck a "subfilter" within a filter expression, e.g.

|
<$vars sortfilter="[<currentTiddler>tagging[]]">
<<list-links filter:"[all[]sortby<sortfilter>]">>
</$vars>
|

'The above should cater for the OP's requirement, assuming the *sortby* filter would:

 1. evaluate each item in the input set against the specified filter
    in the operand
 2. sort the items in the input set with respect to whatever was returned

It could / perhaps should even be...

|
<<list-links filter:"[all[]sortby:nsort<sortfilter>]">>
|

...to avail any core sorting algorithms.

The count would be:

|
<$vars sortfilter="[<currentTiddler>tagging[]count[]]">
<<list-links filter:"[all[]sortby<sortfilter>]">>
</$vars>
|

...requiring, well, a nonexisting "count" filter.

Best wishes,

Tobias.
--
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 tiddlywiki+unsubscr...@googlegroups.com <mailto:tiddlywiki+unsubscr...@googlegroups.com>. To post to this group, send email to tiddlywiki@googlegroups.com <mailto:tiddlywiki@googlegroups.com>.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/0fd70eb7-1315-4e10-aff7-37ba9bd6af23%40googlegroups.com <https://groups.google.com/d/msgid/tiddlywiki/0fd70eb7-1315-4e10-aff7-37ba9bd6af23%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/563D4FB7.60809%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to