From 2662d68ae89cf782351fa7801ef8a77087e07bad Mon Sep 17 00:00:00 2001 From: TEC Date: Tue, 20 Sep 2022 22:47:28 +0800 Subject: [PATCH] fix(mu4e): only widen the mu4e headers frame It's a bit silly to just unconditionally widen the current frame when you could have the mu4e headers view in another frame entirely. Instead we can look for the mu4e headers buffer, and only widen frames where it is the active buffer. --- modules/email/mu4e/config.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/email/mu4e/config.el b/modules/email/mu4e/config.el index 0481e723a..4fc3229ff 100644 --- a/modules/email/mu4e/config.el +++ b/modules/email/mu4e/config.el @@ -245,9 +245,12 @@ is non-nil." ;; so if the header view is entered from a narrow frame, ;; it's probably worth trying to expand it (defun +mu4e-widen-frame-maybe () - "Expand the frame with if it's less than `+mu4e-min-header-frame-width'." - (when (< (frame-width) +mu4e-min-header-frame-width) - (set-frame-width (selected-frame) +mu4e-min-header-frame-width))) + "Expand the mu4e-headers containing frame's width to `+mu4e-min-header-frame-width'." + (dolist (frame (frame-list)) + (when (and (string= (buffer-name (window-buffer (frame-selected-window frame))) + mu4e-headers-buffer-name) + (< (frame-width) +mu4e-min-header-frame-width)) + (set-frame-width frame +mu4e-min-header-frame-width)))) (add-hook 'mu4e-headers-mode-hook #'+mu4e-widen-frame-maybe) (when (fboundp 'imagemagick-register-types)