- for (messages = notmuch_query_search_messages (query, 0, -1);
- notmuch_messages_has_more (messages) && !interrupted;
- notmuch_messages_advance (messages))
+ /* tagging is not interested in any special sort order */
+ notmuch_query_set_sort (query, NOTMUCH_SORT_UNSORTED);
+
+ for (messages = notmuch_query_search_messages (query);
+ notmuch_messages_valid (messages) && !interrupted;
+ notmuch_messages_move_to_next (messages))