From 204b09dde37d9292b73f2fd06791249ae5b6b420 Mon Sep 17 00:00:00 2001 From: sabof Date: Thu, 6 Feb 2014 01:55:28 +0000 Subject: [PATCH] Try not to move, when executing marks --- mu4e/mu4e-headers.el | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 9193682e..ef55fca0 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -269,7 +269,9 @@ headers." (when (buffer-live-p mu4e~headers-buffer) (with-current-buffer mu4e~headers-buffer (let* ((docid (mu4e-message-field msg :docid)) - (point (mu4e~headers-docid-pos docid))) + (initial-message-at-point (mu4e~headers-docid-at-point)) + (initial-column (current-column)) + (point (mu4e~headers-docid-pos docid))) (when point ;; is the message present in this list? ;; if it's marked, unmark it now @@ -304,8 +306,14 @@ headers." (unless is-move (mu4e~headers-header-handler msg point)) - ;; attempt to highlight the corresponding line and make it visible - (mu4e~headers-highlight docid)))))) + (if (and initial-message-at-point + (mu4e~headers-goto-docid initial-message-at-point)) + (progn + (move-to-column initial-column) + (mu4e~headers-highlight initial-message-at-point)) + ;; attempt to highlight the corresponding line and make it visible + (mu4e~headers-highlight docid)) + ))))) (defun mu4e~headers-remove-handler (docid)