Configurable sort order when displaying search results
search_render() currently uses the hardcoded Notmuch::SORT_NEWEST_FIRST. I think it would be nice to make the sort order configurable for the end user, ideally on a per-search-basis. This would for example allow sorting messages tagged "inbox" oldest first, an those tagged "someothertag" newest first.
We could create some kind of meta-search-term like sort:oldest-first, but then we would need to make sure it's parsed correctly everywhere and removed before sending it to libnotmuch.
Does that sound like a reasonable solution?
Thanks for considering my suggestion. To make sure I understand your approach: Where would these meta-search-terms be specified by the end user, and how would they be mapped to particular searches?
For example something like this:
let g:notmuch_folders = [
\ [ 'lkml', 'tag:inbox and folder:lkml/ sort:newest-first' ],
\ [ 'to-do', 'tag:to-do sort:oldest-first' ],
\ ]
Looks reasonable to me. Additionally, I suggest adding a configuration option for the default sorting order, for convenience.