* cleanup mu4e~view-fontify-cited a bit, and add a few levels

This commit is contained in:
djcb 2012-05-20 20:13:27 +03:00
parent ea101876e2
commit 605657d4de
2 changed files with 24 additions and 12 deletions

View File

@ -270,13 +270,31 @@ flag set)."
"Face for cited message parts (level 4)."
:group 'mu4e-faces)
(defface mu4e-cited-5-face
'((t :inherit font-lock-comment-face :bold nil :italic t))
"Face for cited message parts (level 5)."
:group 'mu4e-faces)
(defface mu4e-cited-6-face
'((t :inherit font-lock-comment-delimiter-face :bold nil :italic t))
"Face for cited message parts (level 6)."
:group 'mu4e-faces)
(defface mu4e-cited-7-face
'((t :inherit font-lock-preprocessor-face :bold nil :italic t))
"Face for cited message parts (level 7)."
:group 'mu4e-faces)
(defface mu4e-system-face
'((t :inherit font-lock-comment-face :slant italic))
"Face for system message (such as the footers for message
headers)."
:group 'mu4e-faces)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; internal variables / constants
@ -299,7 +317,7 @@ view). Most fields should be self-explanatory. A special one is
`mu4e-user-mail-address-regexp', in which case it will be equal to
`:to'.")
(defconst mu4e-logo
(propertize "mu4e" 'face 'mu4e-title-face)
"A propertized string for the mu4e 'logo'.")

View File

@ -551,17 +551,11 @@ Seen; if the message is not New/Unread, do nothing."
;; Get the citation level at point -- i.e., the number of '>'
;; prefixes, starting with 0 for 'no citation'
(beginning-of-line 1)
(let* ((text (re-search-forward "[[:word:]]" (line-end-position 1) t 1))
(level (or (and text
(how-many ">" (line-beginning-position 1) text)) 0))
(let* ((level (how-many ">" (line-beginning-position 1)
(line-end-position 1)))
(face
(cond
((= 0 level) nil) ;; don't do anything
((= 1 level) 'mu4e-cited-1-face)
((= 2 level) 'mu4e-cited-2-face)
((= 3 level) 'mu4e-cited-3-face)
((= 4 level) 'mu4e-cited-4-face)
(t nil))))
(unless (zerop level)
(intern-soft (format "mu4e-cited-%d-face" level)))))
(when face
(add-text-properties (line-beginning-position 1)
(line-end-position 1) `(face ,face))))