This series allows the user to toggle the sort order in tree view and, in particular, allows oldest first view. Note that in all cases messages within a thread are displayed in thread order: the option only affects the order when multiple threads are viewed. If you only use tree view for single threads then nothing will change. Since tree view uses the notmuch-show command line as a backend this means we need to add a --sort option tonotmuch show. This is the first patch. The second patch implements the toggle sort order option bound to 'o' (so the same as the corresponding command in search view). These third and fourth patches are more optional: they make notmuch tree view inherit the notmuch search order when called via Z (notmuch-tree-from-search-current-query), and use the default notmuch-search sort order (notmuch-search-oldest-first) when called interactively. The third patch does the code change and the fourth the test update. I think these last two patches make sense for consistency but I have no strong feelings otherwise. Best wishes Mark Mark Walters (4): cli: show: allow sort order to be specified emacs: tree: bind o to toggle sort order emacs: tree: add sort argument to notmuch-tree test: tree: fix and a test for tree sort order changes doc/man1/notmuch-show.rst | 17 +++++++ emacs/notmuch-tree.el | 44 +++++++++++++++--- emacs/notmuch.el | 2 +- notmuch-show.c | 8 ++++ test/T460-emacs-tree.sh | 11 ++++- .../notmuch-tree-tag-inbox-oldest-first | 53 ++++++++++++++++++++++ 6 files changed, 126 insertions(+), 9 deletions(-) create mode 100644 test/tree.expected-output/notmuch-tree-tag-inbox-oldest-first -- 2.1.4