(setq data (funcall (wl-summary-action-argument-function action)
(wl-summary-action-symbol action)
number)))
- (wl-summary-unset-mark number)
- (when visible
- (wl-summary-mark-line set-mark)
- (when wl-summary-highlight
- (wl-highlight-summary-current-line))
- (when data
- (wl-summary-print-argument number data)))
+ ;; Unset the mark of current line.
+ (wl-summary-unset-mark)
;; Set action.
(funcall (wl-summary-action-set-function action)
number
(wl-summary-action-mark action)
data)
+ (when visible
+ (wl-summary-put-temp-mark set-mark)
+ (when wl-summary-highlight
+ (wl-highlight-summary-current-line))
+ (when data
+ (wl-summary-print-argument number data)))
(set-buffer-modified-p nil)
;; Return value.
number))
(let (wl-summary-buffer-disp-msg)
(when (setq number (wl-summary-message-number))
(wl-summary-set-mark (wl-summary-action-mark action)
- number nil data)
+ nil nil data)
(setq wl-summary-buffer-target-mark-list
(delq number wl-summary-buffer-target-mark-list)))))
(forward-line 1))
visible mark action)
(if number
(setq visible (wl-summary-jump-to-msg number)) ; can be nil
- (setq visible t))
- (setq number (or number (wl-summary-message-number)))
+ (setq visible t
+ number (wl-summary-message-number)))
+ (setq mark (wl-summary-temp-mark))
+ ;; Remove from temporal mark structure.
+ (wl-summary-unregister-target-mark number)
+ (wl-summary-unregister-temp-mark number)
;; Delete mark on buffer.
(when visible
- (setq mark (wl-summary-temp-mark))
(unless (string= mark " ")
- (delete-backward-char 1)
- (insert (or (wl-summary-get-score-mark number)
- " "))
+ (wl-summary-put-temp-mark
+ (or (wl-summary-get-score-mark number)
+ " "))
(setq action (assoc mark wl-summary-mark-action-list))
(when wl-summary-highlight
(wl-highlight-summary-current-line))
(when (wl-summary-action-argument-function action)
(wl-summary-remove-argument)))
- (set-buffer-modified-p nil))
- ;; Remove from temporal mark structure.
- (wl-summary-unregister-target-mark number)
- (wl-summary-unregister-temp-mark number)))
+ (set-buffer-modified-p nil))))
;; Move the cursor.
;; (if (or interactive (interactive-p))
;; (if (eq wl-summary-move-direction-downward nil)
"Refile message to previously refiled destination."
(interactive)
(funcall (symbol-function 'wl-summary-refile)
- wl-summary-buffer-prev-refile-destination
- (wl-summary-message-number))
+ wl-summary-buffer-prev-refile-destination)
(if (eq wl-summary-move-direction-downward nil)
(wl-summary-prev)
(wl-summary-next)))
children)
(if (wl-thread-entity-get-opened entity)
;; opened...delete line.
- (funcall function number data)
+ (funcall function nil data)
;; closed
(setq children (wl-thread-get-children-msgs number))
(while children
(funcall function (pop children) data)))
(forward-line 1))))
(while (not (eobp))
- (funcall function (wl-summary-message-number) data)
+ (funcall function nil data)
(forward-line 1))))))
(defun wl-summary-target-mark-all ()
"Menu used in Summary mode."
wl-summary-mode-menu-spec))
+(defsubst wl-summary-message-visible-p (number)
+ "Return non-nil if the message with NUMBER is visible."
+ (or (eq wl-summary-buffer-view 'sequence)
+ (not (wl-thread-entity-parent-invisible-p
+ (wl-thread-get-entity number)))))
+
(defun wl-status-update ()
(interactive)
(wl-address-init))
dummy-persistent))
(goto-char (point-min))
(setq temp (save-excursion
- (search-forward dummy-temp nil t)
- (current-column))
+ (when (search-forward dummy-temp nil t)
+ (current-column)))
persistent (save-excursion
- (search-forward dummy-persistent nil t)
- (current-column))))
+ (when (search-forward dummy-persistent nil t)
+ (current-column)))))
(setq wl-summary-buffer-temp-mark-column temp
wl-summary-buffer-persistent-mark-column persistent)))
(defun wl-summary-set-score-mark (mark)
(save-excursion
(beginning-of-line)
- (let ((inhibit-read-only t)
- (buffer-read-only nil)
- msg-num
- cur-mark)
- (setq msg-num (wl-summary-message-number))
- (setq cur-mark (wl-summary-temp-mark))
+ (let ((cur-mark (wl-summary-temp-mark)))
(when (member cur-mark (list " "
wl-summary-score-below-mark
wl-summary-score-over-mark))
- (delete-backward-char 1)
- (insert mark)
+ (wl-summary-put-temp-mark mark)
(if wl-summary-highlight
(wl-highlight-summary-current-line))
(set-buffer-modified-p nil)))))
(defun wl-summary-target-mark-msgs (msgs)
"Return the number of marked messages."
- (let ((i 0) num)
- (while msgs
- (if (eq wl-summary-buffer-view 'thread)
- (wl-thread-jump-to-msg (car msgs))
- (wl-summary-jump-to-msg (car msgs)))
- (setq num (wl-summary-message-number))
- (when (eq num (car msgs))
- (wl-summary-target-mark num)
- (setq i (1+ i)))
- (setq msgs (cdr msgs)))
+ (let ((i 0))
+ (dolist (number msgs)
+ (when (wl-summary-target-mark number)
+ (setq i (1+ i))))
i))
(defun wl-summary-pick (&optional from-list delete-marks)
(setq wl-summary-buffer-temp-mark-list nil))))
(defsubst wl-summary-temp-mark ()
- "Move to the temp-mark column and return mark string."
- (move-to-column wl-summary-buffer-temp-mark-column)
- (buffer-substring (- (point) 1) (point)))
+ "Return temp-mark string of current line."
+ (let ((number (wl-summary-message-number))
+ info)
+ (or (and (wl-summary-have-target-mark-p number)
+ "*")
+ (and (setq info (wl-summary-registered-temp-mark number))
+ (nth 1 info))
+ (wl-summary-get-score-mark number)
+ " ")))
(defsubst wl-summary-persistent-mark ()
- "Move to the persistent-mark column and return mark string."
- (move-to-column wl-summary-buffer-persistent-mark-column)
- (buffer-substring (- (point) 1) (point)))
-
-(defun wl-summary-mark-line (mark)
- "Put MARK on current line."
- (save-excursion
- (beginning-of-line)
- (let ((inhibit-read-only t)
- (buffer-read-only nil))
- (wl-summary-temp-mark) ; mark
- (delete-backward-char 1)
- (insert mark))))
+ "Return persistent-mark string of current line."
+ (or (ignore-errors
+ (elmo-message-mark wl-summary-buffer-elmo-folder
+ (wl-summary-message-number)))
+ " "))
+
+(defun wl-summary-put-temp-mark (mark)
+ "Put temp MARK on current line."
+ (when wl-summary-buffer-temp-mark-column
+ (save-excursion
+ (beginning-of-line)
+ (let ((inhibit-read-only t)
+ (buffer-read-only nil))
+ (move-to-column wl-summary-buffer-temp-mark-column)
+ (delete-backward-char 1)
+ (insert mark)))))
(defun wl-summary-next-buffer ()
"Switch to next summary buffer."
(while (not (eobp))
(when (string= (wl-summary-temp-mark) "*")
;; delete target-mark from buffer.
- (delete-backward-char 1)
- (insert " ")
+ (wl-summary-put-temp-mark " ")
(setq number (wl-summary-message-number))
(setq mlist (append mlist (list number)))
(if wl-summary-highlight
number mlist)
(while (not (eobp))
(when (string= (wl-summary-temp-mark) "*")
- (delete-backward-char 1)
- (insert " ")
+ (wl-summary-put-temp-mark " ")
(setq number (wl-summary-message-number))
(setq mlist (append mlist (list number)))
(if wl-summary-highlight
(while (not (eobp))
(when (string= (wl-summary-temp-mark) "*")
;; delete target-mark from buffer.
- (delete-backward-char 1)
- (insert " ")
+ (wl-summary-put-temp-mark " ")
(setq number (wl-summary-mark-as-important))
(if wl-summary-highlight
(wl-highlight-summary-current-line))
(while (setq number (car wl-summary-buffer-target-mark-list))
(wl-thread-jump-to-msg number)
(wl-summary-save t wl-save-dir)
- (wl-summary-unmark number))))
+ (wl-summary-unmark))))
(defun wl-summary-target-mark-pick ()
(interactive)
(defun wl-summary-update-persistent-mark ()
"Synch up persistent mark of current line with msgdb's.
Return non-nil if the mark is updated"
- (ignore-errors
- (save-excursion
- (let ((inhibit-read-only t)
- (buffer-read-only nil)
- (new-mark
- (or (elmo-message-mark wl-summary-buffer-elmo-folder
- (wl-summary-message-number))
- " "))
- (mark (wl-summary-persistent-mark)))
- (unless (string= new-mark mark)
- (delete-backward-char 1)
- (insert new-mark)
- (if wl-summary-highlight (wl-highlight-summary-current-line))
- (set-buffer-modified-p nil)
- t)))))
+ (if wl-summary-buffer-persistent-mark-column
+ (save-excursion
+ (move-to-column wl-summary-buffer-persistent-mark-column)
+ (let ((inhibit-read-only t)
+ (buffer-read-only nil)
+ (mark (buffer-substring (- (point) 1) (point)))
+ (new-mark (wl-summary-persistent-mark)))
+ (unless (string= new-mark mark)
+ (delete-backward-char 1)
+ (insert new-mark)
+ (when wl-summary-highlight
+ (wl-highlight-summary-current-line))
+ (set-buffer-modified-p nil)
+ t)))
+ (when wl-summary-highlight
+ (wl-highlight-summary-current-line))
+ (set-buffer-modified-p nil)))
(defsubst wl-summary-mark-as-read-internal (inverse
number-or-numbers
(let ((num (car wl-summary-buffer-target-mark-list)))
(wl-thread-jump-to-msg num)
(wl-summary-pipe-message-subr prefix command)
- (wl-summary-unmark num))))))
+ (wl-summary-unmark))))))
(defun wl-summary-pipe-message-subr (prefix command)
(save-excursion
(let ((num (car wl-summary-buffer-target-mark-list)))
(wl-thread-jump-to-msg num)
(wl-summary-print-message)
- (wl-summary-unmark num))))))
+ (wl-summary-unmark))))))
(defun wl-summary-folder-info-update ()
(wl-folder-set-folder-updated