mu4e: avoid some errors when flipping through messages

Use special-mode for the loading buffer, and explicitly ignore n/p.

Fixes #1443.
Fixes #1217.
This commit is contained in:
Dirk-Jan C. Binnema
2020-02-27 23:10:02 +02:00
parent 3e272ba82f
commit 6b2bdf4f6d
2 changed files with 35 additions and 19 deletions

View File

@ -1659,23 +1659,6 @@ _not_ refresh the last search with the new setting for threading."
(defvar mu4e~headers-loading-buf nil
"A buffer for loading a message view.")
(defun mu4e~headers-get-loading-buf ()
"Get a buffer to give feedback while loading a message view."
(unless (buffer-live-p mu4e~headers-loading-buf)
(setq mu4e~headers-loading-buf
(get-buffer-create " *mu4e-loading*")))
(with-current-buffer mu4e~headers-loading-buf
(read-only-mode)
(let ((inhibit-read-only t))
(erase-buffer)
(local-set-key (kbd "q")
(if (eq mu4e-split-view 'single-window)
'kill-buffer
'kill-buffer-and-window))
(insert (propertize "Waiting for message..."
'face 'mu4e-system-face 'intangible t))))
mu4e~headers-loading-buf)
(defun mu4e~decrypt-p (msg)
"Should we decrypt this message?"
(and (member 'encrypted (mu4e-message-field msg :flags))
@ -1701,7 +1684,13 @@ window. "
(unless (window-live-p viewwin)
(mu4e-error "Cannot get a message view"))
(select-window viewwin)
(switch-to-buffer (mu4e~headers-get-loading-buf))
(unless (buffer-live-p mu4e~headers-loading-buf)
(setq mu4e~headers-loading-buf (get-buffer-create " *mu4e-loading*"))
(with-current-buffer mu4e~headers-loading-buf
(mu4e-loading-mode)))
(switch-to-buffer mu4e~headers-loading-buf)
;; Note, ideally in the 'gnus' case, we don't need to call the server to get
;; the body etc., we only need the path which we already have.
;;