mu4e-view: double-check message file exists

So we can warn user early.
This commit is contained in:
Dirk-Jan C. Binnema
2022-01-15 10:19:31 +02:00
parent ddba5bf01a
commit 904214ba17
2 changed files with 15 additions and 8 deletions

View File

@ -137,7 +137,6 @@ This is equivalent to:
"" ;; not implemented for Gnus mode.
)
(defun mu4e-message-contact-field-matches (msg cfield rx)
"Does MSG's contact-field CFIELD match rx?
Check if any of the of the CFIELD in MSG matches RX. I.e.
@ -211,6 +210,15 @@ symbol, see `mu4e-header-info'."
;;; Html2Text
(make-obsolete 'mu4e-shr2text "No longer in use" "1.7.0")
(defun mu4e-message-readable-path (&optional msg)
"Get a readable path to MSG or raise an error.
If MSG is nil, use mu4e-message-at-point.
"
(let ((path (plist-get (or msg (mu4e-message-at-point)) :path)))
(unless (file-readable-p path)
(mu4e-error "No readable message at %s; database outdated?" path))
path))
(defun mu4e-copy-message-path ()
"Copy the message-path of message at point to the kill ring."
(interactive)