mirror of https://github.com/djcb/mu.git
mu4e-thread: use mu4e-headers-(prev|next)-thread
Use the existing implementation.
This commit is contained in:
parent
b73e075c7b
commit
a81b540f66
|
@ -105,41 +105,23 @@ ORIG-FUN is the original functions, taking ARGS."
|
||||||
(setq point (point)))
|
(setq point (point)))
|
||||||
point))
|
point))
|
||||||
|
|
||||||
(defun mu4e-thread-goto-prev ()
|
(declare-function 'mu4e-headers-prev-thread "mu4e-headers")
|
||||||
"Go to the root of the previous thread, return nil if thread is the first."
|
(declare-function 'mu4e-headers-next-thread "mu4e-headers")
|
||||||
(interactive)
|
|
||||||
(mu4e-thread-goto-root)
|
(defalias 'mu4e-thread-goto-prev 'mu4e-headers-prev-thread)
|
||||||
(when-let ((point (mu4e-thread-prev)))
|
(defalias 'mu4e-thread-goto-next 'mu4e-headers-next-thread)
|
||||||
(goto-char point)
|
|
||||||
point))
|
|
||||||
|
|
||||||
(defun mu4e-thread-prev ()
|
(defun mu4e-thread-prev ()
|
||||||
"Get the root of the previous thread (if any)."
|
"Get the root of the previous thread (if any)."
|
||||||
(let ((_point))
|
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(mu4e-thread-goto-root)
|
(when (mu4e-thread-goto-prev)
|
||||||
(unless (eq (point-min) (point))
|
(mu4e-thread-root))))
|
||||||
(forward-line -1)
|
|
||||||
(mu4e-thread-goto-root)
|
|
||||||
(point)))))
|
|
||||||
|
|
||||||
(defun mu4e-thread-goto-next ()
|
|
||||||
"Go to the root of the next thread.
|
|
||||||
Return t if there was a next thread, nil otherwise."
|
|
||||||
(interactive)
|
|
||||||
(when-let ((point (mu4e-thread-next)))
|
|
||||||
(goto-char point)))
|
|
||||||
|
|
||||||
(defun mu4e-thread-next()
|
(defun mu4e-thread-next()
|
||||||
"Get the root of the next thread (if any)."
|
"Get the root of the next thread (if any)."
|
||||||
(let ((point))
|
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(forward-line +1)
|
(when (mu4e-thread-goto-next)
|
||||||
(while (and (not (eobp))
|
(mu4e-thread-root))))
|
||||||
(not (mu4e-thread-is-root)))
|
|
||||||
(forward-line +1))
|
|
||||||
(setq point (point))
|
|
||||||
point)))
|
|
||||||
|
|
||||||
(defun mu4e-thread-is-folded ()
|
(defun mu4e-thread-is-folded ()
|
||||||
"Test if thread at point is folded."
|
"Test if thread at point is folded."
|
||||||
|
|
Loading…
Reference in New Issue