Merge pull request #387 from thierryvolpiatto/master
* mu4e: fully fix last pull request about `mu4e~fontify-cited`
This commit is contained in:
@ -1086,17 +1086,16 @@ receive (:info add :path <path> :docid <docid>) as well as (:update
|
|||||||
"Colorize message content based on the citation level. This is
|
"Colorize message content based on the citation level. This is
|
||||||
used in the view and compose modes."
|
used in the view and compose modes."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let ((more-lines t))
|
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(when (search-forward-regexp "^\n" nil t) ;; search the first empty line
|
(when (search-forward-regexp "^\n" nil t) ;; search the first empty line
|
||||||
(while (re-search-forward mu4e-cited-regexp nil t)
|
(while (re-search-forward mu4e-cited-regexp nil t)
|
||||||
(let* ((level (length (replace-regexp-in-string " " "" (match-string 1))))
|
(let* ((level (string-width (replace-regexp-in-string
|
||||||
(face
|
" " "" (match-string 1))))
|
||||||
(unless (zerop level)
|
(face (unless (zerop level)
|
||||||
(intern-soft (format "mu4e-cited-%d-face" level)))))
|
(intern-soft (format "mu4e-cited-%d-face" level)))))
|
||||||
(when face
|
(when face
|
||||||
(add-text-properties (line-beginning-position 1)
|
(add-text-properties (line-beginning-position 1)
|
||||||
(line-end-position 1) `(face ,face)))))))))
|
(line-end-position 1) `(face ,face))))))))
|
||||||
|
|
||||||
(defun mu4e~fontify-signature ()
|
(defun mu4e~fontify-signature ()
|
||||||
"Give the message signatures a distinctive color. This is used in
|
"Give the message signatures a distinctive color. This is used in
|
||||||
|
|||||||
@ -181,7 +181,7 @@ view buffer."
|
|||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'mu4e)
|
:group 'mu4e)
|
||||||
|
|
||||||
(defcustom mu4e-cited-regexp "^ *\\(> *>*\\)"
|
(defcustom mu4e-cited-regexp "^ *\\(\\(>+ ?\\)+\\)"
|
||||||
"Regular expression that determines whether a line is a citation."
|
"Regular expression that determines whether a line is a citation."
|
||||||
:type 'string
|
:type 'string
|
||||||
:group 'mu4e)
|
:group 'mu4e)
|
||||||
|
|||||||
Reference in New Issue
Block a user