+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.
(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))
(< (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")))))
(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))
(real-end end)
current beg
e p hend)
- (if too-big
- nil
+ (unless too-big
(save-excursion
(save-restriction
(widen)
(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
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.
(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))
(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
(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 ()
(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)
(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
(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)
(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))
(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)
(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
(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)
(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 ()
(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))))
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)