From 9162e3e68c69c78a32849e355bf77a9f5b2cdce5 Mon Sep 17 00:00:00 2001 From: djcb Date: Wed, 10 Dec 2014 22:51:13 -0800 Subject: [PATCH] mu4e: mu4e-headers-find-if-next: move before search when searching for the next match, go the end of the current line; when searching for the previous match, go to the beginning of the current line. --- mu4e/mu4e-headers.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 702c7f0d..9fe11586 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -1008,11 +1008,13 @@ message, you can use `mu4e-headers-find-if-next'." (defun mu4e-headers-find-if-next (func &optional backwards) "Like `mu4e-headers-find-if', but do not match the current header. -Move to the next header for which FUNC returns non-`nil', starting -from the current position." +Move to the next or (if BACKWARDS is non-`nil') header for which FUNC +returns non-`nil', starting from the current position." (let ((pos)) (save-excursion - (forward-line (if backwards -1 1)) + (if backwards + (beginning-of-line) + (end-of-line)) (setq pos (mu4e-headers-find-if func backwards))) (when pos (goto-char pos))))