From 7dfd7a9eac518e11aa8d0038f338464b7849d465 Mon Sep 17 00:00:00 2001 From: teranisi Date: Wed, 21 Feb 2001 02:03:12 +0000 Subject: [PATCH] * wl-vars.el (wl-summary-lazy-highlight): New variable. * wl-summary.el (wl-summary-mode): Set up window-scroll-functions when `wl-summary-lazy-highlight' is non-nil. (wl-summary-goto-folder-subr): Highlight only when `wl-summary-lazy-highlight' is non-nil. * wl-highlight.el (wl-highlight-summary): Fixed docstring; Don't display progress and highlight temp-mark when `wl-summary-lazy-highlight' is non-nil. (wl-highlight-summary-window): New function. (Based on the patch from Akihiro MOTOKI ) --- wl/ChangeLog | 15 ++++++++++++ wl/wl-highlight.el | 64 ++++++++++++++++++++++++++++------------------------ wl/wl-summary.el | 8 +++++-- wl/wl-vars.el | 13 +++++++++-- 4 files changed, 67 insertions(+), 33 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 3080f7e..0c8b63e 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,18 @@ +2001-02-21 Yuuichi Teranishi + + * wl-vars.el (wl-summary-lazy-highlight): New variable. + + * wl-summary.el (wl-summary-mode): Set up window-scroll-functions + when `wl-summary-lazy-highlight' is non-nil. + (wl-summary-goto-folder-subr): Highlight only when + `wl-summary-lazy-highlight' is non-nil. + + * wl-highlight.el (wl-highlight-summary): Fixed docstring; + Don't display progress and highlight temp-mark when + `wl-summary-lazy-highlight' is non-nil. + (wl-highlight-summary-window): New function. + (Based on the patch from Akihiro MOTOKI ) + 2001-02-20 Katsumi Yamaoka * wl-demo.el (wl-demo-image-type-alist): Use ' instead of `. diff --git a/wl/wl-highlight.el b/wl/wl-highlight.el index 4be1ac9..e73a998 100644 --- a/wl/wl-highlight.el +++ b/wl/wl-highlight.el @@ -986,38 +986,44 @@ Variables used: wl-highlight-summary-refiled-regexp matches messages mark as refiled wl-highlight-summary-copied-regexp matches messages mark as copied wl-highlight-summary-new-regexp matches new messages - -If HACK-SIG is true,then we search backward from END for something that -looks like the beginning of a signature block, and don't consider that a -part of the message (this is because signatures are often incorrectly -interpreted as cited text.)" +" (if (< end start) (let ((s start)) (setq start end end s))) - (let* ((lines (count-lines start end)) - (too-big (and wl-highlight-max-summary-lines - (> lines wl-highlight-max-summary-lines))) - (real-end end) - gc-message - e p hend i percent) + (let (lines too-big gc-message e p hend i percent) (save-excursion - (save-restriction - (widen) - (narrow-to-region start end) - (if (not too-big) - (save-restriction - (goto-char start) - (setq i 0) - (while (not (eobp)) - (wl-highlight-summary-current-line nil nil wl-summary-scored) - (when (> 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))) - (forward-line 1)) - (message "Highlighting...done"))))))) + (unless wl-summary-lazy-highlight + (setq lines (count-lines start end) + too-big (and wl-highlight-max-summary-lines + (> lines wl-highlight-max-summary-lines)))) + (goto-char start) + (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))) + (forward-line 1)) + (unless wl-summary-lazy-highlight + (message "Highlighting...done"))))) + +(defun wl-highlight-summary-window (&optional win beg) + "Highlight summary window. +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)))))) (defun wl-highlight-headers (&optional for-draft) (let ((beg (point-min)) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index ce735a2..376947b 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -777,6 +777,9 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." wl-summary-buffer-folder-indicator wl-summary-buffer-unread-status)) (easy-menu-add wl-summary-mode-menu) + (when wl-summary-lazy-highlight + (make-local-variable 'window-scroll-functions) + (add-hook 'window-scroll-functions 'wl-highlight-summary-window)) ;; This hook may contain the function `wl-setup-summary' for reasons ;; of system internal to accord facilities for the Emacs variants. (run-hooks 'wl-summary-mode-hook)) @@ -2750,7 +2753,7 @@ If ARG, without confirm." (wl-summary-buffer-number-column-detect t) (wl-summary-disp-msg fld (and reuse-buf keep-cursor)) (unless (and reuse-buf keep-cursor) - (setq hilit wl-summary-highlight) + ;(setq hilit wl-summary-highlight) (unwind-protect (let ((wl-summary-highlight (if reuse-buf wl-summary-highlight)) (wl-use-scoring @@ -2791,8 +2794,9 @@ If ARG, without confirm." (forward-line -1) (wl-summary-prev)) (setq retval 'more-next)) - (setq wl-summary-highlight hilit) + ;(setq wl-summary-highlight hilit) (if (and wl-summary-highlight + (not wl-summary-lazy-highlight) (not reuse-buf)) (if (and wl-summary-highlight-partial-threshold (> (count-lines (point-min) (point-max)) diff --git a/wl/wl-vars.el b/wl/wl-vars.el index 67a06a9..b6921f9 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -991,15 +991,24 @@ ex. :group 'wl-summary :group 'wl-highlight) +(defcustom wl-summary-lazy-highlight (and (boundp 'window-scroll-functions) + (not wl-on-xemacs)) + "Non-nil forces lazy summary highlighting using `window-scroll-functions'." + :type 'boolean + :group 'wl-summary + :group 'wl-highlight) + (defcustom wl-summary-highlight-partial-threshold 1000 - "Summary is not highlighted entirely if there are lines more than this value." + "Summary is not highlighted entirely if there are lines more than this value. +Available if only `wl-summary-lazy-highlight' is nil." :type 'integer :group 'wl-summary :group 'wl-highlight) (defcustom wl-summary-partial-highlight-above-lines 30 "If Summary has lines more than `wl-summary-highlight-partial-threshold', -Summary lines are highlighted partialy above current position." +Summary lines are highlighted partialy above current position. +Available if only `wl-summary-lazy-highlight' is nil." :type 'integer :group 'wl-summary :group 'wl-highlight) -- 1.7.10.4