* mu4e-hdrs.el: after marking a thread, jump after the thread

This commit is contained in:
djcb
2012-04-28 14:39:57 +03:00
parent d460c7f907
commit 1a8de6efc1

View File

@ -617,8 +617,9 @@ non-nill, don't raise an error when the docid is not found."
;; search-based marking ;; search-based marking
(defun mu4e-hdrs-for-each (func) (defun mu4e-hdrs-for-each (func)
"Call FUNC for each header. FUNC takes one argument msg, the msg "Call FUNC for each header, moving point to the header. FUNC
s-expression for the corresponding header." takes one argument msg, the msg s-expression for the corresponding
header."
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(while (search-forward mu4e~docid-pre nil t) (while (search-forward mu4e~docid-pre nil t)
@ -692,7 +693,8 @@ limited to the message at point and its descendants."
(mu4e-message-at-point t) 'thread-id)) (mu4e-message-at-point t) 'thread-id))
(path (mu4e~hdrs-get-thread-info (path (mu4e~hdrs-get-thread-info
(mu4e-message-at-point t) 'path)) (mu4e-message-at-point t) 'path))
(markpair (mu4e~hdrs-get-markpair))) (markpair (mu4e~hdrs-get-markpair))
(last-marked-point))
(mu4e-hdrs-for-each (mu4e-hdrs-for-each
(lambda (msg) (lambda (msg)
(let ((my-thread-id (mu4e~hdrs-get-thread-info msg 'thread-id))) (let ((my-thread-id (mu4e~hdrs-get-thread-info msg 'thread-id)))
@ -701,11 +703,16 @@ limited to the message at point and its descendants."
;; prefix ;; prefix
(when (string-match (concat "^" path) (when (string-match (concat "^" path)
(mu4e~hdrs-get-thread-info msg 'path)) (mu4e~hdrs-get-thread-info msg 'path))
(mu4e-mark-at-point (car markpair) (cdr markpair))) (mu4e-mark-at-point (car markpair) (cdr markpair))
(setq last-marked-point (point)))
;; nope; not looking for the subthread; looking for the whole thread ;; nope; not looking for the subthread; looking for the whole thread
(when (string= thread-id (when (string= thread-id
(mu4e~hdrs-get-thread-info msg 'thread-id)) (mu4e~hdrs-get-thread-info msg 'thread-id))
(mu4e-mark-at-point (car markpair) (cdr markpair))))))))) (mu4e-mark-at-point (car markpair) (cdr markpair))
(setq last-marked-point (point)))))))
(when last-marked-point
(goto-char last-marked-point)
(mu4e-next-header))))
(defun mu4e-hdrs-mark-subthread () (defun mu4e-hdrs-mark-subthread ()
"Like `mu4e-mark-thread', but only for a sub-thread." "Like `mu4e-mark-thread', but only for a sub-thread."