From 3b9f9e5c397a30660b12679dbed5cc36e7ae0b74 Mon Sep 17 00:00:00 2001 From: Junyeong Jeong Date: Fri, 11 Jan 2019 16:24:40 +0900 Subject: [PATCH] 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. --- mu4e/mu4e-headers.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index c279a88a..a73bce7f 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -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))