Don't die if the headers buffer isn't in a window
If the headers buffer isn't in a live window (e.g., mu4e-split-view
is 'single-window), get-buffer-window will return nil. In turn,
with-selected-window will die if fed a nil window, so default to using the
current window in this case.
This fixes a regression from c23dad7058 that
prevented using n/p from a view buffer.
This commit is contained in:
@ -155,10 +155,12 @@ Then, display the results."
|
|||||||
(docid (mu4e-message-field msg :docid)))
|
(docid (mu4e-message-field msg :docid)))
|
||||||
(unless docid
|
(unless docid
|
||||||
(mu4e-error "Message without docid: action is not possible"))
|
(mu4e-error "Message without docid: action is not possible"))
|
||||||
(with-current-buffer buffer
|
|
||||||
;; make sure to select the window, or jumping won't
|
;; make sure to select the window if possible, or jumping won't be
|
||||||
;; be reflected.
|
;; reflected.
|
||||||
(with-selected-window (get-buffer-window)
|
(with-selected-window (or (get-buffer-window buffer)
|
||||||
|
(get-buffer-window))
|
||||||
|
(with-current-buffer buffer
|
||||||
(if (or (mu4e~headers-goto-docid docid)
|
(if (or (mu4e~headers-goto-docid docid)
|
||||||
;; TODO: Is this the best way to find another
|
;; TODO: Is this the best way to find another
|
||||||
;; relevant docid for a view buffer?
|
;; relevant docid for a view buffer?
|
||||||
|
|||||||
Reference in New Issue
Block a user