diff options
author | Carl Worth <cworth@cworth.org> | 2009-11-17 20:52:09 -0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-11-17 20:58:30 -0800 |
commit | 333486572517d2e2084d66208de59085f21d8573 (patch) | |
tree | 97c3e7119958f9b15315087332c396204c133776 /lib/query.cc | |
parent | 5dec429f457c5b387a43802a32ef3192592c425d (diff) |
notmuch search: Change default search order to be newest messages first.
This is what most people want for a _search_ command. It's often
different for actually reading mail in an inbox, (where it makes more
sense to have results displayed in chronological order), but in such a
case, ther user is likely using an interface that can simply pass the
--sort=oldest-first option to "notmuch search".
Here we're also change the sort enum from NOTMUCH_SORT_DATE and
NOTMUCH_SORT_DATE_REVERSE to NOTMUCH_SORT_OLDEST_FIRST and
NOTMUCH_SORT_NEWEST_FIRST. Similarly we replace the --reverse option
to "notmuch search" with two options: --sort=oldest-first and
--sort=newest-first.
Finally, these changes are all tracked in the emacs interface, (which
has no change in its behavior).
Diffstat (limited to 'lib/query.cc')
-rw-r--r-- | lib/query.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/query.cc b/lib/query.cc index a70be1d..a869f3e 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -61,7 +61,7 @@ notmuch_query_create (notmuch_database_t *notmuch, query->query_string = talloc_strdup (query, query_string); - query->sort = NOTMUCH_SORT_DATE; + query->sort = NOTMUCH_SORT_NEWEST_FIRST; return query; } @@ -109,10 +109,10 @@ notmuch_query_search_messages (notmuch_query_t *query, } switch (query->sort) { - case NOTMUCH_SORT_DATE: + case NOTMUCH_SORT_OLDEST_FIRST: enquire.set_sort_by_value (NOTMUCH_VALUE_TIMESTAMP, FALSE); break; - case NOTMUCH_SORT_DATE_REVERSE: + case NOTMUCH_SORT_NEWEST_FIRST: enquire.set_sort_by_value (NOTMUCH_VALUE_TIMESTAMP, TRUE); break; case NOTMUCH_SORT_MESSAGE_ID: |