+2005-02-12 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * 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 <lapis-lazuli@pop06.odn.ne.jp>
* elmo-multi.el (elmo-multi-folder-diff): Fixed problem when the
(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)))
: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.")
;; 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")
(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.")