From: hmurata Date: Tue, 11 Jan 2005 15:24:44 +0000 (+0000) Subject: * wl-draft.el (wl-draft-insert-get-message): Follow the API change. X-Git-Tag: wl-2_14-root~93 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=e042021da755cb09eeed9b22e063cbf686272ab6;p=elisp%2Fwanderlust.git * wl-draft.el (wl-draft-insert-get-message): Follow the API change. (wl-draft-reedit): Ditto. (wl-draft-queue-flush): Ditto. * wl-mime.el (wl-message-request-partial): Ditto. (wl-message-delete-current-part): Use `elmo-message-fetch-string' instead of `elmo-message-fetch'. * wl-action.el (wl-summary-exec-action-resend-subr): Ditto. * wl-summary.el (wl-summary-message-string): Ditto. * elmo.el (elmo-message-fetch): Removed argument `outbuf' and exchange order of arguments `section' and `unread'. (elmo-message-encache): Follow the API change. (elmo-message-match-condition): Ditto. (elmo-generic-folder-append-messages): Ditto. (elmo-message-fetch-string): New function. * elmo-split.el (elmo-split-subr): Ditto. * elmo-spam.el (elmo-spam-message-fetch): Ditto. * elmo-pipe.el (elmo-message-fetch): Ditto. * elmo-multi.el (elmo-message-fetch): Ditto. * elmo-mime.el (elmo-message-mime-entity): Ditto. * elmo-flag.el (elmo-global-flag-set-internal): Ditto. * elmo-filter.el (elmo-message-fetch): Ditto. * elmo-dop.el (elmo-folder-append-buffer-dop-delayed): Ditto. * elmo-imap4.el (mime-imap-location-section-body): Use `elmo-message-fetch-string' instead of `elmo-message-fetch' and follow the API change. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 04329c0..f06c6b4 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,32 @@ +2005-01-11 Hiroya Murata + + * elmo.el (elmo-message-fetch): Removed argument `outbuf' and + exchange order of arguments `section' and `unread'. + (elmo-message-encache): Follow the API change. + (elmo-message-match-condition): Ditto. + (elmo-generic-folder-append-messages): Ditto. + (elmo-message-fetch-string): New function. + + * elmo-split.el (elmo-split-subr): Ditto. + + * elmo-spam.el (elmo-spam-message-fetch): Ditto. + + * elmo-pipe.el (elmo-message-fetch): Ditto. + + * elmo-multi.el (elmo-message-fetch): Ditto. + + * elmo-mime.el (elmo-message-mime-entity): Ditto. + + * elmo-flag.el (elmo-global-flag-set-internal): Ditto. + + * elmo-filter.el (elmo-message-fetch): Ditto. + + * elmo-dop.el (elmo-folder-append-buffer-dop-delayed): Ditto. + + * elmo-imap4.el (mime-imap-location-section-body): Use + `elmo-message-fetch-string' instead of `elmo-message-fetch' and + follow the API change. + 2005-01-10 Hiroya Murata * elmo-access.el: New file. diff --git a/elmo/elmo-dop.el b/elmo/elmo-dop.el index 4841182..4e0f501 100644 --- a/elmo/elmo-dop.el +++ b/elmo/elmo-dop.el @@ -327,7 +327,7 @@ FOLDER is the folder structure." (with-temp-buffer (when (elmo-message-fetch spool-folder number (elmo-make-fetch-strategy 'entire) - nil (current-buffer) 'unread) + 'unread) (setq flags (or (elmo-message-flags-for-append folder (* -1 number)) (cond ((listp flag) flag) diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index ff3767c..7eb00be 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -180,11 +180,11 @@ (luna-define-method elmo-message-fetch ((folder elmo-filter-folder) number strategy - &optional section outbuf unseen) + &optional unseen section) (unless unseen (elmo-filter-folder-countup-message-flags folder (list number) -1)) (when (elmo-message-fetch (elmo-filter-folder-target-internal folder) - number strategy section outbuf unseen) + number strategy unseen section) (unless unseen (elmo-filter-folder-countup-message-flags folder (list number)) (elmo-folder-notify-event folder 'flag-changed (list number))) diff --git a/elmo/elmo-flag.el b/elmo/elmo-flag.el index 4061dd2..836490c 100644 --- a/elmo/elmo-flag.el +++ b/elmo/elmo-flag.el @@ -330,9 +330,8 @@ NUMBER is the message number." (elmo-copy-file (elmo-file-cache-path cache) new-file) (when (and folder number) - (elmo-message-fetch folder number (elmo-make-fetch-strategy - 'entire) - nil (current-buffer)) + (elmo-message-fetch folder number + (elmo-make-fetch-strategy 'entire)) (write-region-as-binary (point-min) (point-max) new-file nil 'no-msg)))) (elmo-flag-folder-set-minfo-internal diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 762af05..07ea83c 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -448,16 +448,15 @@ If response is not `OK' response, causes error with IMAP response text." (mime-elmo-imap-location-folder-internal location) (mime-elmo-imap-location-number-internal location) (mime-elmo-imap-location-strategy-internal location) - section - (current-buffer) - 'unseen) + 'unseen + section) (buffer-string)) - (elmo-message-fetch + (elmo-message-fetch-string (mime-elmo-imap-location-folder-internal location) (mime-elmo-imap-location-number-internal location) (mime-elmo-imap-location-strategy-internal location) - section - nil 'unseen))) + 'unseen + section))) (luna-define-method mime-imap-location-bodystructure diff --git a/elmo/elmo-mime.el b/elmo/elmo-mime.el index 4fc8a93..232e3e9 100644 --- a/elmo/elmo-mime.el +++ b/elmo/elmo-mime.el @@ -289,9 +289,7 @@ If third optional argument ENTIRE is non-nil, fetch entire message at once." (with-current-buffer rawbuf (let (buffer-read-only) (erase-buffer) - (elmo-message-fetch folder number strategy - nil (current-buffer) - unread))) + (elmo-message-fetch folder number strategy unread))) (mime-open-entity 'elmo-buffer rawbuf))))) ;; Replacement of mime-display-message. diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 254a0a0..1a5d458 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -243,10 +243,10 @@ (luna-define-method elmo-message-fetch ((folder elmo-multi-folder) number strategy - &optional section outbuf unseen) + &optional unseen section) (let ((pair (elmo-multi-real-folder-number folder number))) (when (elmo-message-fetch (car pair) (cdr pair) - strategy section outbuf unseen) + strategy unseen section) (unless unseen (elmo-folder-notify-event folder 'flag-changed (list number))) t))) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index bf37ce4..c9dc006 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -78,9 +78,9 @@ (luna-define-method elmo-message-fetch ((folder elmo-pipe-folder) number strategy - &optional section outbuf unseen) + &optional unseen section) (when (elmo-message-fetch (elmo-pipe-folder-dst-internal folder) - number strategy section outbuf unseen) + number strategy unseen section) (unless unseen (elmo-folder-notify-event folder 'flag-changed (list number))) t)) diff --git a/elmo/elmo-spam.el b/elmo/elmo-spam.el index 883ded7..350f99e 100644 --- a/elmo/elmo-spam.el +++ b/elmo/elmo-spam.el @@ -125,7 +125,7 @@ If optional argument RESTORE is non-nil, unregister from spam list.") (elmo-message-fetch folder number (elmo-find-fetch-strategy folder number nil 'entire) - nil (current-buffer) 'unread))) + 'unread))) ;; generic implement (luna-define-method elmo-spam-message-spam-p ((processor elsp-generic) diff --git a/elmo/elmo-split.el b/elmo/elmo-split.el index 3eafd55..28bebd2 100644 --- a/elmo/elmo-split.el +++ b/elmo/elmo-split.el @@ -334,7 +334,7 @@ If prefix argument ARG is specified, do a reharsal (no harm)." (when (ignore-errors (elmo-message-fetch folder msg (elmo-make-fetch-strategy 'entire) - nil (current-buffer) 'unread)) + 'unread)) (run-hooks 'elmo-split-fetch-hook) (setq elmo-split-message-entity (mime-parse-buffer)) (setq flags (elmo-message-flags-for-append folder msg)) diff --git a/elmo/elmo.el b/elmo/elmo.el index 9dcf42e..9c018d1 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -605,15 +605,16 @@ If READ is non-nil, message is flaged as read.") (luna-define-method elmo-message-encache ((folder elmo-folder) number &optional read) (let (path) - (elmo-message-fetch - folder number - (elmo-make-fetch-strategy 'entire - nil ;use-cache - t ;save-cache - (setq path (elmo-file-cache-get-path - (elmo-message-field - folder number 'message-id)))) - nil nil (not read)) + (with-temp-buffer + (elmo-message-fetch + folder number + (elmo-make-fetch-strategy 'entire + nil ;use-cache + t ;save-cache + (setq path (elmo-file-cache-get-path + (elmo-message-field + folder number 'message-id)))) + (not read))) path)) (luna-define-generic elmo-message-fetch-bodystructure (folder number strategy) @@ -621,18 +622,15 @@ If READ is non-nil, message is flaged as read.") (luna-define-generic elmo-message-fetch (folder number strategy &optional - section - outbuf - unread) - "Fetch a message and return as a string. + unread + section) + "Fetch a message into current buffer. FOLDER is the ELMO folder structure. NUMBER is the number of the message in the FOLDER. STRATEGY is the message fetching strategy. -If optional argument SECTION is specified, only the SECTION of the message -is fetched (if possible). -If second optional argument OUTBUF is specified, fetched message is -inserted to the buffer and returns t if fetch was ended successfully. -If third optional argument UNREAD is non-nil, message is not flaged as read. +If optional argument UNREAD is non-nil, message is not flaged as read. +If second optional argument SECTION is specified, only the +SECTION of the message is fetched (if possible). Returns non-nil if fetching was succeed.") (luna-define-generic elmo-message-fetch-with-cache-process (folder @@ -839,7 +837,7 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-FLAG-ALIST).") (and cache t) nil cache-path) - nil (current-buffer) t) + 'unread) (set-buffer-multibyte default-enable-multibyte-characters) (decode-coding-region (point-min) (point-max) elmo-mime-display-as-is-coding-system) @@ -1076,7 +1074,6 @@ If optional argument IF-EXISTS is nil, load on demand. 'entire t nil (elmo-file-cache-path cache))) (error "Unplugged"))) - nil (current-buffer) 'unread) (> (buffer-size) 0) (elmo-folder-append-buffer @@ -1406,27 +1403,26 @@ If Optional LOCAL is non-nil, don't update server flag." number strategy) nil) +(defun elmo-message-fetch-string (folder number strategy + &optional + unread + section) + (with-temp-buffer + (when (elmo-message-fetch folder number strategy section unread) + (buffer-string)))) + (luna-define-method elmo-message-fetch ((folder elmo-folder) number strategy &optional - section - outbuf - unread) - (let (result) - (prog1 - (if outbuf - (with-current-buffer outbuf - (erase-buffer) - (setq result (elmo-message-fetch-with-cache-process - folder number strategy section unread))) - (with-temp-buffer - (setq result (elmo-message-fetch-with-cache-process - folder number strategy section unread)) - (buffer-string))) - (when (and result - (not unread) - (elmo-message-flagged-p folder number 'unread)) - (elmo-message-unset-flag folder number 'unread 'local))))) + unread + section) + (erase-buffer) + (when (elmo-message-fetch-with-cache-process folder number + strategy section unread) + (when (and (not unread) + (elmo-message-flagged-p folder number 'unread)) + (elmo-message-unset-flag folder number 'unread 'local)) + t)) (luna-define-method elmo-message-fetch-with-cache-process ((folder elmo-folder) number strategy diff --git a/wl/ChangeLog b/wl/ChangeLog index c0d783a..bc0415d 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,17 @@ +2005-01-11 Hiroya Murata + + * wl-draft.el (wl-draft-insert-get-message): Follow the API change. + (wl-draft-reedit): Ditto. + (wl-draft-queue-flush): Ditto. + + * wl-mime.el (wl-message-request-partial): Ditto. + (wl-message-delete-current-part): Use `elmo-message-fetch-string' + instead of `elmo-message-fetch'. + + * wl-action.el (wl-summary-exec-action-resend-subr): Ditto. + + * wl-summary.el (wl-summary-message-string): Ditto. + 2005-01-07 Hiroya Murata * wl-util.el (wl-current-message-buffer): Follow the API change. diff --git a/wl/wl-action.el b/wl/wl-action.el index 13fbeb6..1a79a25 100644 --- a/wl/wl-action.el +++ b/wl/wl-action.el @@ -587,17 +587,16 @@ Return number if put mark succeed" (let ((beg (point))) ;; Insert the message to be resent. (insert - (with-temp-buffer - (elmo-message-fetch folder number - (if wl-summary-resend-use-cache - (elmo-make-fetch-strategy - 'entire 'maybe nil - (elmo-file-cache-get-path - (elmo-message-field - folder number 'message-id))) - (elmo-make-fetch-strategy 'entire)) - nil (current-buffer) 'unread) - (buffer-string))) + ;; elmo-message-fetch is erace current buffer before fetch message + (elmo-message-fetch-string folder number + (if wl-summary-resend-use-cache + (elmo-make-fetch-strategy + 'entire 'maybe nil + (elmo-file-cache-get-path + (elmo-message-field + folder number 'message-id))) + (elmo-make-fetch-strategy 'entire)) + 'unread)) (goto-char (point-min)) (search-forward "\n\n") (forward-char -1) diff --git a/wl/wl-draft.el b/wl/wl-draft.el index ce725e6..7c76990 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -674,11 +674,12 @@ Reply to author if WITH-ARG is non-nil." wl-draft-cite-function) (unwind-protect (progn - (elmo-message-fetch (wl-folder-get-elmo-folder fld) - number - ;; No cache. - (elmo-make-fetch-strategy 'entire) - nil mail-reply-buffer) + (with-current-buffer mail-reply-buffer + (erase-buffer) + (elmo-message-fetch (wl-folder-get-elmo-folder fld) + number + ;; No cache. + (elmo-make-fetch-strategy 'entire))) (wl-draft-yank-from-mail-reply-buffer nil)) (kill-buffer mail-reply-buffer)))) @@ -1983,8 +1984,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (switch-to-buffer-other-frame buffer) (switch-to-buffer buffer)) (set-buffer buffer) - (elmo-message-fetch draft-folder number (elmo-make-fetch-strategy 'entire) - nil (current-buffer)) + (elmo-message-fetch draft-folder number (elmo-make-fetch-strategy 'entire)) (elmo-delete-cr-buffer) (let ((mime-edit-again-ignored-field-regexp "^\\(Content-.*\\|Mime-Version\\):")) @@ -2362,8 +2362,7 @@ Automatically applied in draft sending time." (wl-draft-queue-info-operation (car msgs) 'load) (elmo-message-fetch queue-folder (car msgs) - (elmo-make-fetch-strategy 'entire) - nil (current-buffer)) + (elmo-make-fetch-strategy 'entire)) (condition-case err (setq failure (funcall wl-draft-queue-flush-send-function diff --git a/wl/wl-mime.el b/wl/wl-mime.el index 1606ee0..7144c28 100644 --- a/wl/wl-mime.el +++ b/wl/wl-mime.el @@ -354,8 +354,6 @@ It calls following-method selected from variable (elmo-message-fetch (wl-folder-get-elmo-folder folder) number (elmo-make-fetch-strategy 'entire) - nil - (current-buffer) 'unread) (mime-parse-buffer nil))) @@ -394,8 +392,9 @@ It calls following-method selected from variable (with-current-buffer orig-buf (unless (string-equal (buffer-string) - (elmo-message-fetch folder number - (elmo-make-fetch-strategy 'entire))) + (elmo-message-fetch-string + folder number + (elmo-make-fetch-strategy 'entire))) (error "Buffer content differs from actual message"))) (when (and (elmo-folder-writable-p folder) (buffer-live-p orig-buf) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index f24d6ec..27c9026 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -746,21 +746,18 @@ If optional USE-CACHE is non-nil, use cache if exists." (folder wl-summary-buffer-elmo-folder)) (if (null number) (message "No message.") - (elmo-set-work-buf - (elmo-message-fetch folder - number - (elmo-make-fetch-strategy - 'entire - use-cache ; use cache - nil ; save cache (should `t'?) - (and - use-cache - (elmo-file-cache-get-path - (elmo-message-field folder number 'message-id)))) - nil - (current-buffer) - 'unread) - (buffer-string))))) + (elmo-message-fetch-string folder + number + (elmo-make-fetch-strategy + 'entire + use-cache ; use cache + nil ; save cache (should `t'?) + (and + use-cache + (elmo-file-cache-get-path + (elmo-message-field folder number + 'message-id)))) + 'unread)))) (defun wl-summary-reedit (&optional arg) "Re-edit current message.