From 1d7b7a00ce055d9fd2403fe6802754f8c66621cc Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 24 Jun 2012 09:45:01 +0300 Subject: [PATCH] * mu4e-view: be a bit more strict when considering lines for citation --- emacs/mu4e-view.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/emacs/mu4e-view.el b/emacs/mu4e-view.el index 734c4e5e..7b047321 100644 --- a/emacs/mu4e-view.el +++ b/emacs/mu4e-view.el @@ -560,14 +560,16 @@ 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* ((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)))) + ;; consider only lines that heuristically look like a citation line... + (when (looking-at "[[:blank:]]*[^[:blank:]]*[[:blank:]]*>") + (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