X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=contrib%2Fnotmuch-pick%2Fnotmuch-pick.el;h=1a553d41314d23a26e2fbb6d1e60beb271b354e5;hb=8ba60168897e81133c85d9f4928b96ad4a4b6ffd;hp=755cbbce008bafb8aeae3ade71f3ef19c123caca;hpb=bd918e35d460fcb3bbb8c2e2fe1bc9d5410c53e6;p=notmuch diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 755cbbce..1a553d41 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -173,7 +173,7 @@ (define-key map "q" 'notmuch-pick-quit) (define-key map "x" 'notmuch-pick-quit) (define-key map "?" 'notmuch-help) - (define-key map "a" 'notmuch-pick-archive-message) + (define-key map "a" 'notmuch-pick-archive-message-then-next) (define-key map "=" 'notmuch-pick-refresh-view) (define-key map "s" 'notmuch-search) (define-key map "z" 'notmuch-pick) @@ -337,10 +337,12 @@ Does NOT change the database." (setq notmuch-pick-message-window (split-window-vertically (/ (window-height) 4))) (with-selected-window notmuch-pick-message-window - (setq current-prefix-arg '(4)) - (setq buffer (notmuch-show id nil nil nil))) - (notmuch-pick-tag-update-display (list "-unread"))) - (setq notmuch-pick-message-buffer buffer))) + ;; Since we are only displaying one message do not indent. + (let ((notmuch-show-indent-messages-width 0)) + (setq current-prefix-arg '(4)) + (setq buffer (notmuch-show id nil nil nil)))) + (notmuch-pick-tag-update-display (list "-unread")) + (setq notmuch-pick-message-buffer buffer)))) (defun notmuch-pick-show-message-out () "Show the current message (in whole window)." @@ -393,10 +395,23 @@ Does NOT change the database." (kill-buffer notmuch-pick-message-buffer)) t)) -(defun notmuch-pick-archive-message () +(defun notmuch-pick-archive-message (&optional unarchive) + "Archive the current message. + +Archive the current message by applying the tag changes in +`notmuch-archive-tags' to it (remove the \"inbox\" tag by +default). If a prefix argument is given, the message will be +\"unarchived\", i.e. the tag changes in `notmuch-archive-tags' +will be reversed." + (interactive "P") + (when notmuch-archive-tags + (apply 'notmuch-pick-tag + (notmuch-tag-change-list notmuch-archive-tags unarchive)))) + +(defun notmuch-pick-archive-message-then-next (&optional unarchive) "Archive the current message and move to next matching message." - (interactive) - (notmuch-pick-tag "-inbox") + (interactive "P") + (notmuch-pick-archive-message unarchive) (notmuch-pick-next-matching-message)) (defun notmuch-pick-next-message ()