X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=wl%2Fwl-highlight.el;h=9cbfd2193fed860a1e122dcb97517628b76c0981;hb=709366cf00291239e4287abb0b2105ad47fdbf59;hp=bbb0e1fe10781b9cb5188ad14c272fd876e9c850;hpb=0fbd8fa3e611a5f03687ff7e11f98083d67bc1ce;p=elisp%2Fwanderlust.git diff --git a/wl/wl-highlight.el b/wl/wl-highlight.el index bbb0e1f..9cbfd21 100644 --- a/wl/wl-highlight.el +++ b/wl/wl-highlight.el @@ -777,14 +777,14 @@ (defun wl-highlight-summary-line-string (line mark temp-mark indent) (let (fsymbol) (cond ((and (string= temp-mark "+") - (member mark (list wl-summary-unread-cached-mark - wl-summary-unread-uncached-mark - wl-summary-new-mark))) + (member mark (list elmo-msgdb-unread-cached-mark + elmo-msgdb-unread-uncached-mark + elmo-msgdb-new-mark))) (setq fsymbol 'wl-highlight-summary-high-unread-face)) ((and (string= temp-mark "-") - (member mark (list wl-summary-unread-cached-mark - wl-summary-unread-uncached-mark - wl-summary-new-mark))) + (member mark (list elmo-msgdb-unread-cached-mark + elmo-msgdb-unread-uncached-mark + elmo-msgdb-new-mark))) (setq fsymbol 'wl-highlight-summary-low-unread-face)) ((string= temp-mark "o") (setq fsymbol 'wl-highlight-summary-refiled-face)) @@ -794,12 +794,12 @@ (setq fsymbol 'wl-highlight-summary-deleted-face)) ((string= temp-mark "*") (setq fsymbol 'wl-highlight-summary-temp-face)) - ((string= mark wl-summary-new-mark) + ((string= mark elmo-msgdb-new-mark) (setq fsymbol 'wl-highlight-summary-new-face)) - ((member mark (list wl-summary-unread-cached-mark - wl-summary-unread-uncached-mark)) + ((member mark (list elmo-msgdb-unread-cached-mark + elmo-msgdb-unread-uncached-mark)) (setq fsymbol 'wl-highlight-summary-unread-face)) - ((or (string= mark wl-summary-important-mark)) + ((or (string= mark elmo-msgdb-important-mark)) (setq fsymbol 'wl-highlight-summary-important-face)) ((string= temp-mark "-") (setq fsymbol 'wl-highlight-summary-low-read-face)) @@ -818,12 +818,6 @@ (let ((inhibit-read-only t) (case-fold-search nil) temp-mark status-mark (deactivate-mark nil) - (sregexp (concat - "^" - wl-summary-buffer-number-regexp - "\\(.\\)\\(.\\)../..\(.*\)..:.. \\(" - wl-highlight-thread-indent-string-regexp - "\\)[[<]")) fregexp fsymbol bol eol matched thread-top looked-at dest ds) (end-of-line) (setq eol (point)) @@ -831,45 +825,38 @@ (setq bol (point)) (if smark (setq status-mark smark) - (setq looked-at (looking-at sregexp)) - (when looked-at - (setq status-mark (buffer-substring (match-beginning 2) - (match-end 2))))) + (setq status-mark (wl-summary-persistent-mark))) (when temp-too - (unless looked-at - (setq looked-at (looking-at sregexp))) - (when looked-at - (setq temp-mark (buffer-substring (match-beginning 1) - (match-end 1))) - (cond - ((string= temp-mark "*") - (setq fsymbol 'wl-highlight-summary-temp-face)) - ((string= temp-mark "D") - (setq fsymbol 'wl-highlight-summary-deleted-face)) - ((string= temp-mark "O") - (setq fsymbol 'wl-highlight-summary-copied-face - dest t)) - ((string= temp-mark "o") - (setq fsymbol 'wl-highlight-summary-refiled-face - dest t))))) + (setq temp-mark (wl-summary-temp-mark)) + (cond + ((string= temp-mark "*") + (setq fsymbol 'wl-highlight-summary-temp-face)) + ((string= temp-mark "D") + (setq fsymbol 'wl-highlight-summary-deleted-face)) + ((string= temp-mark "O") + (setq fsymbol 'wl-highlight-summary-copied-face + dest t)) + ((string= temp-mark "o") + (setq fsymbol 'wl-highlight-summary-refiled-face + dest t)))) (if (not fsymbol) (cond ((and (string= temp-mark "+") - (member status-mark (list wl-summary-unread-cached-mark - wl-summary-unread-uncached-mark - wl-summary-new-mark))) + (member status-mark (list elmo-msgdb-unread-cached-mark + elmo-msgdb-unread-uncached-mark + elmo-msgdb-new-mark))) (setq fsymbol 'wl-highlight-summary-high-unread-face)) ((and (string= temp-mark "-") - (member status-mark (list wl-summary-unread-cached-mark - wl-summary-unread-uncached-mark - wl-summary-new-mark))) + (member status-mark (list elmo-msgdb-unread-cached-mark + elmo-msgdb-unread-uncached-mark + elmo-msgdb-new-mark))) (setq fsymbol 'wl-highlight-summary-low-unread-face)) - ((string= status-mark wl-summary-new-mark) + ((string= status-mark elmo-msgdb-new-mark) (setq fsymbol 'wl-highlight-summary-new-face)) - ((member status-mark (list wl-summary-unread-cached-mark - wl-summary-unread-uncached-mark)) + ((member status-mark (list elmo-msgdb-unread-cached-mark + elmo-msgdb-unread-uncached-mark)) (setq fsymbol 'wl-highlight-summary-unread-face)) - ((string= status-mark wl-summary-important-mark) + ((string= status-mark elmo-msgdb-important-mark) (setq fsymbol 'wl-highlight-summary-important-face)) ;; score mark ((string= temp-mark "-") @@ -877,10 +864,9 @@ ((string= temp-mark "+") (setq fsymbol 'wl-highlight-summary-high-read-face)) ;; - (t (if (and looked-at - (string= (buffer-substring - (match-beginning 3) - (match-end 3)) "")) + (t (if (null + (wl-thread-entity-get-parent-entity + (wl-thread-get-entity (wl-summary-message-number)))) (setq fsymbol 'wl-highlight-summary-thread-top-face) (setq fsymbol 'wl-highlight-summary-normal-face))))) (put-text-property bol eol 'face fsymbol) @@ -968,7 +954,7 @@ Variables used: (interactive) (wl-highlight-summary (point-min)(point-max))) -(defun wl-highlight-summary (start end) +(defun wl-highlight-summary (start end &optional lazy) "Highlight summary between start and end. Faces used: wl-highlight-summary-unread-face unread messages @@ -998,17 +984,11 @@ Variables used: (setq i 0) (while (and (not (eobp)) (< (point) end)) - (wl-highlight-summary-current-line nil nil - (or wl-summary-lazy-highlight - wl-summary-scored)) - (when (and (not wl-summary-lazy-highlight) - (> lines elmo-display-progress-threshold)) - (setq i (+ i 1)) - (setq percent (/ (* i 100) lines)) - (if (or (zerop (% percent 5)) (= i lines)) - (elmo-display-progress - 'wl-highlight-summary "Highlighting..." - percent))) + (when (or (not lazy) + (null (get-text-property (point) 'face))) + (wl-highlight-summary-current-line nil nil + (or wl-summary-lazy-highlight + wl-summary-scored))) (forward-line 1)) (unless wl-summary-lazy-highlight (message "Highlighting...done"))))) @@ -1018,12 +998,11 @@ Variables used: This function is defined for `window-scroll-functions'" (if wl-summary-highlight (with-current-buffer (window-buffer win) - (wl-highlight-summary (window-start win) - (save-excursion - (goto-char (window-start win)) - (forward-line (frame-height)) - (point))) - (set-buffer-modified-p nil)))) + (when (eq major-mode 'wl-summary-mode) + (wl-highlight-summary (window-start win) + (window-end win) + 'lazy) + (set-buffer-modified-p nil))))) (defun wl-highlight-headers (&optional for-draft) (let ((beg (point-min))