+2003-09-28 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * wl-summary.el (wl-summary-buffer-unsync-mark-number-list): New
+ internal variable (buffer local).
+ (wl-summary-window-scroll-functions): New function.
+ (wl-summary-mode): Use it insteaf of wl-summary-lazy-highlight.
+ (wl-summary-rescan): Set wl-summary-buffer-unsync-mark-number-list
+ as nil.
+ (wl-summary-update-status-marks): Added arguments beg, end and
+ check.
+ (wl-summary-update-mark-window): Use function.
+ (wl-summary-sync-update): Follow the change above.
+ (wl-summary-switch-to-clone-buffer): Copy
+ wl-summary-buffer-unsync-mark-number-list.
+ (wl-summary-goto-folder-subr): Set
+ wl-summary-buffer-unsync-mark-number-list and
+ use wl-summary-window-scroll-functions insteaf of
+ wl-summary-lazy-highlight.
+
+ * wl-vars.el (wl-summary-lazy-update-mark): New user option.
+
2003-09-27 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* wl-summary.el (wl-summary-sync-update): Undo last chagne.
(defvar wl-summary-buffer-temp-mark-column nil)
(defvar wl-summary-buffer-persistent-mark-column nil)
+(defvar wl-summary-buffer-unsync-mark-number-list nil)
+
(defvar wl-summary-buffer-persistent nil)
(defvar wl-summary-buffer-thread-nodes nil)
(defvar wl-summary-buffer-target-mark-list nil)
(make-variable-buffer-local 'wl-summary-buffer-number-column)
(make-variable-buffer-local 'wl-summary-buffer-temp-mark-column)
(make-variable-buffer-local 'wl-summary-buffer-persistent-mark-column)
+(make-variable-buffer-local 'wl-summary-buffer-unsync-mark-number-list)
(make-variable-buffer-local 'wl-summary-buffer-persistent)
(make-variable-buffer-local 'wl-summary-buffer-thread-nodes)
(make-variable-buffer-local 'wl-summary-buffer-prev-refile-destination)
(not (wl-thread-entity-parent-invisible-p
(wl-thread-get-entity number)))))
+(defvar wl-summary-window-scroll-functions nil)
+
+(defun wl-summary-window-scroll-functions ()
+ (when (or wl-summary-lazy-highlight
+ wl-summary-lazy-update-mark)
+ (or wl-summary-window-scroll-functions
+ (setq wl-summary-window-scroll-functions
+ (append
+ (and wl-summary-lazy-highlight
+ '(wl-highlight-summary-window))
+ (and wl-summary-lazy-update-mark
+ '(wl-summary-update-mark-window)))))))
+
(defun wl-status-update ()
(interactive)
(wl-address-init))
selective-display-ellipses nil)
(wl-mode-line-buffer-identification '(wl-summary-buffer-mode-line))
(easy-menu-add wl-summary-mode-menu)
- (when wl-summary-lazy-highlight
- (if wl-on-xemacs
- (progn
- (make-local-variable 'pre-idle-hook)
- (add-hook 'pre-idle-hook 'wl-highlight-summary-window))
- (make-local-variable 'window-scroll-functions)
- (add-hook 'window-scroll-functions 'wl-highlight-summary-window)))
+ (when (wl-summary-window-scroll-functions)
+ (let ((variable (if wl-on-xemacs
+ (make-local-variable 'pre-idle-hook)
+ (make-local-variable 'window-scroll-functions))))
+ (dolist (function (wl-summary-window-scroll-functions))
+ (add-hook variable function))))
;; 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))
wl-thread-entities nil
wl-summary-scored nil
wl-summary-buffer-number-list nil
+ wl-summary-buffer-unsync-mark-number-list nil
wl-summary-buffer-target-mark-list nil
wl-summary-buffer-temp-mark-list nil
wl-summary-delayed-update nil)
(wl-summary-update-modeline)
(wl-summary-folder-info-update))))
-(defun wl-summary-update-status-marks ()
+(defun wl-summary-update-status-marks (beg end &optional check)
"Synchronize status marks on current buffer to the msgdb."
(interactive)
(save-excursion
- (goto-char (point-min))
- (while (not (eobp))
- (wl-summary-update-persistent-mark)
+ (goto-char beg)
+ (while (and (< (point) end) (not (eobp)))
+ (when (or (not check)
+ (let ((number (wl-summary-message-number)))
+ (when (memq number wl-summary-buffer-unsync-mark-number-list)
+ (setq wl-summary-buffer-unsync-mark-number-list
+ (delq number
+ wl-summary-buffer-unsync-mark-number-list))
+ t)))
+ (wl-summary-update-persistent-mark))
(forward-line 1))))
+(defun wl-summary-update-mark-window (&optional win beg)
+ "Update persistent mark in visible summary window.
+This function is defined for `window-scroll-functions'"
+ (with-current-buffer (window-buffer win)
+ (when (eq major-mode 'wl-summary-mode)
+ (let ((start (window-start win))
+ (end (condition-case nil
+ (window-end win t) ; old emacsen doesn't support 2nd arg.
+ (error (window-end win)))))
+ (wl-summary-update-status-marks start end 'check)))))
+
(defun wl-summary-insert-message (&rest args)
(if (eq wl-summary-buffer-view 'thread)
(apply 'wl-summary-insert-thread args)
(when delete-list
(wl-summary-delete-messages-on-buffer delete-list))
- (wl-summary-update-status-marks)
+ (unless wl-summary-lazy-update-mark
+ (wl-summary-update-status-marks (point-min) (point-max)))
(setq num (length append-list))
(setq i 0)
(setq wl-summary-delayed-update nil)
wl-summary-buffer-message-modified
wl-summary-buffer-thread-modified
wl-summary-buffer-number-list
+ wl-summary-buffer-unsync-mark-number-list
wl-summary-buffer-folder-name
wl-summary-buffer-line-formatter)
(and (eq wl-summary-buffer-view 'thread)
(wl-summary-update-modeline)))
(unless (eq wl-summary-buffer-view 'thread)
(wl-summary-make-number-list))
+ (setq wl-summary-buffer-unsync-mark-number-list
+ (copy-sequence wl-summary-buffer-number-list))
(when (and wl-summary-cache-use
(or (and wl-summary-check-line-format
(wl-summary-line-format-changed-p))
;; entity-id is unknown.
(wl-folder-set-current-entity-id
(wl-folder-get-entity-id entity)))
- (when (and wl-summary-lazy-highlight
+ (when (and (wl-summary-window-scroll-functions)
wl-on-xemacs)
(sit-for 0))
(unwind-protect