diff options
| author | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2026-04-17 23:35:40 +0300 |
|---|---|---|
| committer | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2026-04-17 23:35:40 +0300 |
| commit | 4898f343042ae523a8c7a30684c1965fdb86cb6a (patch) | |
| tree | 0b88f2588dedadc3a9fd85024be72eb4933354a5 | |
| parent | 0ffffcb5287775829b252ea40877c7ec3d831741 (diff) | |
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.
| -rw-r--r-- | mu4e/mu4e-headers.el | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index ba27c9c..f629cc6 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -802,17 +802,16 @@ to t before \"automatic\" searches.") Switch to the output buffer for the results." (let* ((buf (mu4e-get-headers-buffer nil t)) - (view-window mu4e~headers-view-win) (inhibit-read-only t) (maxnum (unless mu4e-search-full mu4e-search-results-limit))) (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) - (setq mu4e~headers-view-win view-window - list-buffers-directory expr) + ;; NOTE: `mu4e-headers-mode' resets all buffer-local variables, including + ;; `mu4e~headers-view-win', which may have a live window if the headers + ;; buffer already existed. Save & restore after the mode reset. + (let ((view-window mu4e~headers-view-win)) + (mu4e-headers-mode) + (setq mu4e~headers-view-win view-window + list-buffers-directory expr)) (mu4e--modeline-update)) ;; For interactive searches, display the buffer if not already visible; for |
