[Emacs] Fix evaluation issue of `mu4e-headers-visible-columns' eval
All checks were successful
continuous-integration/drone/push Build is passing

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.
This commit is contained in:
Lucien Cartier-Tilet 2020-09-04 11:17:58 +02:00
parent 3164af60cc
commit 988596a904
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -3224,12 +3224,16 @@
On modern-day computers, with wide screens almost everywhere, there is no 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 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 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 horizontal. And to make it more readable, the header window will only occupy
40% of Emacs frame, the rest will be given to emails. 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 #+BEGIN_SRC emacs-lisp
(setq mu4e-split-view 'vertical (setq mu4e-split-view 'vertical)
mu4e-headers-visible-columns (round (* (frame-total-cols) (add-hook 'mu4e-headers-mode-hook
0.4))) (lambda ()
(setq mu4e-headers-visible-columns (round (* (frame-total-cols)
0.4)))))
#+END_SRC #+END_SRC
This is the setup I have for my SMTP mail server: I point Emacs SMTP This is the setup I have for my SMTP mail server: I point Emacs SMTP