Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable sort order when displaying search results #21

Open
rseichter opened this issue Apr 19, 2023 · 4 comments
Open

Configurable sort order when displaying search results #21

rseichter opened this issue Apr 19, 2023 · 4 comments

Comments

@rseichter
Copy link

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.

@felipec
Copy link
Owner

felipec commented Apr 24, 2023

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?

@rseichter
Copy link
Author

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?

@felipec
Copy link
Owner

felipec commented May 2, 2023

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' ],
	\ ]

@rseichter
Copy link
Author

Looks reasonable to me. Additionally, I suggest adding a configuration option for the default sorting order, for convenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants