mu4e-headers.el: fix for jumping specific message after search

While reading message using split view, search can be triggered after
automatic update and index. In this case, mu4e headers is not inside selected
window and mu4e-headers-goto-message-id fails to move window point of mu4e
headers.

To fix this, call set-window-point for mu4e headers window explitctly.
This commit is contained in:
Junyeong Jeong 2019-01-11 16:24:40 +09:00
parent 57150a47f3
commit 3b9f9e5c39
1 changed files with 5 additions and 1 deletions

View File

@ -708,7 +708,11 @@ after the end of the search results."
;; if we need to jump to some specific message, do so now
(goto-char (point-min))
(when mu4e~headers-msgid-target
(mu4e-headers-goto-message-id mu4e~headers-msgid-target))
(if (eq (current-buffer) (window-buffer))
(mu4e-headers-goto-message-id mu4e~headers-msgid-target)
(let* ((pos (mu4e-headers-goto-message-id mu4e~headers-msgid-target)))
(when pos
(set-window-point (get-buffer-window) pos)))))
(when (and mu4e~headers-view-target (mu4e-message-at-point 'noerror))
;; view the message at point when there is one.
(mu4e-headers-view-message))