mirror of https://github.com/djcb/mu.git
Merge pull request #2377 from mickeynp/bugfix/preserve-view-window
Preserve `mu4e~headers-view-win' when a search is (re-)executed
This commit is contained in:
commit
bdb494135d
|
@ -838,11 +838,17 @@ present, don't do anything."
|
||||||
Switch to the output buffer for the results. If IGNORE-HISTORY is
|
Switch to the output buffer for the results. If IGNORE-HISTORY is
|
||||||
true, do *not* update the query history stack."
|
true, do *not* update the query history stack."
|
||||||
(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)
|
||||||
(rewritten-expr (funcall mu4e-query-rewrite-function expr))
|
(rewritten-expr (funcall mu4e-query-rewrite-function expr))
|
||||||
(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
|
||||||
|
;; `mu4e~headers-view-win', which may have a live window if the
|
||||||
|
;; headers buffer already exists when `mu4e-get-headers-buffer'
|
||||||
|
;; is called.
|
||||||
(mu4e-headers-mode)
|
(mu4e-headers-mode)
|
||||||
|
(setq mu4e~headers-view-win view-window)
|
||||||
(unless ignore-history
|
(unless ignore-history
|
||||||
;; save the old present query to the history list
|
;; save the old present query to the history list
|
||||||
(when mu4e--search-last-query
|
(when mu4e--search-last-query
|
||||||
|
|
Loading…
Reference in New Issue