mu4e-view: use with-selected-window in mv--in-headers-context

Fixed #1394
This commit is contained in:
Dirk-Jan C. Binnema 2023-01-18 20:32:34 +02:00
parent ae10d3a3f8
commit c23dad7058
1 changed files with 16 additions and 16 deletions

View File

@ -158,22 +158,22 @@ Then, display the results."
(with-current-buffer buffer
;; make sure to select the window, or jumping won't
;; be reflected.
(select-window (get-buffer-window))
(if (or (mu4e~headers-goto-docid docid)
;; TODO: Is this the best way to find another
;; relevant docid for a view buffer?
;;
;; If you attach a view buffer to another headers
;; buffer that does not contain the current docid
;; then `mu4e~headers-goto-docid' returns nil and we
;; get an error. This "hack" instead gets its
;; now-changed headers buffer's current message as a
;; docid
(mu4e~headers-goto-docid
(with-current-buffer buffer
(mu4e-message-field (mu4e-message-at-point) :docid))))
,@body
(mu4e-error "Cannot find message in headers buffer"))))))
(with-selected-window (get-buffer-window)
(if (or (mu4e~headers-goto-docid docid)
;; TODO: Is this the best way to find another
;; relevant docid for a view buffer?
;;
;; If you attach a view buffer to another headers
;; buffer that does not contain the current docid
;; then `mu4e~headers-goto-docid' returns nil and we
;; get an error. This "hack" instead gets its
;; now-changed headers buffer's current message as a
;; docid
(mu4e~headers-goto-docid
(with-current-buffer buffer
(mu4e-message-field (mu4e-message-at-point) :docid))))
,@body
(mu4e-error "Cannot find message in headers buffer")))))))
(defun mu4e-view-headers-next (&optional n)
"Move point to the next message header.