Mu4e: start using thread folding package

It does what it says on the tin, and mu4e doesn't (currently) do this.
This commit is contained in:
TEC 2021-04-05 02:59:57 +08:00
parent 16fd26e5ba
commit 32b07003fb
No known key found for this signature in database
GPG key ID: 779591AFDB81F06C
2 changed files with 32 additions and 0 deletions

View file

@ -214,6 +214,35 @@
(advice-add 'mu4e~start :around #'+mu4e-lock-start)
(advice-add 'mu4e-quit :after #'+mu4e-lock-file-delete-maybe))
(use-package! mu4e-thread-folding
:after mu4e
:config
(setq mu4e-thread-folding-root-folded-prefix-string (propertize "" 'face 'shadow)
mu4e-thread-folding-root-unfolded-prefix-string (propertize "" 'face 'shadow))
(custom-set-faces!
'(mu4e-thread-folding-root-unfolded-face :weight bold :slant italic :inherit hl-line :extend t)
'(mu4e-thread-folding-child-face :inherit hl-line :extend t))
(map! :map mu4e-headers-mode-map
:ne "<tab>" #'mu4e-headers-toggle-at-point
:ne "<left>" #'mu4e-headers-fold-at-point
:ne "<S-left>" #'mu4e-headers-fold-all
:ne "<right>" #'mu4e-headers-unfold-at-point
:ne "<S-right>" #'mu4e-headers-unfold-all)
(when (featurep! :editor evil)
(defadvice! +mu4e-thread-folding-move-to-column-1-a (&rest _)
"Move the point to column 1.
When using evil, having the cursor at column 0 causes issues,
so we make sure that it's put a column 1 so everything works nicely."
:before #'mu4e-headers-toggle-at-point
:before #'mu4e-headers-fold-at-point
:before #'mu4e-headers-unfold-at-point
:before #'mu4e-headers-view-message
:before #'mu4e-compose-reply
:before #'mu4e-compose-forward
(unless (= (current-column) 1)
(move-to-column 1 t)))))
(unless (featurep! +org)
(after! mu4e
(defun org-msg-mode (&optional _)

View file

@ -5,3 +5,6 @@
(package! org-msg :pin "89e746c0a864031eef940758230bc7263a6f2289"))
(package! mu4e-alert :pin "91f0657c5b245a9de57aa38391221fb5d141d9bd")
(package! mu4e-thread-folding :recipe (:host github :repo "rougier/mu4e-thread-folding")
:pin "56bb25a1addba4c6ed79c4e5d1a580d80cc698f2")