From 7ab825157f2b60e9b2e846d57a5af9a896bb5adf Mon Sep 17 00:00:00 2001 From: TEC Date: Sat, 11 Sep 2021 23:44:37 +0800 Subject: [PATCH] feat(mu4e): make the unicode bullet customizable By popular demand. Close #5452. --- modules/email/mu4e/autoload/advice.el | 6 +++--- modules/email/mu4e/config.el | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/email/mu4e/autoload/advice.el b/modules/email/mu4e/autoload/advice.el index b38bffc59..28a581a8c 100644 --- a/modules/email/mu4e/autoload/advice.el +++ b/modules/email/mu4e/autoload/advice.el @@ -13,7 +13,7 @@ clicked." (lambda(m) (format "%s" (propertize (match-string 1 m) 'face '(mode-line-emphasis bold)))) - (replace-regexp-in-string "\t\\*" "\t⚫" str))) + (replace-regexp-in-string "\t\\*" (format "\t%s" +mu4e-main-bullet) str))) (map (make-sparse-keymap)) (func (if (functionp func-or-shortcut) func-or-shortcut @@ -29,8 +29,8 @@ clicked." ;;;###autoload (defun +mu4e~main-keyval-str-prettier-a (str) - "Replace '*' with '⚫' in STR." - (replace-regexp-in-string "\t\\*" "\t⚫" str)) + "Replace '*' with `+mu4e-main-bullet' in STR." + (replace-regexp-in-string "\t\\*" (format "\t%s" +mu4e-main-bullet) str)) ;; Org msg LaTeX image scaling diff --git a/modules/email/mu4e/config.el b/modules/email/mu4e/config.el index 99e7b193c..850fb8115 100644 --- a/modules/email/mu4e/config.el +++ b/modules/email/mu4e/config.el @@ -279,6 +279,11 @@ This should already be the case yet it does not always seem to be." :before #'mu4e-compose-resend (read-only-mode -1)) + (defvar +mu4e-main-bullet "⚫" + "Prefix to use instead of \" *\" in the mu4e main view. +This is enacted by `+mu4e~main-action-str-prettier-a' and +`+mu4e~main-keyval-str-prettier-a'.") + (advice-add #'mu4e~key-val :filter-return #'+mu4e~main-keyval-str-prettier-a) (advice-add #'mu4e~main-action-str :override #'+mu4e~main-action-str-prettier-a) (when (featurep! :editor evil)