diff --git a/emacs/mu4e-view.el b/emacs/mu4e-view.el index 372f3980..5d2f0f63 100644 --- a/emacs/mu4e-view.el +++ b/emacs/mu4e-view.el @@ -547,24 +547,25 @@ Seen; if the message is not New/Unread, do nothing." (save-excursion (let ((more-lines t)) (goto-char (point-min)) - (while more-lines - ;; Get the citation level at point -- i.e., the number of '>' - ;; prefixes, starting with 0 for 'no citation' - (beginning-of-line 1) - (let* ((level (how-many ">" (line-beginning-position 1) - (line-end-position 1))) - (face - (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)))) - (setq more-lines - (and (= 0 (forward-line 1)) - ;; we need to add this weird check below; it seems in some cases - ;; `forward-line' continues to return 0, even when at the end, which - ;; would lead to an infinite loop - (not (= (point-max) (line-end-position))))))))) + (when (search-forward-regexp "^\n") ;; search the first empty line + (while more-lines + ;; Get the citation level at point -- i.e., the number of '>' + ;; prefixes, starting with 0 for 'no citation' + (beginning-of-line 1) + (let* ((level (how-many ">" (line-beginning-position 1) + (line-end-position 1))) + (face + (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)))) + (setq more-lines + (and (= 0 (forward-line 1)) + ;; we need to add this weird check below; it seems in some cases + ;; `forward-line' continues to return 0, even when at the end, which + ;; would lead to an infinite loop + (not (= (point-max) (line-end-position)))))))))) (defun mu4e~view-fontify-footer () "Give the message footers a distinctive color."