* mu4e: make the faces a bit more generic

This commit is contained in:
djcb 2013-10-19 12:05:05 +03:00
parent 852ac46789
commit b53d2ec0c2
2 changed files with 31 additions and 22 deletions

View File

@ -408,28 +408,27 @@ I.e. a message with the draft flag set."
"Face for the mark in the headers list."
:group 'mu4e-faces)
(defface mu4e-view-header-key-face
(defface mu4e-header-key-face
'((t :inherit message-header-name :bold t))
"Face for a header key (such as \"Foo\" in \"Subject:\ Foo\") in
the message view."
"Face for a header key (such as \"Foo\" in \"Subject:\ Foo\")."
:group 'mu4e-faces)
(defface mu4e-view-header-value-face
(defface mu4e-header-value-face
'((t :inherit font-lock-doc-face))
"Face for a header value (such as \"Re: Hello!\") in the message view."
"Face for a header value (such as \"Re: Hello!\")."
:group 'mu4e-faces)
(defface mu4e-view-special-header-value-face
(defface mu4e-special-header-value-face
'((t :inherit font-lock-variable-name-face))
"Face for special header values in the message view."
"Face for special header values."
:group 'mu4e-faces)
(defface mu4e-view-link-face
(defface mu4e-link-face
'((t :inherit link))
"Face for showing URLs and attachments in the message view."
:group 'mu4e-faces)
(defface mu4e-view-contact-face
(defface mu4e-contact-face
'((t :inherit font-lock-variable-name-face))
"Face for showing URLs and attachments in the message view."
:group 'mu4e-faces)
@ -449,12 +448,12 @@ I.e. a message with the draft flag set."
"Face for message footers (signatures)."
:group 'mu4e-faces)
(defface mu4e-view-url-number-face
(defface mu4e-url-number-face
'((t :inherit font-lock-reference-face :bold t))
"Face for the number tags for URLs."
:group 'mu4e-faces)
(defface mu4e-view-attach-number-face
(defface mu4e-attach-number-face
'((t :inherit font-lock-variable-name-face :bold t))
"Face for the number tags for attachments."
:group 'mu4e-faces)
@ -509,7 +508,18 @@ I.e. a message with the draft flag set."
"Face for warnings / error."
:group 'mu4e-faces)
(defface mu4e-compose-separator-face
'((t :inherit message-separator :slant italic))
"Face for the separator between headers / message in
mu4e-compose-mode."
:group 'mu4e-faces)
(defface mu4e-compose-header-face
'((t :inherit message-separator :slant italic))
"Face for the separator between headers / message in
mu4e-compose-mode."
:group 'mu4e-faces)
;; headers info
(defconst mu4e-header-info
'( (:attachments .

View File

@ -86,7 +86,6 @@ This is only effective if you're using an emacs with Imagemagick
support, and `mu4e-view-show-images' is non-nil."
:group 'mu4e-view)
(defcustom mu4e-view-scroll-to-next t
"If non-nil, move to the next message when calling
`mu4e-view-scroll-up-or-next' (typically bound to SPC) when at the
@ -274,11 +273,11 @@ add text-properties to VAL."
(if (and val (> (length val) 0))
(with-temp-buffer
(insert (propertize (concat key ":")
'face 'mu4e-view-header-key-face
'face 'mu4e-header-key-face
'help-echo help) " "
(if dont-propertize-val
val
(propertize val 'face 'mu4e-view-header-value-face)) "\n")
(propertize val 'face 'mu4e-header-value-face)) "\n")
(when mu4e-view-fill-headers
;; temporarily set the fill column <margin> positions to the right, so
;; we can indent the following lines correctly
@ -351,7 +350,7 @@ at POINT, or if nil, at (point)."
'email email
'display (if mu4e-view-show-addresses long short)
'keymap map
'face 'mu4e-view-contact-face
'face 'mu4e-contact-face
'mouse-face 'highlight
'help-echo
(format "<%s>\n%s\n%s" email
@ -370,9 +369,9 @@ at POINT, or if nil, at (point)."
(if (symbolp flag)
(symbol-name flag)
flag)
'face 'mu4e-view-special-header-value-face))
'face 'mu4e-special-header-value-face))
val
(propertize ", " 'face 'mu4e-view-header-value-face)) t))
(propertize ", " 'face 'mu4e-header-value-face)) t))
(defun mu4e~view-construct-signature-header (msg)
"Construct a Signature: header, if there are any signed parts."
@ -466,8 +465,8 @@ at POINT, or if nil, at (point)."
(concat
(propertize (format "[%d]" id)
'face 'mu4e-view-attach-number-face)
(propertize name 'face 'mu4e-view-link-face
'face 'mu4e-attach-number-face)
(propertize name 'face 'mu4e-link-face
'keymap map
'mouse-face 'highlight
'help-echo
@ -476,7 +475,7 @@ at POINT, or if nil, at (point)."
"[mouse-2] or [S-RET] offers to save it"))
(when (and size (> size 0))
(propertize (format "(%s)" (mu4e-display-size size))
'face 'mu4e-view-header-key-face)))))
'face 'mu4e-header-key-face)))))
attachments ", ")))
(when attachments
(mu4e~view-construct-header :attachments attstr t))))
@ -791,7 +790,7 @@ Also number them so they can be opened using `mu4e-view-go-to-url'."
(define-key map [?\M-\r] (mu4e~view-browse-url-func url))
(puthash (incf num) url mu4e~view-link-map)
(add-text-properties 0 (length url)
`(face mu4e-view-link-face
`(face mu4e-link-face
mouse-face highlight
keymap ,map
help-echo
@ -799,7 +798,7 @@ Also number them so they can be opened using `mu4e-view-go-to-url'."
(replace-match
(concat url
(propertize (format "[%d]" num)
'face 'mu4e-view-url-number-face))))))))
'face 'mu4e-url-number-face))))))))
(defun mu4e~view-hide-cited ()