mu4e-utils: refactor into mu4e-helpers, separate files

Usurp more of the utils code than can be re-used without further dependencies in
helpers.

Split off specific parts in their own file.

After the helper/utils changes, update the rest of mu4e to take the changes into
account.
This commit is contained in:
Dirk-Jan C. Binnema
2021-08-29 17:30:10 +03:00
parent e6be09e626
commit 9157d9102d
23 changed files with 2119 additions and 2335 deletions

View File

@ -96,7 +96,7 @@ BOOKMARK is a bookmark name or a bookmark record."
(docid (cdr path))
(query (car path)))
(call-interactively 'mu4e)
(mu4e-headers-search query)
(mu4e-search query)
(sit-for 0.5)
(mu4e~headers-goto-docid docid)
(mu4e~headers-highlight docid)
@ -172,6 +172,17 @@ For example for bogofile, use \"/usr/bin/bogofilter -Sn < %s\"")
;; allowing files to be attached to an email via mu4e using the
;; eshell. Does not depend on gnus.
(defun mu4e~active-composition-buffers ()
"Return all active mu4e composition buffers"
(let (buffers)
(save-excursion
(dolist (buffer (buffer-list t))
(set-buffer buffer)
(when (eq major-mode 'mu4e-compose-mode)
(push (buffer-name buffer) buffers))))
(nreverse buffers)))
(defun eshell/mu4e-attach (&rest args)
"Attach files to a mu4e message using eshell. If no mu4e
buffers found, compose a new message and then attach the file."