From 829e4332037df0e05d7f2766453a4de6e53ada67 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 22 Feb 2019 07:08:38 +0100 Subject: [PATCH] Stop highlighting trailing whitespace in mail buffers --- configuration.org | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/configuration.org b/configuration.org index 4a933b9..2ce3de4 100644 --- a/configuration.org +++ b/configuration.org @@ -2250,6 +2250,22 @@ Then configure ~real-auto-save-mode~ ** Mailing with mu4e +Due to my programming (and maybe a bit of OCD) needs, i set trailing whitespace to have a red +background so it stands out *a lot*. However, many emails contain a lot of trailing whitespace +which makes them really hard to read in Emacs. + +The below snippet creates a trailing whitespace face specific to mu4e view buffers. The +accompanying function will be added to ~mu4e-view-mode-hook~. + +#+BEGIN_SRC emacs-lisp +(copy-face 'trailing-whitespace 'trailing-whitespace-mu4e) +(set-face-attribute 'trailing-whitespace-mu4e nil :background 'unspecified) + +(defun gpolonkai/mu4e-trailing-whitespace-fix () + (set (make-local-variable 'face-remapping-alist) + '((trailing-whitespace trailing-whitespace-mu4e)))) +#+END_SRC + #+BEGIN_SRC emacs-lisp (use-package mu4e :after helm @@ -2293,6 +2309,8 @@ Then configure ~real-auto-save-mode~ (mu4e-completing-read-function 'helm-comp-read) (mu4e-context-policy 'pick-first) (mu4e-confirm-quit nil) + :hook + (mu4e-view-mode . gpolonkai/mu4e-trailing-whitespace-fix) :bind (:map gpolonkai/pers-map ("m m" . mu4e)