mu4e: try to jump to same message after re-search

After a re-search, perhaps after toggling threading etc., try to move
point to the same message it was before
This commit is contained in:
djcb 2016-03-16 01:11:11 +02:00
parent 98c71d24e8
commit 15f857afcc
1 changed files with 4 additions and 1 deletions

View File

@ -1494,7 +1494,10 @@ window. "
(defun mu4e-headers-rerun-search ()
"Rerun the search for the last search expression."
(interactive)
(mu4e-headers-search mu4e~headers-last-query))
;; if possible, try to return to the same message
(let* ((msg (mu4e-message-at-point))
(msgid (and msg (mu4e-message-field msg :message-id))))
(mu4e-headers-search mu4e~headers-last-query nil nil t msgid)))
(defun mu4e~headers-query-navigate (whence)
"Execute the previous query from the query stacks.