(elmo-folder-move-messages): Open source folder only if necessary.
* elmo-pipe.el (elmo-folder-open-internal-p): New luna method.
* elmo-multi.el (elmo-folder-open-internal-p): Dto.
* elmo-map.el (elmo-folder-open-internal-p): Dto.
* elmo-filter.el (elmo-folder-open-internal-p): Dto.
+2010-08-09 David Maus <dmaus@ictsoc.de>
+
+ * elmo.el (elmo-folder-open-internal-p): New luna method.
+ (elmo-folder-move-messages): Open source folder only if necessary.
+ * elmo-pipe.el (elmo-folder-open-internal-p): New luna method.
+ * elmo-multi.el (elmo-folder-open-internal-p): Dto.
+ * elmo-map.el (elmo-folder-open-internal-p): Dto.
+ * elmo-filter.el (elmo-folder-open-internal-p): Dto.
+
2010-08-01 David Maus <dmaus@ictsoc.de>
* elmo.el (elmo-folder-move-messages): Open source folder before
(luna-define-method elmo-folder-open-internal ((folder elmo-filter-folder))
(elmo-folder-open-internal (elmo-filter-folder-target-internal folder)))
+(luna-define-method elmo-folder-open-internal-p ((folder elmo-filter-folder))
+ (elmo-folder-open-internal-p (elmo-filter-folder-target-internal folder)))
+
(luna-define-method elmo-folder-check ((folder elmo-filter-folder))
(when (elmo-filter-folder-require-msgdb-internal folder)
(elmo-folder-synchronize (elmo-filter-folder-target-internal folder))))
folder
(elmo-map-folder-list-message-locations folder))))
+(luna-define-method elmo-folder-open-internal-p ((folder elmo-map-folder))
+ (elmo-location-map-alist folder))
+
(luna-define-method elmo-folder-commit :after ((folder elmo-map-folder))
(when (elmo-folder-persistent-p folder)
(elmo-location-map-save folder (elmo-folder-msgdb-path folder))))
(dolist (fld (elmo-multi-folder-children-internal folder))
(elmo-folder-open-internal fld)))
+(luna-define-method elmo-folder-open-internal-p ((folder elmo-multi-folder))
+ (let (open)
+ (dolist (fld (elmo-multi-folder-children-internal folder))
+ (setq open (and open (elmo-folder-open-internal-p fld))))))
+
(luna-define-method elmo-folder-check ((folder elmo-multi-folder))
(dolist (fld (elmo-multi-folder-children-internal folder))
(elmo-folder-check fld)))
(luna-define-method elmo-folder-open-internal ((folder elmo-pipe-folder))
(elmo-folder-open-internal (elmo-pipe-folder-dst-internal folder)))
+(luna-define-method elmo-folder-open-internal-p ((folder elmo-pipe-folder))
+ (elmo-folder-open-internal-p (elmo-pipe-folder-dst-internal folder)))
+
(luna-define-method elmo-folder-close-internal ((folder elmo-pipe-folder))
(elmo-folder-close-internal (elmo-pipe-folder-dst-internal folder)))
(luna-define-generic elmo-folder-open-internal (folder)
"Open FOLDER (without loading saved folder status).")
+(luna-define-generic elmo-folder-open-internal-p (folder)
+ "Return non-nil if FOLDER is opened internally.")
+
(luna-define-generic elmo-folder-check (folder)
"Check the FOLDER to obtain newest information at the next list operation.")
nil ; default is do nothing.
)
+(luna-define-method elmo-folder-open-internal-p ((folder elmo-folder))
+ t ; default is always opened internally
+ )
+
(luna-define-method elmo-folder-check ((folder elmo-folder))
nil) ; default is noop.
(error "move: %d is not writable"
(elmo-folder-name-internal dst-folder)))
(when messages
- (elmo-folder-open-internal src-folder)
+ (unless (elmo-folder-open-internal-p src-folder)
+ (elmo-folder-open-internal src-folder))
(elmo-folder-open-internal dst-folder)
(unless (setq succeeds (elmo-folder-append-messages dst-folder
src-folder