* wl-summary.el (wl-summary-replace-status-marks): Disable
authoryoichi <yoichi>
Wed, 30 Apr 2003 01:17:15 +0000 (01:17 +0000)
committeryoichi <yoichi>
Wed, 30 Apr 2003 01:17:15 +0000 (01:17 +0000)
interactive use.
(wl-summary-reedit): Check message existence at first.
(wl-summary-mark-line): Fix doc, return value is indefinite.

* wl-highlight.el (wl-highlight-message): Arranged.

* wl-highlight.el (wl-highlight-summary-current-line): Abolish
unused 1st and 2nd arguments. Abolish 3rd argument `temp-too' and
check temp-mark by wl-summary-temp-mark always.
(wl-highlight-summary): Change accordingly.
* wl-summary.el (wl-summary-mark-as-read-all)
(wl-summary-delete-cache, wl-summary-set-score-mark)
(wl-summary-mark-as-unread, wl-summary-unmark)
(wl-summary-mark-line, wl-summary-mark-as-read)
(wl-summary-mark-as-important): Ditto.

* wl-highlight.el (wl-highlight-summary-window): Re-calculate the
end of the window if possible.
* wl-summary.el (wl-summary-sync-update): Support lazy
highlighting.

wl/ChangeLog
wl/wl-highlight.el
wl/wl-summary.el

index a2ea8fd..43895dc 100644 (file)
@@ -1,3 +1,27 @@
+2003-04-30  Yoichi NAKAYAMA  <yoichi@geiin.org>
+
+       * wl-summary.el (wl-summary-replace-status-marks): Disable
+       interactive use.
+       (wl-summary-reedit): Check message existence at first.
+       (wl-summary-mark-line): Fix doc, return value is indefinite.
+
+       * wl-highlight.el (wl-highlight-message): Arranged.
+
+       * wl-highlight.el (wl-highlight-summary-current-line): Abolish
+       unused 1st and 2nd arguments. Abolish 3rd argument `temp-too' and
+       check temp-mark by wl-summary-temp-mark always.
+       (wl-highlight-summary): Change accordingly.
+       * wl-summary.el (wl-summary-mark-as-read-all)
+       (wl-summary-delete-cache, wl-summary-set-score-mark)
+       (wl-summary-mark-as-unread, wl-summary-unmark)
+       (wl-summary-mark-line, wl-summary-mark-as-read)
+       (wl-summary-mark-as-important): Ditto.
+
+       * wl-highlight.el (wl-highlight-summary-window): Re-calculate the
+       end of the window if possible.
+       * wl-summary.el (wl-summary-sync-update): Support lazy
+       highlighting.
+
 2003-04-09  Yoichi NAKAYAMA  <yoichi@geiin.org>
 
        * wl-util.el (wl-as-coding-system): Define for non-mule too.
index 399befc..840e028 100644 (file)
   (if wl-use-highlight-mouse-line
       (put-text-property 0 (length line) 'mouse-face 'highlight line)))
 
-(defun wl-highlight-summary-current-line (&optional smark regexp temp-too)
+(defun wl-highlight-summary-current-line ()
   (interactive)
   (save-excursion
     (let ((inhibit-read-only t)
          (case-fold-search nil) temp-mark status-mark
          (deactivate-mark nil)
-         fregexp fsymbol bol eol matched thread-top looked-at dest ds)
+         fsymbol bol eol matched thread-top looked-at dest ds)
       (end-of-line)
       (setq eol (point))
       (beginning-of-line)
       (setq bol (point))
-      (if smark
-         (setq status-mark smark)
-       (setq status-mark (wl-summary-persistent-mark)))
-      (when temp-too
-       (setq temp-mark (wl-summary-temp-mark))
+      (setq status-mark (wl-summary-persistent-mark))
+      (when (setq temp-mark (wl-summary-temp-mark))
        (cond
         ((string= temp-mark "*")
          (setq fsymbol 'wl-highlight-summary-temp-face))
@@ -963,9 +960,7 @@ Faces used:
                  (< (point) end))
        (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)))
+         (wl-highlight-summary-current-line))
        (forward-line 1))
       (unless wl-summary-lazy-highlight
        (message "Highlighting...done")))))
@@ -973,13 +968,17 @@ Faces used:
 (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)
