From: hmurata Date: Sat, 12 Feb 2005 06:05:15 +0000 (+0000) Subject: * elmo.el (toplevel): Added autoload setting for `md5'. X-Git-Tag: wl-2_14-root~49 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f28a522e2a489093cd0ee9d8a44d7b286932b384;p=elisp%2Fwanderlust.git * elmo.el (toplevel): Added autoload setting for `md5'. (elmo-msgdb-path-encode-threshold): New use option. (elmo-folder-msgdb-path): Encode msgdb path if its length is longer than `elmo-msgdb-path-encode-threshold'. * elmo-flag.el (elmo-global-mark-migrate): Use `elmo-folder-expand-msgdb-path' instead of `elmo-folder-msgdb-path'. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 396bc35..63e646d 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,14 @@ +2005-02-12 Hiroya Murata + + * elmo.el (toplevel): Added autoload setting for `md5'. + (elmo-msgdb-path-encode-threshold): New use option. + (elmo-folder-msgdb-path): Encode msgdb path if its length is + longer than `elmo-msgdb-path-encode-threshold'. + + * elmo-flag.el (elmo-global-mark-migrate): Use + `elmo-folder-expand-msgdb-path' instead of + `elmo-folder-msgdb-path'. + 2005-02-11 Hiroya Murata * elmo-multi.el (elmo-multi-folder-diff): Fixed problem when the diff --git a/elmo/elmo-flag.el b/elmo/elmo-flag.el index c3ae100..e83fbe8 100644 --- a/elmo/elmo-flag.el +++ b/elmo/elmo-flag.el @@ -454,7 +454,7 @@ If optional IGNORE-PRESERVED is non-nil, preserved flags (when (and (file-exists-p (expand-file-name elmo-global-mark-filename elmo-msgdb-directory)) (elmo-global-flag-p 'important) - (not (file-exists-p (elmo-folder-expand-msgdb-path + (not (file-exists-p (elmo-folder-msgdb-path (elmo-flag-get-folder 'important))))) (elmo-global-mark-upgrade))) diff --git a/elmo/elmo.el b/elmo/elmo.el index 58f65b6..b7be6fb 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -68,6 +68,12 @@ Otherwise, entire fetching of the message is aborted without confirmation." :type 'boolean :group 'elmo) +(defcustom elmo-msgdb-path-encode-threshold nil + "*Encode msgdb path if its length is longer than this value." + :type '(choice (const :tag "No encode" nil) + number) + :group 'elmo) + (defvar elmo-message-displaying nil "A global switch to indicate message is displaying or not.") @@ -83,6 +89,7 @@ Otherwise, entire fetching of the message is aborted without confirmation." ;; autoloads (eval-and-compile + (autoload 'md5 "md5") (autoload 'elmo-dop-queue-flush "elmo-dop") (autoload 'elmo-nntp-post "elmo-nntp") (autoload 'elmo-global-flag-p "elmo-flag") @@ -1127,7 +1134,19 @@ If optional argument IF-EXISTS is nil, load on demand. (or (elmo-folder-path-internal folder) (elmo-folder-set-path-internal folder - (elmo-folder-expand-msgdb-path folder)))) + (if (null elmo-msgdb-path-encode-threshold) + (elmo-folder-expand-msgdb-path folder) + (let* ((path (directory-file-name + (elmo-folder-expand-msgdb-path folder))) + (dirname (file-name-nondirectory path))) + (if (<= (length dirname) elmo-msgdb-path-encode-threshold) + path + (require 'md5) + (setq dirname (md5 dirname)) + (when (> (length dirname) elmo-msgdb-path-encode-threshold) + (error "Cannot shrink msgdb path for `%s'" + (elmo-folder-name-internal folder))) + (expand-file-name dirname (file-name-directory path)))))))) (luna-define-generic elmo-message-cached-p (folder number) "Return non-nil if the message is cached.")