From: teranisi Date: Wed, 24 Sep 2003 03:56:01 +0000 (+0000) Subject: * elmo.el (toplevel): Changed definition orders. X-Git-Tag: wl-2_11_18~10 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=e37fd1de8fbe2f652749001e3646c55e4f35cfd3;p=elisp%2Fwanderlust.git * elmo.el (toplevel): Changed definition orders. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 6f5287f..7565358 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,7 @@ +2003-09-24 Yuuichi Teranishi + + * elmo.el (toplevel): Changed definition orders. + 2003-09-23 Hiroya Murata * modb.el (elmo-msgdb-search): New API . diff --git a/elmo/elmo.el b/elmo/elmo.el index d5b2ebe..5b38ed1 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -79,6 +79,16 @@ Otherwise, entire fetching of the message is aborted without confirmation." (elmo-define-error 'elmo-authenticate-error "Login failed" 'elmo-open-error) (elmo-define-error 'elmo-imap4-bye-error "IMAP4 session was terminated" 'elmo-open-error) +;; autoloads +(eval-and-compile + (autoload 'elmo-dop-queue-flush "elmo-dop") + (autoload 'elmo-nntp-post "elmo-nntp") + (autoload 'elmo-global-flag-initialize "elmo-flag") + (autoload 'elmo-global-flag-p "elmo-flag") + (autoload 'elmo-global-flag-detach "elmo-flag") + (autoload 'elmo-global-flag-detach-messages "elmo-flag") + (autoload 'elmo-global-flag-set "elmo-flag")) + (defun elmo-define-folder (prefix backend) "Define a folder. If a folder name begins with PREFIX, use BACKEND." @@ -445,6 +455,34 @@ Return newly created temporary directory name which contains temporary files.") (luna-define-generic elmo-message-file-p (folder number) "Return t if message in the FOLDER with NUMBER is a file.") +(defmacro elmo-message-entity-number (entity) + `(elmo-msgdb-message-entity-number (elmo-message-entity-handler ,entity) + ,entity)) + +(defmacro elmo-message-entity-set-number (entity number) + `(elmo-msgdb-message-entity-set-number (elmo-message-entity-handler ,entity) + ,entity + ,number)) + +(luna-define-generic elmo-message-flags (folder number) + "Return a list of flags. +FOLDER is a ELMO folder structure. +NUMBER is a number of the message.") + +(luna-define-method elmo-message-flags ((folder elmo-folder) number) + (elmo-msgdb-flags (elmo-folder-msgdb folder) number)) + +(defsubst elmo-message-flagged-p (folder number flag) + "Return non-nil if the message is set FLAG. +FOLDER is a ELMO folder structure. +NUMBER is a message number to test." + (let ((cur-flags (elmo-message-flags folder number))) + (case flag + (read + (not (memq 'unread cur-flags))) + (t + (memq flag cur-flags))))) + (luna-define-generic elmo-find-fetch-strategy (folder entity &optional ignore-cache) ;; Returns the message fetching strategy suitable for the message. @@ -1099,15 +1137,6 @@ ENTITY is the message-entity to get the parent.") `(dolist (,(car spec) (elmo-folder-list-message-entities ,(car (cdr spec)))) ,@form)) -(defmacro elmo-message-entity-number (entity) - `(elmo-msgdb-message-entity-number (elmo-message-entity-handler ,entity) - ,entity)) - -(defmacro elmo-message-entity-set-number (entity number) - `(elmo-msgdb-message-entity-set-number (elmo-message-entity-handler ,entity) - ,entity - ,number)) - (defun elmo-message-entity-field (entity field &optional decode) "Get message entity field value. ENTITY is the message entity structure obtained by `elmo-message-entity'. @@ -1146,25 +1175,6 @@ Return a list of numbers (`new' `unread' `answered')") (incf answered)))) (list new unreads answered))) -(luna-define-generic elmo-message-flags (folder number) - "Return a list of flags. -FOLDER is a ELMO folder structure. -NUMBER is a number of the message.") - -(luna-define-method elmo-message-flags ((folder elmo-folder) number) - (elmo-msgdb-flags (elmo-folder-msgdb folder) number)) - -(defsubst elmo-message-flagged-p (folder number flag) - "Return non-nil if the message is set FLAG. -FOLDER is a ELMO folder structure. -NUMBER is a message number to test." - (let ((cur-flags (elmo-message-flags folder number))) - (case flag - (read - (not (memq 'unread cur-flags))) - (t - (memq flag cur-flags))))) - (defun elmo-message-set-flag (folder number flag &optional is-local) "Set message flag. FOLDER is a ELMO folder structure. @@ -1691,16 +1701,6 @@ Return a hashtable for newsgroups." (make-obsolete 'elmo-folder-make-temp-dir 'elmo-folder-make-temporary-directory) - -;; autoloads -(autoload 'elmo-dop-queue-flush "elmo-dop") -(autoload 'elmo-nntp-post "elmo-nntp") -(autoload 'elmo-global-flag-initialize "elmo-flag") -(autoload 'elmo-global-flag-p "elmo-flag") -(autoload 'elmo-global-flag-detach "elmo-flag") -(autoload 'elmo-global-flag-detach-messages "elmo-flag") -(autoload 'elmo-global-flag-set "elmo-flag") - (require 'product) (product-provide (provide 'elmo) (require 'elmo-version))