From d50f38db49f4af3b564bd70f3dec3cbc8a49aa41 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Fri, 4 Sep 2020 12:05:05 +0200 Subject: [PATCH] [Emacs] Mu4e react to window width rather than frame width MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Referring to the previous commit, it is actually better if the mu4e headers view sets its own width _when a message is opened_ and not when the headers view itself is opened. This commit also makes it so that the width is evaluated based on the width of the window of the headers view’s window rather than the width of the frame since the message will be opened in a new window that will spawn in the headers view's window. --- org/config/spacemacs.org | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org/config/spacemacs.org b/org/config/spacemacs.org index ea8b922..137bbdc 100644 --- a/org/config/spacemacs.org +++ b/org/config/spacemacs.org @@ -3227,12 +3227,13 @@ horizontal. And to make it more readable, the header window will only occupy 40% of Emacs’ frame, the rest will be given to emails. As you can see, the width of the mu4e headers is evaluated each time we enter it, so it can react - to the frame being potentially not the same width than earlier. + to the frame being potentially not the same width than earlier or the window + not taking the entire frame. #+BEGIN_SRC emacs-lisp (setq mu4e-split-view 'vertical) - (add-hook 'mu4e-headers-mode-hook + (add-hook 'mu4e-view-mode-hook (lambda () - (setq mu4e-headers-visible-columns (round (* (frame-total-cols) + (setq mu4e-headers-visible-columns (round (* (window-width) 0.4))))) #+END_SRC