(wl-summary-target-mark-operation): Add optional
authorhmurata <hmurata>
Mon, 21 Jun 2004 23:15:39 +0000 (23:15 +0000)
committerhmurata <hmurata>
Mon, 21 Jun 2004 23:15:39 +0000 (23:15 +0000)
argument `inverse' and use `wl-summary-delete-all-target-marks'.
(wl-summary-target-mark-mark-as-important): Refine to toggle mark.
(wl-summary-target-mark-mark-as-answered): Likewise.

wl/ChangeLog
wl/wl-summary.el

index aa65cee..02657b4 100644 (file)
@@ -1,3 +1,10 @@
+2004-06-21  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * wl-summary.el (wl-summary-target-mark-operation): Add optional
+       argument `inverse' and use `wl-summary-delete-all-target-marks'.
+       (wl-summary-target-mark-mark-as-important): Refine to toggle mark.
+       (wl-summary-target-mark-mark-as-answered): Likewise.
+
 2004-06-22  Yoichi NAKAYAMA  <yoichi@geiin.org>
 
        * wl-summary.el (wl-summary-target-mark-forward): Use
index 298b655..24c22eb 100644 (file)
@@ -2960,26 +2960,34 @@ The mark is decided according to the FOLDER, FLAGS and CACHED."
       (dolist (number wl-summary-buffer-target-mark-list)
        (wl-summary-unset-mark number)))))
 
-(defun wl-summary-target-mark-operation (flag)
+(defun wl-summary-target-mark-operation (flag &optional inverse)
   (save-excursion
-    (goto-char (point-min))
     (let ((inhibit-read-only t)
          (buffer-read-only nil)
          wl-summary-buffer-disp-msg)
       (funcall
        (intern (format "wl-summary-mark-as-%s-internal" flag))
-       nil
+       inverse
        wl-summary-buffer-target-mark-list)
-      (dolist (number wl-summary-buffer-target-mark-list)
-       (wl-summary-unset-mark number)))))
+      (wl-summary-delete-all-target-marks))))
 
 (defun wl-summary-target-mark-mark-as-important ()
   (interactive)
-  (wl-summary-target-mark-operation 'important))
+  (wl-summary-target-mark-operation
+   'important
+   (and (interactive-p)
+       (elmo-message-flagged-p wl-summary-buffer-elmo-folder
+                               (car wl-summary-buffer-target-mark-list)
+                               'important))))
 
 (defun wl-summary-target-mark-mark-as-answered ()
   (interactive)
-  (wl-summary-target-mark-operation 'answered))
+  (wl-summary-target-mark-operation
+   'answered
+   (and (interactive-p)
+       (elmo-message-flagged-p wl-summary-buffer-elmo-folder
+                               (car wl-summary-buffer-target-mark-list)
+                               'answered))))
 
 (defun wl-summary-target-mark-set-flags ()
   (interactive)