From 988596a90427cb94382bc17781fd7dd612e08715 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Fri, 4 Sep 2020 11:17:58 +0200 Subject: [PATCH] [Emacs] Fix evaluation issue of `mu4e-headers-visible-columns' eval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes a bug introduced in 8c6e622a7c and 69dc8c7d7c where the mu4e-headers view’s width was set to a dynamic, frame-dependant value that could not be computed with Emacs launched as a headless server. This commit makes this value evaluate when the `mu4e-headers' mode is activated, and hence it should get the correct width of the current frame. --- org/config/spacemacs.org | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/org/config/spacemacs.org b/org/config/spacemacs.org index 4a34230..ea8b922 100644 --- a/org/config/spacemacs.org +++ b/org/config/spacemacs.org @@ -3224,12 +3224,16 @@ On modern-day computers, with wide screens almost everywhere, there is no reason for the email buffer to open below the email directory and not on its right, which is why I set the split view to be vertical instead of - horizontal. And to make it more readable, the header window will only occupy - 40% of Emacs’ frame, the rest will be given to emails. + 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. #+BEGIN_SRC emacs-lisp - (setq mu4e-split-view 'vertical - mu4e-headers-visible-columns (round (* (frame-total-cols) - 0.4))) + (setq mu4e-split-view 'vertical) + (add-hook 'mu4e-headers-mode-hook + (lambda () + (setq mu4e-headers-visible-columns (round (* (frame-total-cols) + 0.4))))) #+END_SRC This is the setup I have for my SMTP mail server: I point Emacs’ SMTP