contrib: pick: if no target specified go to first matching message

This commit is contained in:
Mark Walters 2013-06-30 09:55:10 +01:00 committed by David Bremner
parent 9a64b2df29
commit f9aad24f02

View file

@ -652,8 +652,10 @@ unchanged ADDRESS if parsing fails."
(save-excursion (save-excursion
(goto-char (point-max)) (goto-char (point-max))
(notmuch-pick-insert-msg msg)) (notmuch-pick-insert-msg msg))
(let ((msg-id (notmuch-id-to-query (plist-get msg :id)))) (let ((msg-id (notmuch-id-to-query (plist-get msg :id)))
(when (string= msg-id notmuch-pick-target-msg) (target notmuch-pick-target-msg))
(when (or (and (not target) (plist-get msg :match))
(string= msg-id target))
(setq notmuch-pick-target-msg "found") (setq notmuch-pick-target-msg "found")
(goto-char (point-max)) (goto-char (point-max))
(forward-line -1)))) (forward-line -1))))