mu4e-message: avoid mu4e-message-at-point misfiring

Belt-and-suspenders fix for already-fixes issue #2299.
This commit is contained in:
Dirk-Jan C. Binnema
2022-07-17 13:55:19 +03:00
parent f77f8f743e
commit ad7f5cac92

View File

@ -114,10 +114,10 @@ or body-html."
Either the headers buffer or the view buffer, or nil if there is Either the headers buffer or the view buffer, or nil if there is
no such message. If optional NOERROR is non-nil, do not raise an no such message. If optional NOERROR is non-nil, do not raise an
error when there is no message at point." error when there is no message at point."
(let ((msg (or (get-text-property (point) 'msg) mu4e~view-message))) (or (cond
(if msg ((eq major-mode 'mu4e-headers-mode) (get-text-property (point) 'msg))
msg ((eq major-mode 'mu4e-view-mode) mu4e~view-message))
(unless noerror (mu4e-warn "No message at point"))))) (unless noerror (mu4e-warn "No message at point"))))
(defsubst mu4e-message-field-at-point (field) (defsubst mu4e-message-field-at-point (field)
"Get the field FIELD from the message at point. "Get the field FIELD from the message at point.