From 976cf9657e2abee98cc3e9eff6fdab1e25a5074c Mon Sep 17 00:00:00 2001 From: hmurata Date: Mon, 2 Oct 2006 04:09:25 +0000 Subject: [PATCH] (elmo-global-flag-set-internal): Use `elmo-copy-file' by priority when the message is a file. --- elmo/ChangeLog | 5 +++++ elmo/elmo-flag.el | 24 +++++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index dae999d..8c029cb 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2006-10-02 Hiroya Murata + + * elmo-flag.el (elmo-global-flag-set-internal): Use + `elmo-copy-file' by priority when the message is a file. + 2006-10-01 Yoichi NAKAYAMA * elmo.el: Fix typo: disptch -> dispatch. diff --git a/elmo/elmo-flag.el b/elmo/elmo-flag.el index 8f71c94..3456331 100644 --- a/elmo/elmo-flag.el +++ b/elmo/elmo-flag.el @@ -299,7 +299,7 @@ NUMBER is the message number." (error "Cannot treat `%s' as global flag" flag)) (when message-id (let ((flag-folder (elmo-flag-get-folder flag)) - cache new-file new-number elem) + filename cache new-file new-number elem) (if (setq elem (elmo-get-hash-val message-id (elmo-flag-folder-minfo-hash-internal @@ -331,16 +331,18 @@ NUMBER is the message number." (setq new-number (elmo-flag-folder-max-number-internal flag-folder))) (elmo-localdir-folder-directory-internal flag-folder))) - (with-temp-buffer - (setq cache (and message-id (elmo-file-cache-get message-id))) - (if (and cache (eq (elmo-file-cache-status cache) 'entire)) - (elmo-copy-file (elmo-file-cache-path cache) - new-file) - (when (and folder number) - (elmo-message-fetch folder number - (elmo-make-fetch-strategy 'entire)) - (write-region-as-binary (point-min) (point-max) new-file nil - 'no-msg)))) + (cond + ((setq filename (elmo-message-file-name folder number)) + (elmo-copy-file filename new-file)) + ((and (setq cache (elmo-file-cache-get message-id)) + (eq (elmo-file-cache-status cache) 'entire)) + (elmo-copy-file (elmo-file-cache-path cache) new-file)) + (t + (with-temp-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 flag-folder (cons -- 1.7.10.4