* elmo.el (elmo-folder-open-internal-p): New luna method.
authordmaus <dmaus>
Mon, 9 Aug 2010 19:17:28 +0000 (19:17 +0000)
committerdmaus <dmaus>
Mon, 9 Aug 2010 19:17:28 +0000 (19:17 +0000)
(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.

elmo/ChangeLog
elmo/elmo-filter.el
elmo/elmo-map.el
elmo/elmo-multi.el
elmo/elmo-pipe.el
elmo/elmo.el

index 5af96fb..90dd1ad 100644 (file)
@@ -1,3 +1,12 @@
+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
index 700be31..65aacfa 100644 (file)
 (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))))
index 0ba69ff..20c6f65 100644 (file)
@@ -233,6 +233,9 @@ Return new location alist."
      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))))
index 2e52de3..122a6df 100644 (file)
   (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)))
index f3c7ffc..68bb479 100644 (file)
 (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)))
 
index 3b3e707..c3c0bd7 100644 (file)
@@ -217,6 +217,9 @@ If optional LOAD-MSGDB is non-nil, msgdb is loaded.
 (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.")
 
@@ -713,6 +716,10 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-FLAG-ALIST).")
   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.
 
@@ -1188,7 +1195,8 @@ Returns a list of message numbers successfully appended."
          (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