From: teranisi Date: Thu, 7 Jun 2001 00:34:56 +0000 (+0000) Subject: * elmo-shimbun.el (elmo-shimbun-default-index-range): New user option. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=e58793e99d923ffb740b5a5a57bd6dfdbdc95f6f;p=elisp%2Fwanderlust.git * elmo-shimbun.el (elmo-shimbun-default-index-range): New user option. (elmo-shimbun-index-range-alist): Ditto. (elmo-shimbun-use-entire-index): Abolish. (shimbun-mua-use-entire-index): Ditto. (elmo-shimbun-folder): Added new slot `range'. (elmo-folder-initialize): Setup slot `range'. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 7b80b5c..20e3893 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,12 @@ +2001-06-07 Yuuichi Teranishi + + * elmo-shimbun.el (elmo-shimbun-default-index-range): New user option. + (elmo-shimbun-index-range-alist): Ditto. + (elmo-shimbun-use-entire-index): Abolish. + (shimbun-mua-use-entire-index): Ditto. + (elmo-shimbun-folder): Added new slot `range'. + (elmo-folder-initialize): Setup slot `range'. + 2001-06-06 Yuuichi Teranishi * elmo-shimbun.el (elmo-shimbun-parse-time-string): New function. diff --git a/elmo/elmo-shimbun.el b/elmo/elmo-shimbun.el index 5061dd7..1c1ec09 100644 --- a/elmo/elmo-shimbun.el +++ b/elmo/elmo-shimbun.el @@ -37,9 +37,22 @@ :type 'integer :group 'elmo) -(defcustom elmo-shimbun-use-entire-index nil - "*Nil means that shimbun check only the last index of articles." - :type 'boolean +(defcustom elmo-shimbun-default-index-range 2 + "*Default value for the range of header indices." + :type '(choice (const :tag "all" all) + (const :tag "last" last) + (integer :tag "number")) + :group 'elmo) + +(defcustom elmo-shimbun-index-range-alist nil + "*Alist of FOLDER and RANGE. +FOLDER is the shimbun folder name. +RANGE is the range of the header indices . +See `shimbun-headers' for more detail about RANGE." + :type '(repeat (cons (string :tag "Folder Name") + (choice (const :tag "all" all) + (const :tag "last" last) + (integer :tag "number")))) :group 'elmo) ;; Shimbun mua. @@ -52,13 +65,10 @@ (elmo-folder-msgdb (shimbun-elmo-mua-folder-internal mua)))) -(luna-define-method shimbun-mua-use-entire-index ((mua shimbun-elmo-mua)) - elmo-shimbun-use-entire-index) - (eval-and-compile (luna-define-class elmo-shimbun-folder (elmo-map-folder) (shimbun headers header-hash - group last-check)) + group range last-check)) (luna-define-internal-accessors 'elmo-shimbun-folder)) (defsubst elmo-shimbun-lapse-seconds (time) @@ -127,7 +137,8 @@ (elmo-folder-msgdb folder)) x)) (shimbun-headers - (elmo-shimbun-folder-shimbun-internal folder))))) + (elmo-shimbun-folder-shimbun-internal folder) + (elmo-shimbun-folder-range-internal folder))))) (elmo-shimbun-folder-set-headers-internal folder (nconc (elmo-shimbun-msgdb-to-headers @@ -153,15 +164,20 @@ (list (elmo-match-string 1 name) (substring name (match-end 0))) (list name)))) - (if (nth 0 server-group) ; server - (elmo-shimbun-folder-set-shimbun-internal - folder - (shimbun-open (nth 0 server-group) - (luna-make-entity 'shimbun-elmo-mua :folder folder)))) - (if (nth 1 server-group) - (elmo-shimbun-folder-set-group-internal - folder - (nth 1 server-group))) + (when (nth 0 server-group) ; server + (elmo-shimbun-folder-set-shimbun-internal + folder + (shimbun-open (nth 0 server-group) + (luna-make-entity 'shimbun-elmo-mua :folder folder)))) + (when (nth 1 server-group) + (elmo-shimbun-folder-set-group-internal + folder + (nth 1 server-group))) + (elmo-shimbun-folder-set-range-internal + folder + (or (cdr (assoc (elmo-folder-name-internal folder) + elmo-shimbun-index-range-alist)) + elmo-shimbun-default-index-range)) folder)) (luna-define-method elmo-folder-open-internal :before ((folder