Merge pull request #2442 from vermiculus/sa/single-window

Don't die if the headers buffer isn't in a window
This commit is contained in:
Dirk-Jan C. Binnema 2023-03-16 07:17:34 +02:00 committed by GitHub
commit 61a00df197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -155,10 +155,12 @@ Then, display the results."
(docid (mu4e-message-field msg :docid)))
(unless docid
(mu4e-error "Message without docid: action is not possible"))
(with-current-buffer buffer
;; make sure to select the window, or jumping won't
;; be reflected.
(with-selected-window (get-buffer-window)
;; make sure to select the window if possible, or jumping won't be
;; reflected.
(with-selected-window (or (get-buffer-window buffer)
(get-buffer-window))
(with-current-buffer buffer
(if (or (mu4e~headers-goto-docid docid)
;; TODO: Is this the best way to find another
;; relevant docid for a view buffer?