mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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.
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user