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.
This commit is contained in:
@ -1008,11 +1008,13 @@ message, you can use `mu4e-headers-find-if-next'."
|
|||||||
|
|
||||||
(defun mu4e-headers-find-if-next (func &optional backwards)
|
(defun mu4e-headers-find-if-next (func &optional backwards)
|
||||||
"Like `mu4e-headers-find-if', but do not match the current header.
|
"Like `mu4e-headers-find-if', but do not match the current header.
|
||||||
Move to the next header for which FUNC returns non-`nil', starting
|
Move to the next or (if BACKWARDS is non-`nil') header for which FUNC
|
||||||
from the current position."
|
returns non-`nil', starting from the current position."
|
||||||
(let ((pos))
|
(let ((pos))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(forward-line (if backwards -1 1))
|
(if backwards
|
||||||
|
(beginning-of-line)
|
||||||
|
(end-of-line))
|
||||||
(setq pos (mu4e-headers-find-if func backwards)))
|
(setq pos (mu4e-headers-find-if func backwards)))
|
||||||
(when pos (goto-char pos))))
|
(when pos (goto-char pos))))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user