mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
notmuch.el: Use message-mode font-face to highlight mail headers
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
This commit is contained in:
parent
6da6566576
commit
8418dee2f6
1 changed files with 27 additions and 2 deletions
29
notmuch.el
29
notmuch.el
|
@ -627,6 +627,32 @@ which this thread was originally shown."
|
|||
(set-marker beg nil)
|
||||
(set-marker end nil)
|
||||
)))
|
||||
(defun notmuch-fontify-headers ()
|
||||
(progn
|
||||
(if (looking-at "[Tt]o:")
|
||||
(progn
|
||||
(overlay-put (make-overlay (point) (re-search-forward ":"))
|
||||
'face 'message-header-name)
|
||||
(overlay-put (make-overlay (point) (re-search-forward ".*$"))
|
||||
'face 'message-header-to))
|
||||
(if (looking-at "[B]?[Cc][Cc]:")
|
||||
(progn
|
||||
(overlay-put (make-overlay (point) (re-search-forward ":"))
|
||||
'face 'message-header-name)
|
||||
(overlay-put (make-overlay (point) (re-search-forward ".*$"))
|
||||
'face 'message-header-cc))
|
||||
(if (looking-at "[Ss]ubject:")
|
||||
(progn
|
||||
(overlay-put (make-overlay (point) (re-search-forward ":"))
|
||||
'face 'message-header-name)
|
||||
(overlay-put (make-overlay (point) (re-search-forward ".*$"))
|
||||
'face 'message-header-subject))
|
||||
(if (looking-at "[Ff]rom:")
|
||||
(progn
|
||||
(overlay-put (make-overlay (point) (re-search-forward ":"))
|
||||
'face 'message-header-name)
|
||||
(overlay-put (make-overlay (point) (re-search-forward ".*$"))
|
||||
'face 'message-header-other))))))))
|
||||
|
||||
(defun notmuch-show-markup-header (depth)
|
||||
(re-search-forward notmuch-show-header-begin-regexp)
|
||||
|
@ -647,8 +673,7 @@ which this thread was originally shown."
|
|||
(forward-line)
|
||||
(while (looking-at "[A-Za-z][-A-Za-z0-9]*:")
|
||||
(beginning-of-line)
|
||||
(overlay-put (make-overlay (point) (re-search-forward ":"))
|
||||
'face 'bold)
|
||||
(notmuch-fontify-headers)
|
||||
(forward-line)
|
||||
)
|
||||
(indent-rigidly beg end depth)
|
||||
|
|
Loading…
Reference in a new issue