mu4e-headers: restore view-win in search exec
We must restore the view-win from the correct context (i.e.: the headers-buffer/window) Fixes #2920.
This commit is contained in:
@ -802,17 +802,16 @@ to t before \"automatic\" searches.")
|
|||||||
|
|
||||||
Switch to the output buffer for the results."
|
Switch to the output buffer for the results."
|
||||||
(let* ((buf (mu4e-get-headers-buffer nil t))
|
(let* ((buf (mu4e-get-headers-buffer nil t))
|
||||||
(view-window mu4e~headers-view-win)
|
|
||||||
(inhibit-read-only t)
|
(inhibit-read-only t)
|
||||||
(maxnum (unless mu4e-search-full mu4e-search-results-limit)))
|
(maxnum (unless mu4e-search-full mu4e-search-results-limit)))
|
||||||
(with-current-buffer buf
|
(with-current-buffer buf
|
||||||
;; NOTE: this resets all buffer-local variables, including
|
;; NOTE: `mu4e-headers-mode' resets all buffer-local variables, including
|
||||||
;; `mu4e~headers-view-win', which may have a live window if the
|
;; `mu4e~headers-view-win', which may have a live window if the headers
|
||||||
;; headers buffer already exists when `mu4e-get-headers-buffer'
|
;; buffer already existed. Save & restore after the mode reset.
|
||||||
;; is called.
|
(let ((view-window mu4e~headers-view-win))
|
||||||
(mu4e-headers-mode)
|
(mu4e-headers-mode)
|
||||||
(setq mu4e~headers-view-win view-window
|
(setq mu4e~headers-view-win view-window
|
||||||
list-buffers-directory expr)
|
list-buffers-directory expr))
|
||||||
(mu4e--modeline-update))
|
(mu4e--modeline-update))
|
||||||
|
|
||||||
;; For interactive searches, display the buffer if not already visible; for
|
;; For interactive searches, display the buffer if not already visible; for
|
||||||
|
|||||||
Reference in New Issue
Block a user