`wl-folder-make-elmo-folder'.
* wl-spam.el (wl-summary-exec-action-spam): Use
`wl-folder-make-elmo-folder' instead of `elmo-make-folder'.
* wl-folder.el (wl-folder-make-elmo-folder): New function.
(wl-draft-get-folder): Use `wl-folder-make-elmo-folder' instead of
`elmo-make-folder'.
(wl-folder-get-elmo-folder): Ditto.
(wl-folder-create-subr): Simplify.
* elmo.el (elmo-get-folder-function): New variable.
(elmo-get-folder): New function.
(elmo-folder-rename): Call `elmo-make-folder' with specified
mime-charset.
* elmo-split.el (elmo-split): Use `elmo-get-folder' instead of
`elmo-make-folder'.
(elmo-split-subr): Ditto.
* elmo-multi.el (elmo-folder-initialize): Ditto.
* elmo-internal.el (elmo-folder-list-subfolders): Ditto.
* elmo-flag.el (elmo-flag-folder-delete-message): Ditto.
(elmo-flag-get-folder): Ditto.
* elmo-filter.el (elmo-folder-initialize): Ditto.
* elmo-access.el (elmo-folder-initialize): Ditto.
(elmo-access-folder-update-children): Ditto.
* elmo-dop.el (elmo-dop-queue-flush): Ditto.
(elmo-dop-queue-flush): Ditto.
(elmo-folder-append-buffer-dop-delayed): Ditto.
(elmo-dop-spool-folder): Call `elmo-make-folder' with specified
mime-charset.
* elmo-pipe.el (elmo-folder-initialize): Use `elmo-get-folder'
instead of `elmo-make-folder'.
(elmo-folder-rename): Ditto. Use `elmo-folder-rename' to
destination folder instead of send `elmo-folder-rename-internal'.
* elmo-shimbun.el (elmo-folder-list-subfolders): Use `shimbun'
slot of subfolder instead of create it.
+2005-06-12 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * elmo.el (elmo-get-folder-function): New variable.
+ (elmo-get-folder): New function.
+ (elmo-folder-rename): Call `elmo-make-folder' with specified
+ mime-charset.
+
+ * elmo-split.el (elmo-split): Use `elmo-get-folder' instead of
+ `elmo-make-folder'.
+ (elmo-split-subr): Ditto.
+
+ * elmo-multi.el (elmo-folder-initialize): Ditto.
+
+ * elmo-internal.el (elmo-folder-list-subfolders): Ditto.
+
+ * elmo-flag.el (elmo-flag-folder-delete-message): Ditto.
+ (elmo-flag-get-folder): Ditto.
+
+ * elmo-filter.el (elmo-folder-initialize): Ditto.
+
+ * elmo-access.el (elmo-folder-initialize): Ditto.
+ (elmo-access-folder-update-children): Ditto.
+
+ * elmo-dop.el (elmo-dop-queue-flush): Ditto.
+ (elmo-dop-queue-flush): Ditto.
+ (elmo-folder-append-buffer-dop-delayed): Ditto.
+ (elmo-dop-spool-folder): Call `elmo-make-folder' with specified
+ mime-charset.
+
+ * elmo-pipe.el (elmo-folder-initialize): Use `elmo-get-folder'
+ instead of `elmo-make-folder'.
+ (elmo-folder-rename): Ditto. Use `elmo-folder-rename' to
+ destination folder instead of send `elmo-folder-rename-internal'.
+
+ * elmo-shimbun.el (elmo-folder-list-subfolders): Use `shimbun'
+ slot of subfolder instead of create it.
+
2005-06-10 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* elmo-util.el (elmo-collect-separators): New function.
(luna-define-method elmo-folder-initialize ((folder elmo-access-folder) name)
(elmo-access-folder-set-base-folder-internal
folder
- (elmo-make-folder name))
+ (elmo-get-folder name))
(elmo-multi-folder-set-children-internal
folder
- (mapcar #'elmo-make-folder
+ (mapcar #'elmo-get-folder
(elmo-object-load
(expand-file-name elmo-access-folder-list-filename
(elmo-folder-msgdb-path folder)))))
(if subfolders
(nconc children
(mapcar (lambda (name)
- (let ((folder (elmo-make-folder name)))
+ (let ((folder (elmo-get-folder name)))
(when open
(elmo-folder-open-internal folder))
folder))
len)
(while queue-all
(if (elmo-folder-plugged-p
- (elmo-make-folder (elmo-dop-queue-fname (car queue-all))))
+ (elmo-get-folder (elmo-dop-queue-fname (car queue-all))))
(setq queue (append queue (list (car queue-all)))))
(setq queue-all (cdr queue-all)))
(setq count (length queue))
(apply (elmo-dop-queue-method (car queue))
(prog1
(setq folder
- (elmo-make-folder
+ (elmo-get-folder
(elmo-dop-queue-fname (car queue))))
(elmo-folder-open folder)
(unless (elmo-folder-plugged-p folder)
'elmo-folder-append-buffer-dop-delayed)
(elmo-folder-delete-messages
(elmo-dop-spool-folder
- (elmo-make-folder (elmo-dop-queue-fname (car queue))))
+ (elmo-get-folder (elmo-dop-queue-fname (car queue))))
(list (nth 1 (elmo-dop-queue-arguments (car queue))))))
(setq elmo-dop-queue (delq (car queue) elmo-dop-queue))
(setq queue (cdr queue)))
(setq elmo-dop-queue new-queue)))
;;; dop spool folder
-(defmacro elmo-dop-spool-folder (folder)
+(defsubst elmo-dop-spool-folder (folder)
"Return a spool folder for disconnected operations
which is corresponded to the FOLDER."
- (` (elmo-make-folder
- (concat "+" (expand-file-name "spool" (elmo-folder-msgdb-path
- (, folder)))))))
+ (elmo-make-folder
+ (concat "+" (expand-file-name "spool" (elmo-folder-msgdb-path folder)))
+ nil
+ (elmo-folder-mime-charset-internal folder)))
(defun elmo-dop-spool-folder-append-buffer (folder flags)
"Append current buffer content to the dop spool folder.
(error))
;; Append failed...
(elmo-folder-append-buffer
- (elmo-make-folder elmo-lost+found-folder)
+ (elmo-get-folder elmo-lost+found-folder)
flags))
(elmo-folder-delete-messages spool-folder (list number)))))
;; ignore failure (already dequed)
(if (string-match "^ */\\(.*\\)$" (cdr pair))
(elmo-filter-folder-set-target-internal
folder
- (elmo-make-folder (elmo-match-string 1 (cdr pair))))
+ (elmo-get-folder (elmo-match-string 1 (cdr pair))))
(error "Folder syntax error `%s'" (elmo-folder-name-internal folder)))
(elmo-filter-folder-set-require-msgdb-internal
folder
(elmo-flag-folder-minfo-hash-internal
folder))
(unless keep-referrer
- (setq target-folder (elmo-make-folder (car pair)))
+ (setq target-folder (elmo-get-folder (car pair)))
(elmo-folder-open target-folder 'load-msgdb)
;; Unset the flag of the original folder.
;; (XXX Should the message-id checked?)
(defmacro elmo-flag-get-folder (flag)
"Get the flag folder structure for FLAG."
`(when (memq ,flag elmo-global-flags)
- (elmo-make-folder (concat "'flag/" (symbol-name ,flag)))))
+ (elmo-get-folder (concat "'flag/" (symbol-name ,flag)))))
(defun elmo-flag-folder-referrer (folder number)
"Return a list of referrer message information.
(lambda (x)
(let ((name (concat (elmo-folder-prefix-internal folder)
(symbol-name x))))
- (if (elmo-folder-have-subfolder-p (elmo-make-folder name))
+ (if (elmo-folder-have-subfolder-p (elmo-get-folder name))
(list name)
name)))
elmo-internal-folder-list)
(lambda (x)
(let* ((name (concat (elmo-folder-prefix-internal folder)
(symbol-name x)))
- (subfolder (elmo-make-folder name)))
+ (subfolder (elmo-get-folder name)))
(if (elmo-folder-have-subfolder-p subfolder)
(elmo-folder-list-subfolders subfolder)
(list name))))
folder
(nconc (elmo-multi-folder-children-internal
folder)
- (list (elmo-make-folder (car name)))))
+ (list (elmo-get-folder (car name)))))
(setq name (cdr name))
(when (and (> (length name) 0)
(eq (aref name 0) ?,))
name)
(when (string-match "^\\([^|]*\\)|\\(:?\\)\\(.*\\)$" name)
(elmo-pipe-folder-set-src-internal folder
- (elmo-make-folder
+ (elmo-get-folder
(elmo-match-string 1 name)))
(elmo-pipe-folder-set-dst-internal folder
- (elmo-make-folder
+ (elmo-get-folder
(elmo-match-string 3 name)))
(elmo-pipe-folder-set-copy-internal folder
(string= ":"
(elmo-folder-pack-numbers (elmo-pipe-folder-dst-internal folder)))
(luna-define-method elmo-folder-rename ((folder elmo-pipe-folder) new-name)
- (let* ((new-folder (elmo-make-folder new-name)))
+ (let* ((new-folder (elmo-get-folder new-name)))
(unless (string= (elmo-folder-name-internal
(elmo-pipe-folder-src-internal folder))
(elmo-folder-name-internal
(elmo-folder-type-internal
(elmo-pipe-folder-dst-internal new-folder)))
(error "Not same folder type"))
- (if (or (file-exists-p (elmo-folder-msgdb-path
- (elmo-pipe-folder-dst-internal new-folder)))
- (elmo-folder-exists-p
- (elmo-pipe-folder-dst-internal new-folder)))
- (error "Already exists folder: %s" new-name))
- (elmo-folder-send (elmo-pipe-folder-dst-internal folder)
- 'elmo-folder-rename-internal
- (elmo-pipe-folder-dst-internal new-folder))
+ (elmo-folder-rename (elmo-pipe-folder-dst-internal folder)
+ (elmo-folder-name-internal
+ (elmo-pipe-folder-dst-internal new-folder)))
(elmo-msgdb-rename-path folder new-folder)))
(luna-define-method elmo-folder-synchronize ((folder elmo-pipe-folder)
(setq folders
(append folders
(mapcar
- (lambda (fld) (concat prefix server "." fld))
+ (lambda (group) (concat prefix server "." group))
(shimbun-groups
- (shimbun-open server
- (let ((fld
- (elmo-make-folder
- (concat prefix server))))
- (luna-make-entity
- 'shimbun-elmo-mua
- :folder fld))))))))
+ (elmo-shimbun-folder-shimbun-internal
+ (elmo-get-folder (concat prefix server))))))))
folders)))))
(luna-define-method elmo-folder-exists-p ((folder elmo-shimbun-folder))
(fcount 0)
ret)
(dolist (folder folders)
- (setq ret (elmo-split-subr (elmo-make-folder folder) arg)
+ (setq ret (elmo-split-subr (elmo-get-folder folder) arg)
count (+ count (car ret))
fcount (+ fcount (cdr ret))))
(run-hooks 'elmo-split-hook)
((stringp action)
(condition-case nil
(progn
- (setq target-folder (elmo-make-folder action))
+ (setq target-folder (elmo-get-folder action))
(unless (elmo-folder-exists-p target-folder)
(when
(and
(save-match-data
(elmo-folder-send folder 'elmo-folder-initialize name))))
+(defvar elmo-get-folder-function nil)
+
+(defun elmo-get-folder (name)
+ (or (and elmo-get-folder-function
+ (funcall elmo-get-folder-function name))
+ (elmo-make-folder name)))
+
;; Note that this function is for internal use only.
(luna-define-generic elmo-folder-msgdb (folder)
"Return the msgdb of FOLDER (on-demand loading).
t))
(luna-define-method elmo-folder-rename ((folder elmo-folder) new-name)
- (let* ((new-folder (elmo-make-folder new-name)))
+ (let* ((new-folder (elmo-make-folder
+ new-name
+ nil
+ (elmo-folder-mime-charset-internal folder))))
(unless (eq (elmo-folder-type-internal folder)
(elmo-folder-type-internal new-folder))
(error "Not same folder type"))
- (if (or (file-exists-p (elmo-folder-msgdb-path new-folder))
- (elmo-folder-exists-p new-folder))
- (error "Already exists folder: %s" new-name))
+ (when (or (file-exists-p (elmo-folder-msgdb-path new-folder))
+ (elmo-folder-exists-p new-folder))
+ (error "Already exists folder: %s" new-name))
(elmo-folder-send folder 'elmo-folder-rename-internal new-folder)
(elmo-msgdb-rename-path folder new-folder)))
+2005-06-12 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * wl.el (wl-init): Set `elmo-get-folder-function' as
+ `wl-folder-make-elmo-folder'.
+
+ * wl-spam.el (wl-summary-exec-action-spam): Use
+ `wl-folder-make-elmo-folder' instead of `elmo-make-folder'.
+
+ * wl-folder.el (wl-folder-make-elmo-folder): New function.
+ (wl-draft-get-folder): Use `wl-folder-make-elmo-folder' instead of
+ `elmo-make-folder'.
+ (wl-folder-get-elmo-folder): Ditto.
+ (wl-folder-create-subr): Simplify.
+
2005-06-05 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* wl-mime.el (wl-message-verify-pgp-nonmime): Fix the last change.
(string= (elmo-folder-name-internal wl-draft-folder-internal)
wl-draft-folder))
wl-draft-folder-internal
- (setq wl-draft-folder-internal (elmo-make-folder
- wl-draft-folder
- nil
- (wl-folder-mime-charset wl-draft-folder)))
+ (setq wl-draft-folder-internal (wl-folder-make-elmo-folder
+ wl-draft-folder))
(wl-folder-confirm-existence wl-draft-folder-internal)
(elmo-folder-open wl-draft-folder-internal 'load-msgdb)
wl-draft-folder-internal))
(or (wl-get-assoc-list-value wl-folder-mime-charset-alist folder-name)
wl-mime-charset))
+(defun wl-folder-make-elmo-folder (folder-name)
+ (elmo-make-folder folder-name nil (wl-folder-mime-charset folder-name)))
+
(defsubst wl-folder-get-elmo-folder (entity &optional no-cache)
"Get elmo folder structure from ENTITY."
(let ((name (elmo-string entity)))
(if no-cache
- (elmo-make-folder name nil (wl-folder-mime-charset name))
+ (wl-folder-make-elmo-folder name)
(if (string= name wl-draft-folder)
(wl-draft-get-folder)
(or (wl-folder-elmo-folder-cache-get name)
- (let ((folder (elmo-make-folder name
- nil
- (wl-folder-mime-charset name))))
+ (let ((folder (wl-folder-make-elmo-folder name)))
(wl-folder-elmo-folder-cache-put name folder)
folder))))))
(kill-buffer bufname))))
(defun wl-folder-create-subr (folder)
- (if (elmo-folder-creatable-p folder)
- (if (y-or-n-p (format "Folder %s does not exist, create it? "
- (elmo-folder-name-internal folder)))
- (progn
- (message "")
- (setq wl-folder-entity-hashtb
- (wl-folder-create-entity-hashtb
- (elmo-folder-name-internal folder)
- wl-folder-entity-hashtb))
- (unless (elmo-folder-create folder)
- (error "Create folder failed")))
- (error "Folder %s is not created" (elmo-folder-name-internal folder)))
- (error "Folder %s does not exist" (elmo-folder-name-internal folder))))
+ (let ((name (elmo-folder-name-internal folder)))
+ (unless (elmo-folder-creatable-p folder)
+ (error "Folder %s does not exist" name))
+ (unless (y-or-n-p (format "Folder %s does not exist, create it? " name))
+ (error "Folder %s is not created" name))
+ (message "")
+ (setq wl-folder-entity-hashtb
+ (wl-folder-create-entity-hashtb name wl-folder-entity-hashtb))
+ (unless (elmo-folder-create folder)
+ (error "Create folder failed"))))
(defun wl-folder-confirm-existence (folder &optional force)
(if force
(let ((domain (wl-spam-domain (elmo-folder-name-internal
wl-summary-buffer-elmo-folder)))
(total (length mark-list)))
- (wl-folder-confirm-existence (elmo-make-folder wl-spam-folder))
+ (wl-folder-confirm-existence (wl-folder-get-elmo-folder wl-spam-folder))
(when (memq domain '(undecided good))
(message "Registering spam...")
(elmo-with-progress-display (> total elmo-display-progress-threshold)
(make-face (intern
(format "wl-highlight-summary-%s-flag-face" (car spec))))
(nth 1 spec)))
+ (setq elmo-get-folder-function #'wl-folder-make-elmo-folder)
(setq elmo-no-from wl-summary-no-from-message)
(setq elmo-no-subject wl-summary-no-subject-message)
(elmo-global-flags-initialize (mapcar 'car wl-summary-flag-alist))