From: teranisi Date: Tue, 17 Sep 2002 12:22:16 +0000 (+0000) Subject: * elmo.el (elmo-folder-mark-as-read): Added argument `ignore-flag'. X-Git-Tag: elmo-mark-restart~137 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ebce8693f237d040079d50e074388e5e06039c9;p=elisp%2Fwanderlust.git * elmo.el (elmo-folder-mark-as-read): Added argument `ignore-flag'. (elmo-folder-mark-as-read): Follow the API change. * elmo-pipe.el (elmo-folder-mark-as-read): Follow the API change. * elmo-nntp.el (elmo-folder-mark-as-read): Set :before qualifier. * elmo-net.el (elmo-folder-unmark-important): Set :before qualifier. (elmo-folder-mark-as-important): Ditto. (elmo-folder-unmark-read): Ditto. (elmo-folder-mark-as-read): Ditto. (elmo-folder-unmark-answered): Ditto. (elmo-folder-mark-as-answered): Ditto. * elmo-multi.el (elmo-folder-mark-as-important): Set :before qualifier. (elmo-folder-unmark-important): Ditto. (elmo-folder-mark-as-read): Ditto. (elmo-folder-unmark-read): Ditto. (elmo-folder-mark-as-answered): Ditto. (elmo-folder-unmark-answered): Ditto. * elmo-mark.el (toplevel): Removed some mark method definitions. * elmo-map.el (elmo-map-folder-unmark-answered): New method. (elmo-map-folder-mark-as-answered): Ditto. (elmo-folder-unmark-important): Add :before qualifier. (elmo-folder-mark-as-important): Ditto. (elmo-folder-unmark-read): Ditto. (elmo-folder-mark-as-read): Ditto. (elmo-folder-unmark-answered): Define. (elmo-folder-mark-as-answered): Ditto. * elmo-maildir.el (elmo-map-folder-mark-as-answered): Define. (elmo-map-folder-unmark-answered): Ditto. * elmo-filter.el (elmo-folder-mark-as-read): Follow the API change. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 7322efe..79c7ebe 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,42 @@ 2002-09-17 Yuuichi Teranishi + * elmo.el (elmo-folder-mark-as-read): Added argument `ignore-flag'. + (elmo-folder-mark-as-read): Follow the API change. + + * elmo-pipe.el (elmo-folder-mark-as-read): Follow the API change. + + * elmo-nntp.el (elmo-folder-mark-as-read): Set :before qualifier. + + * elmo-net.el (elmo-folder-unmark-important): Set :before qualifier. + (elmo-folder-mark-as-important): Ditto. + (elmo-folder-unmark-read): Ditto. + (elmo-folder-mark-as-read): Ditto. + (elmo-folder-unmark-answered): Ditto. + (elmo-folder-mark-as-answered): Ditto. + + * elmo-multi.el (elmo-folder-mark-as-important): Set :before qualifier. + (elmo-folder-unmark-important): Ditto. + (elmo-folder-mark-as-read): Ditto. + (elmo-folder-unmark-read): Ditto. + (elmo-folder-mark-as-answered): Ditto. + (elmo-folder-unmark-answered): Ditto. + + * elmo-mark.el (toplevel): Removed some mark method definitions. + + * elmo-map.el (elmo-map-folder-unmark-answered): New method. + (elmo-map-folder-mark-as-answered): Ditto. + (elmo-folder-unmark-important): Add :before qualifier. + (elmo-folder-mark-as-important): Ditto. + (elmo-folder-unmark-read): Ditto. + (elmo-folder-mark-as-read): Ditto. + (elmo-folder-unmark-answered): Define. + (elmo-folder-mark-as-answered): Ditto. + + * elmo-maildir.el (elmo-map-folder-mark-as-answered): Define. + (elmo-map-folder-unmark-answered): Ditto. + + * elmo-filter.el (elmo-folder-mark-as-read): Follow the API change. + * elmo-net.el (elmo-folder-unmark-important): Added :around qualifier. (elmo-folder-mark-as-important): Ditto. (elmo-folder-unmark-read): Ditto. diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index 94e2d57..3ce13bb 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -264,9 +264,10 @@ (luna-define-method elmo-folder-mark-as-read :around ((folder elmo-filter-folder) - numbers) + numbers + &optional ignore-flag) (elmo-folder-mark-as-read (elmo-filter-folder-target-internal folder) - numbers) + numbers ignore-flag) (luna-call-next-method)) (luna-define-method elmo-folder-unmark-read :around ((folder diff --git a/elmo/elmo-maildir.el b/elmo/elmo-maildir.el index eb07a04..f3e7ae7 100644 --- a/elmo/elmo-maildir.el +++ b/elmo/elmo-maildir.el @@ -274,6 +274,16 @@ LOCATION." locs) (elmo-maildir-delete-mark-msgs folder locs ?S)) +(luna-define-method elmo-map-folder-mark-as-answered ((folder + elmo-maildir-folder) + locs) + (elmo-maildir-set-mark-msgs folder locs ?R)) + +(luna-define-method elmo-map-folder-unmark-answered ((folder + elmo-maildir-folder) + locs) + (elmo-maildir-delete-mark-msgs folder locs ?R)) + (luna-define-method elmo-folder-list-subfolders ((folder elmo-maildir-folder) &optional one-level) (let ((prefix (concat (elmo-folder-name-internal folder) diff --git a/elmo/elmo-map.el b/elmo/elmo-map.el index d848bf8..fee7c2c 100644 --- a/elmo/elmo-map.el +++ b/elmo/elmo-map.el @@ -74,6 +74,12 @@ (luna-define-generic elmo-map-folder-mark-as-read (folder locations) "") +(luna-define-generic elmo-map-folder-unmark-answered (folder locations) + "") + +(luna-define-generic elmo-map-folder-mark-as-answered (folder locations) + "") + (luna-define-generic elmo-map-message-fetch (folder location strategy &optional @@ -269,26 +275,46 @@ ((folder elmo-map-folder) &optional nohide) (mapcar 'car (elmo-map-folder-location-alist-internal folder))) -(luna-define-method elmo-folder-unmark-important ((folder elmo-map-folder) - numbers) +(luna-define-method elmo-folder-unmark-important :before ((folder + elmo-map-folder) + numbers) (elmo-map-folder-unmark-important folder (elmo-map-folder-numbers-to-locations folder numbers))) -(luna-define-method elmo-folder-mark-as-important ((folder elmo-map-folder) - numbers) +(luna-define-method elmo-folder-mark-as-important :before ((folder + elmo-map-folder) + numbers) (elmo-map-folder-mark-as-important folder (elmo-map-folder-numbers-to-locations folder numbers))) -(luna-define-method elmo-folder-unmark-read ((folder elmo-map-folder) - numbers) +(luna-define-method elmo-folder-unmark-read :before ((folder elmo-map-folder) + numbers) (elmo-map-folder-unmark-read folder (elmo-map-folder-numbers-to-locations folder numbers))) -(luna-define-method elmo-folder-mark-as-read ((folder elmo-map-folder) numbers) - (elmo-map-folder-mark-as-read +(luna-define-method elmo-folder-mark-as-read :before ((folder + elmo-map-folder) + numbers + &optional ignore-flags) + (unless ignore-flags + (elmo-map-folder-mark-as-read + folder + (elmo-map-folder-numbers-to-locations folder numbers)))) + +(luna-define-method elmo-folder-unmark-answered :before ((folder + elmo-map-folder) + numbers) + (elmo-map-folder-unmark-answered + folder + (elmo-map-folder-numbers-to-locations folder numbers))) + +(luna-define-method elmo-folder-mark-as-answered :before ((folder + elmo-map-folder) + numbers) + (elmo-map-folder-mark-as-answered folder (elmo-map-folder-numbers-to-locations folder numbers))) diff --git a/elmo/elmo-mark.el b/elmo/elmo-mark.el index cc2cc44..c3116df 100644 --- a/elmo/elmo-mark.el +++ b/elmo/elmo-mark.el @@ -159,21 +159,6 @@ (luna-define-method elmo-folder-writable-p ((folder elmo-mark-folder)) t) -;;; To override elmo-map-folder methods. -(luna-define-method elmo-folder-unmark-important ((folder elmo-mark-folder) - numbers) - t) - -(luna-define-method elmo-folder-mark-as-important ((folder elmo-mark-folder) - numbers) - t) - -(luna-define-method elmo-folder-unmark-read ((folder elmo-mark-folder) numbers) - t) - -(luna-define-method elmo-folder-mark-as-read ((folder elmo-mark-folder) numbers) - t) - (require 'product) (product-provide (provide 'elmo-mark) (require 'elmo-version)) diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 26149cd..3f3cb47 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -584,53 +584,49 @@ (setq msg-list (cdr msg-list))) ret-val)) -(luna-define-method elmo-folder-mark-as-important :around ((folder +(luna-define-method elmo-folder-mark-as-important :before ((folder elmo-multi-folder) numbers) (dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers)) (elmo-folder-mark-as-important (car folder-numbers) - (cdr folder-numbers))) - (luna-call-next-method)) + (cdr folder-numbers)))) -(luna-define-method elmo-folder-unmark-important :around ((folder +(luna-define-method elmo-folder-unmark-important :before ((folder elmo-multi-folder) numbers) (dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers)) (elmo-folder-unmark-important (car folder-numbers) - (cdr folder-numbers))) - (luna-call-next-method)) + (cdr folder-numbers)))) -(luna-define-method elmo-folder-mark-as-read :around ((folder +(luna-define-method elmo-folder-mark-as-read :before ((folder elmo-multi-folder) - numbers) + numbers + &optional ignore-flag) (dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers)) (elmo-folder-mark-as-read (car folder-numbers) - (cdr folder-numbers))) - (luna-call-next-method)) + (cdr folder-numbers) + ignore-flag))) -(luna-define-method elmo-folder-unmark-read :around ((folder +(luna-define-method elmo-folder-unmark-read :before ((folder elmo-multi-folder) numbers) (dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers)) (elmo-folder-unmark-read (car folder-numbers) - (cdr folder-numbers))) - (luna-call-next-method)) + (cdr folder-numbers)))) -(luna-define-method elmo-folder-mark-as-answered :around ((folder +(luna-define-method elmo-folder-mark-as-answered :before ((folder elmo-multi-folder) numbers) (dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers)) (elmo-folder-mark-as-answered (car folder-numbers) - (cdr folder-numbers))) - (luna-call-next-method)) + (cdr folder-numbers)))) -(luna-define-method elmo-folder-unmark-answered :around ((folder +(luna-define-method elmo-folder-unmark-answered :before ((folder elmo-multi-folder) numbers) (dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers)) (elmo-folder-unmark-answered (car folder-numbers) - (cdr folder-numbers))) - (luna-call-next-method)) + (cdr folder-numbers)))) (require 'product) (product-provide (provide 'elmo-multi) (require 'elmo-version)) diff --git a/elmo/elmo-net.el b/elmo/elmo-net.el index 966b3c6..e7a9a4b 100644 --- a/elmo/elmo-net.el +++ b/elmo/elmo-net.el @@ -455,66 +455,62 @@ Returned value is searched from `elmo-network-stream-type-alist'." (mapcar 'abs numbers) seen-list))) -(luna-define-method elmo-folder-unmark-important :around ((folder +(luna-define-method elmo-folder-unmark-important :before ((folder elmo-net-folder) numbers) - (if (elmo-folder-use-flag-p folder) - (if (elmo-folder-plugged-p folder) - (elmo-folder-send folder 'elmo-folder-unmark-important-plugged - numbers) - (elmo-folder-send folder - 'elmo-folder-unmark-important-unplugged numbers)) - (luna-call-next-method))) - -(luna-define-method elmo-folder-mark-as-important :around ((folder + (when (elmo-folder-use-flag-p folder) + (if (elmo-folder-plugged-p folder) + (elmo-folder-send folder 'elmo-folder-unmark-important-plugged + numbers) + (elmo-folder-send folder + 'elmo-folder-unmark-important-unplugged numbers)))) + +(luna-define-method elmo-folder-mark-as-important :before ((folder elmo-net-folder) numbers) - (if (elmo-folder-use-flag-p folder) - (if (elmo-folder-plugged-p folder) - (elmo-folder-send folder 'elmo-folder-mark-as-important-plugged - numbers) - (elmo-folder-send folder 'elmo-folder-mark-as-important-unplugged - numbers)) - (luna-call-next-method))) - -(luna-define-method elmo-folder-unmark-read :around ((folder elmo-net-folder) + (when (elmo-folder-use-flag-p folder) + (if (elmo-folder-plugged-p folder) + (elmo-folder-send folder 'elmo-folder-mark-as-important-plugged + numbers) + (elmo-folder-send folder 'elmo-folder-mark-as-important-unplugged + numbers)))) + +(luna-define-method elmo-folder-unmark-read :before ((folder elmo-net-folder) numbers) - (if (elmo-folder-use-flag-p folder) - (if (elmo-folder-plugged-p folder) - (elmo-folder-send folder 'elmo-folder-unmark-read-plugged numbers) - (elmo-folder-send folder 'elmo-folder-unmark-read-unplugged numbers)) - (luna-call-next-method))) - -(luna-define-method elmo-folder-mark-as-read :around ((folder elmo-net-folder) - numbers) - (if (elmo-folder-use-flag-p folder) - (if (elmo-folder-plugged-p folder) - (elmo-folder-send folder 'elmo-folder-mark-as-read-plugged numbers) - (elmo-folder-send - folder 'elmo-folder-mark-as-read-unplugged numbers)) - (luna-call-next-method))) - -(luna-define-method elmo-folder-unmark-answered :around ((folder + (when (elmo-folder-use-flag-p folder) + (if (elmo-folder-plugged-p folder) + (elmo-folder-send folder 'elmo-folder-unmark-read-plugged numbers) + (elmo-folder-send folder 'elmo-folder-unmark-read-unplugged numbers)))) + +(luna-define-method elmo-folder-mark-as-read :before ((folder elmo-net-folder) + numbers + &optional ignore-flag) + (when (and (elmo-folder-use-flag-p folder) + (not ignore-flag)) + (if (elmo-folder-plugged-p folder) + (elmo-folder-send folder 'elmo-folder-mark-as-read-plugged numbers) + (elmo-folder-send + folder 'elmo-folder-mark-as-read-unplugged numbers)))) + +(luna-define-method elmo-folder-unmark-answered :before ((folder elmo-net-folder) numbers) - (if (elmo-folder-use-flag-p folder) - (if (elmo-folder-plugged-p folder) - (elmo-folder-send folder 'elmo-folder-unmark-answered-plugged - numbers) - (elmo-folder-send folder - 'elmo-folder-unmark-answered-unplugged numbers)) - (luna-call-next-method))) - -(luna-define-method elmo-folder-mark-as-answered :around ((folder + (when (elmo-folder-use-flag-p folder) + (if (elmo-folder-plugged-p folder) + (elmo-folder-send folder 'elmo-folder-unmark-answered-plugged + numbers) + (elmo-folder-send folder + 'elmo-folder-unmark-answered-unplugged numbers)))) + +(luna-define-method elmo-folder-mark-as-answered :before ((folder elmo-net-folder) numbers) - (if (elmo-folder-use-flag-p folder) - (if (elmo-folder-plugged-p folder) - (elmo-folder-send folder 'elmo-folder-mark-as-answered-plugged - numbers) - (elmo-folder-send folder 'elmo-folder-mark-as-answered-unplugged - numbers)) - (luna-call-next-method))) + (when (elmo-folder-use-flag-p folder) + (if (elmo-folder-plugged-p folder) + (elmo-folder-send folder 'elmo-folder-mark-as-answered-plugged + numbers) + (elmo-folder-send folder 'elmo-folder-mark-as-answered-unplugged + numbers)))) (luna-define-method elmo-folder-mark-as-read-unplugged ((folder elmo-net-folder) diff --git a/elmo/elmo-nntp.el b/elmo/elmo-nntp.el index 5e02c1a..9990cae 100644 --- a/elmo/elmo-nntp.el +++ b/elmo/elmo-nntp.el @@ -1516,10 +1516,11 @@ Returns a list of cons cells like (NUMBER . VALUE)" folder (delq elem (elmo-nntp-folder-temp-crosses-internal folder))))))) -(luna-define-method elmo-folder-mark-as-read ((folder elmo-nntp-folder) - numbers) - (elmo-nntp-folder-update-crosspost-message-alist folder numbers) - t) +(luna-define-method elmo-folder-mark-as-read :before ((folder + elmo-nntp-folder) + numbers + &optional ignore-flags) + (elmo-nntp-folder-update-crosspost-message-alist folder numbers)) (luna-define-method elmo-folder-process-crosspost ((folder elmo-nntp-folder) &optional diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index 05f64c0..ea42578 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -50,7 +50,8 @@ (elmo-make-folder (elmo-match-string 3 name))) (elmo-pipe-folder-set-copy-internal folder - (string= ":" (elmo-match-string 2 name)))) + (string= ":" + (elmo-match-string 2 name)))) folder) (luna-define-method elmo-folder-get-primitive-list ((folder elmo-pipe-folder)) @@ -272,9 +273,9 @@ (elmo-pipe-folder-dst-internal folder) numbers start-number)) (luna-define-method elmo-folder-mark-as-read ((folder elmo-pipe-folder) - numbers) + numbers &optional ignore-flag) (elmo-folder-mark-as-read (elmo-pipe-folder-dst-internal folder) - numbers)) + numbers ignore-flag)) (luna-define-method elmo-folder-unmark-read ((folder elmo-pipe-folder) numbers) diff --git a/elmo/elmo.el b/elmo/elmo.el index cd7ca16..5d587da 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -349,7 +349,8 @@ NUMBERS is a list of message numbers to be processed.") FOLDER is the ELMO folder structure. NUMBERS is a list of message numbers to be processed.") -(luna-define-generic elmo-folder-mark-as-read (folder numbers) +(luna-define-generic elmo-folder-mark-as-read (folder numbers + &optional ignore-flags) "Mark messages as read. FOLDER is the ELMO folder structure. NUMBERS is a list of message numbers to be processed.") @@ -1169,7 +1170,9 @@ FIELD is a symbol of the field." number 'read)))) -(luna-define-method elmo-folder-mark-as-read ((folder elmo-folder) numbers) +(luna-define-method elmo-folder-mark-as-read ((folder elmo-folder) + numbers + &optional ignore-flag) (when (elmo-folder-msgdb-internal folder) (dolist (number numbers) (elmo-msgdb-set-status (elmo-folder-msgdb folder)