Support the new batched query results from the mu server; these are much faster
to render (2-3x it seems).
Rearrange the code a bit to avoid byte-compiler warnings.
Obsolete mu4e-header-func, to be replaced by mu4e-headers-append-func.
Fire mu4e-index-updated-hook after any index operations, where anything changed
or not. Add a new variable `mu4e-index-update-status' which can be used to see
what changed (if anything) in the last indexing operation.
Keep mu4e-message-changed-hook in place; it only fires when a message
changed (and when it is update).
Remove the long-obsolete `mu4e-msg-changed-hook'.
I'm not quite sure why it was done in the first place, and it seems to have
unwanted side-effects. So let's turn it off and see if anything breaks.
Fixes: #2146.
Replace obsolete variable alias with obsolete function alias for mu4e-headers-search-edit.
Update docstring for mu4e-view-search-edit to reference the new function.
This is needed when gnus is used along mu4e for other purpose like
reading News, in this case gnus rename `gnus-article-buffer` and we
end up with an unrelated buffer-name in mu4e.
This allows to have a function returning a window as value of
`mu4e-split-view`. I'm using this patch since quite some time locally with the
following function.
```el
(defun th/mu4e-split-view ()
(let* ((headers (mu4e-get-headers-buffer))
(headers-win (and headers (get-buffer-window headers)))
(view (mu4e-get-view-buffer))
(view-win (and view (get-buffer-window view))))
(cond
;; There's a view window, just use it.
(view-win view-win)
;; Just one window, split sensibly, i.e., horizontally or
;; vertically depending on geometry.
((one-window-p) (split-window-sensibly))
;; Otherwise, use the tallest window.
(t (car (sort (delq headers-win (window-list))
(lambda (a b)
(> (window-height a) (window-height b)))))))))
(setq mu4e-split-view #'th/mu4e-split-view)
```
It actually returns a buffer-name whereas it should return a buffer
object which make `mu4e~switch-back-to-mu4e-buffer` fail because
`buffer-live-p` expects a buffer object.
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.