-       (when (eq major-mode 'wl-summary-mode)
-         (wl-highlight-summary (window-start win)
-                               (window-end win)
-                               'lazy)
-         (set-buffer-modified-p nil)))))
+  (when wl-summary-highlight
+    (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 3rd arg.
+                    (error (window-end win)))))
+         (wl-highlight-summary start
+                               end
+                               'lazy))
+       (set-buffer-modified-p nil)))))
 
 (defun wl-highlight-headers (&optional for-draft)
   (let ((beg (point-min))
@@ -1080,8 +1079,7 @@ interpreted as cited text.)"
        (real-end end)
        current  beg
        e p hend)
-    (if too-big
-       nil
+    (unless too-big
       (save-excursion
        (save-restriction
          (widen)
@@ -1110,29 +1108,27 @@ interpreted as cited text.)"
              (goto-char start)
              (while (and (not body-only)
                          (not (eobp)))
-               (cond
-                ((looking-at "^[^ \t\n:]+[ \t]*:")
-                 (put-text-property (match-beginning 0) (match-end 0)
-                                    'face 'wl-highlight-message-headers)
-                 (setq p (match-end 0))
-                 (setq hend (save-excursion (std11-field-end end)))
-                 (cond
-                  ((catch 'match
-                     (let ((regexp-alist wl-highlight-message-header-alist))
-                       (while regexp-alist
-                         (when (save-match-data
-                                 (looking-at (caar regexp-alist)))
-                           (put-text-property p hend 'face
-                                              (cdar regexp-alist))
-                           (throw 'match t))
-                         (setq regexp-alist (cdr regexp-alist)))
-                       (throw 'match nil))))
-                  (t
-                   (put-text-property
-                    p hend 'face 'wl-highlight-message-header-contents)))
-                 (goto-char hend))
-                ;; ignore non-header field name lines
-                (t (forward-line 1))))))
+               (if (looking-at "^[^ \t\n:]+[ \t]*:")
+                   (progn
+                     (put-text-property (match-beginning 0) (match-end 0)
+                                        'face 'wl-highlight-message-headers)
+                     (setq p (match-end 0))
+                     (setq hend (save-excursion (std11-field-end end)))
+                     (or (catch 'match
+                           (let ((regexp-alist wl-highlight-message-header-alist))
+                             (while regexp-alist
+                               (when (save-match-data
+                                       (looking-at (caar regexp-alist)))
+                                 (put-text-property p hend 'face
+                                                    (cdar regexp-alist))
+                                 (throw 'match t))
+                               (setq regexp-alist (cdr regexp-alist)))
+                             (throw 'match nil)))
+                         (put-text-property
+                          p hend 'face 'wl-highlight-message-header-contents))
+                     (goto-char hend))
+                 ;; ignore non-header field name lines
+                 (forward-line 1)))))
          (let (prefix prefix-face-alist pair end)
            (while (not (eobp))
              (cond
index 31e2886..8d6f82d 100644 (file)
@@ -611,15 +611,18 @@ If optional USE-CACHE is non-nil, use cache if exists."
 If ARG is non-nil, Supersedes message"
   (interactive "P")
   (wl-summary-toggle-disp-msg 'off)
-  (if arg
-      (wl-summary-supersedes-message)
-    (if (string= (wl-summary-buffer-folder-name) wl-draft-folder)
-       (when (wl-summary-message-number)
-         (wl-draft-reedit (wl-summary-message-number))
-         (if (wl-message-news-p)
-             (mail-position-on-field "Newsgroups")
-           (mail-position-on-field "To")))
-      (wl-draft-edit-string (wl-summary-message-string)))))
+  (cond
+   ((not (wl-summary-message-number))
+    (message "No message."))
+   (arg
+    (wl-summary-supersedes-message))
+   ((string= (wl-summary-buffer-folder-name) wl-draft-folder)
+    (wl-draft-reedit (wl-summary-message-number))
+    (if (wl-message-news-p)
+       (mail-position-on-field "Newsgroups")
+      (mail-position-on-field "To")))
+   (t
+    (wl-draft-edit-string (wl-summary-message-string)))))
 
 (defun wl-summary-resend-bounced-mail ()
   "Re-mail the current message.
@@ -826,7 +829,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'."
   (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 
+    (if wl-on-xemacs
        (progn
          (make-local-variable 'pre-idle-hook)
          (add-hook 'pre-idle-hook 'wl-highlight-summary-window))
@@ -1694,7 +1697,7 @@ If ARG is non-nil, checking is omitted."
                (elmo-msgdb-set-mark
                 msgdb msg wl-summary-read-uncached-mark))
              (if wl-summary-highlight
-                 (wl-highlight-summary-current-line nil nil t)))
+                 (wl-highlight-summary-current-line)))
            (forward-line 1)))
        (elmo-folder-replace-marks
         folder
@@ -1746,7 +1749,7 @@ If ARG is non-nil, checking is omitted."
        (elmo-msgdb-set-mark msgdb number new-mark)
        (wl-summary-set-mark-modified)
        (if wl-summary-highlight
-           (wl-highlight-summary-current-line nil nil t))
+           (wl-highlight-summary-current-line))
        (set-buffer-modified-p nil)))))
 
 (defun wl-summary-resume-cache-status ()
@@ -1840,7 +1843,6 @@ If ARG is non-nil, checking is omitted."
 
 (defun wl-summary-replace-status-marks (before after)
   "Replace the status marks on buffer."
-  (interactive)
   (save-excursion
     (goto-char (point-min))
     (let ((inhibit-read-only t)
@@ -2106,6 +2108,7 @@ If ARG is non-nil, checking is omitted."
              (goto-char (point-max))
              (forward-line -1))
          (if (and wl-summary-highlight
+                  (not wl-summary-lazy-highlight)
                   (not (get-text-property (point) 'face)))
              (save-excursion
                (forward-line (- 0
@@ -2133,7 +2136,7 @@ If ARG is non-nil, checking is omitted."
        (delete-backward-char 1)
        (insert mark)
        (if wl-summary-highlight
-           (wl-highlight-summary-current-line nil nil t))
+           (wl-highlight-summary-current-line))
        (set-buffer-modified-p nil)))))
 
 (defun wl-summary-get-score-mark (msg-num)
@@ -2535,7 +2538,6 @@ If ARG, without confirm."
                (forward-line -1)
              (wl-summary-prev))
            (setq retval 'more-next))
-         ;(setq wl-summary-highlight hilit)
          (if (and wl-summary-highlight
                   (not wl-summary-lazy-highlight)
                   (not reuse-buf))
@@ -2875,7 +2877,7 @@ If ARG, without confirm."
            (setq wl-summary-buffer-unread-count
                  (+ 1 wl-summary-buffer-unread-count))
            (if (and visible wl-summary-highlight)
-               (wl-highlight-summary-current-line nil nil t))))
+               (wl-highlight-summary-current-line))))
        (wl-summary-update-modeline)
        (wl-folder-update-unread
         (wl-summary-buffer-folder-name)
@@ -3403,27 +3405,24 @@ If optional argument NUMBER is specified, unmark message specified by NUMBER."
          (buffer-read-only nil)
          visible
          msg-num
-         cur-mark
-         score-mark)
+         cur-mark)
       (if number
          (setq visible (wl-summary-jump-to-msg number))
        (setq visible t))
       ;; Delete mark on buffer.
       (when visible
        (setq cur-mark (wl-summary-temp-mark))
-       (if (string= cur-mark " ")
-           ()
+       (unless (string= cur-mark " ")
          (delete-backward-char 1)
          (or number
              (setq number (wl-summary-message-number)))
-         (if (setq score-mark (wl-summary-get-score-mark number))
-             (insert score-mark)
-           (insert " ")))
+         (insert (or (wl-summary-get-score-mark number)
+                     " ")))
        (if (or (string= cur-mark "o")
                (string= cur-mark "O"))
            (wl-summary-remove-destination))
        (if wl-summary-highlight
-           (wl-highlight-summary-current-line nil nil score-mark))
+           (wl-highlight-summary-current-line))
        (set-buffer-modified-p nil))
       ;; Remove from temporal mark structure.
       (and number
@@ -3726,7 +3725,7 @@ If ARG, exit virtual folder."
   (buffer-substring (- (point) 1) (point)))
 
 (defun wl-summary-mark-line (mark)
-  "Put MARK on current line.  Return message number."
+  "Put MARK on current line."
   (save-excursion
     (beginning-of-line)
     (let ((inhibit-read-only t)
@@ -3735,7 +3734,7 @@ If ARG, exit virtual folder."
       (delete-backward-char 1)
       (insert mark)
       (if wl-summary-highlight
-         (wl-highlight-summary-current-line nil nil t))
+         (wl-highlight-summary-current-line))
       (set-buffer-modified-p nil))))
 
 (defun wl-summary-target-mark-delete ()
@@ -4023,7 +4022,7 @@ If ARG, exit virtual folder."
              (elmo-msgdb-set-mark msgdb number new-mark))
            (wl-summary-set-mark-modified))
          (if (and visible wl-summary-highlight)
-             (wl-highlight-summary-current-line nil nil t))
+             (wl-highlight-summary-current-line))
          (if stat
              (save-current-buffer ; assumed by remaining
                (run-hooks 'wl-summary-unread-message-hook))))
@@ -4110,7 +4109,7 @@ If ARG, exit virtual folder."
                                            wl-summary-important-mark)))
            (wl-summary-set-mark-modified)))
       (if (and visible wl-summary-highlight)
-         (wl-highlight-summary-current-line nil nil t))))
+         (wl-highlight-summary-current-line))))
   (set-buffer-modified-p nil)
   number)