This separates the order you want to go through your mail from the order you want it sorted visually. Now you can, e.g.: have your newer mails appearing at the top while still reading them starting from the oldest. --- emacs/notmuch-lib.el | 8 ++++++++ emacs/notmuch.el | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index f30bcb4..54c7329 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -33,6 +33,14 @@ :type 'boolean :group 'notmuch) +(defcustom notmuch-process-newer-next nil + "When finished with a thread, which one you intend to process next. + +If the value is nil, the thread older than the current will be +focused next, otherwise focus the newer thread will be chosen." + :type 'boolean + :group 'notmuch) + ;; (defcustom notmuch-saved-searches nil diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 417f3fd..404e77d 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -261,12 +261,14 @@ For a mouse binding, return nil." (defun notmuch-search-next-thread () "Select the next thread in the search results." (interactive) - (forward-line 1)) + (forward-line (* (if notmuch-search-oldest-first 1 -1) + (if notmuch-process-newer-next 1 -1)))) (defun notmuch-search-previous-thread () "Select the previous thread in the search results." (interactive) - (forward-line -1)) + (previous-line (* (if notmuch-search-oldest-first 1 -1) + (if notmuch-process-newer-next 1 -1)))) (defun notmuch-search-last-thread () "Select the last thread in the search results." -- 1.7.1