summaryrefslogtreecommitdiff
path: root/mu4e
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2026-04-06 11:26:27 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2026-04-06 12:10:28 +0300
commit5fde2a01b5ce7542970e708df12bd784bd855a58 (patch)
tree0818c509aa35e13c4546ad39b5097c18a29104a3 /mu4e
parentaf96af45740ba34c1c5089ed3eb02b628b43be90 (diff)
mu4e-headers: fix mu4e--in-headers-context
Two problems: 1) In mu4e--in-headers-context we went through the whole dance of finding the headers buffer even if we were already there. That's unnecessary and incidentally makes it impossible to go back from the "Found ..." line in the headers-buf to the previous one. Fixes #2913 2) We didn't handle the case where there _is_ no headers window, such as when in single-window mode.
Diffstat (limited to 'mu4e')
-rw-r--r--mu4e/mu4e-headers.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el
index 898d87b..a383401 100644
--- a/mu4e/mu4e-headers.el
+++ b/mu4e/mu4e-headers.el
@@ -900,15 +900,17 @@ COUNT is the number of messages found."
If we're already in the headers buffer/window, do nothing.
If we're in the message view, temporarily switch."
- `(progn
+ `(if (eq major-mode 'mu4e-headers-mode)
+ (progn ,@body)
(let* ((msg (mu4e-message-at-point))
(buffer (mu4e-get-headers-buffer))
(docid (mu4e-message-field msg :docid)))
(unless (and buffer msg docid)
(mu4e-error "Action is not possible"))
- ;; make sure to select the window if possible, or jumping won't be
- ;; reflected.
- (with-selected-window (get-buffer-window buffer)
+ ;; Select the window if possible, or jumping won't be reflected.
+ ;; Note: in single-window mode the headers buffer is probably not
+ ;; visible; in that case, fall back to the selected window.
+ (with-selected-window (or (get-buffer-window buffer) (selected-window))
(with-current-buffer buffer
(mu4e-thread-unfold-all)
(if (or (mu4e~headers-goto-docid docid)