How sortby list in variable AND idea for :sortby filter prefix

Here’s a combined question and idea:

I want to sort by the list of a variable. The variable is a tiddler. Essentially, this non-existing “named filter prefix” would solve it like so:

:sortby[list<variable>] (the variable is some tiddler title)

(I think it is self explanatory what it is supposed to do, please tell me if not.)

Currently, there’s otherwise a problem to (1) extract the list field from that variable title and (2) to sortby it.

One possible solution would be sortby{$(variable)$!!list} but, unless I am mistaken, this would require splitting it out into a separate macro. This is not optimal. (And could that syntax even be a in procedure?)

Frustratingly, I also don’t understand how it can be solved with either of these:

Questions

  1. Any good solution?
  2. Would it make sense to propose a :sortby filter prefix?

Thank you!

Currently, I would do this in two steps:

First, get the list from the desired tiddler:

<$let sortlist={{{ [<variable>get[list]] }}}

then, use the sortlist variable in your filter syntax:

... +[sortby<sortlist>] ...

re: a new :sortby filter prefix… I think the above solution is probably sufficient for your particular use-case; however, there may be some other cases for which your proposed filter prefix would be useful (e.g., within a \function definition, where a $let widget cannot be used).

-e

Thanks! I’m surprised that there is no “in-filter” solution, but it is assuring to hear how you would do it which is what I’ll resort to.

OK, so a :sortby filter prefix might make sense after all.