* wl-folder.el (wl-folder-create-subr): New function.
authorueno <ueno>
Tue, 22 Aug 2000 09:31:04 +0000 (09:31 +0000)
committerueno <ueno>
Tue, 22 Aug 2000 09:31:04 +0000 (09:31 +0000)
(wl-folder-confirm-existence): Use it.
(wl-folder-check-one-entity): Use it.
Check the error symbol is derived from 'elmo-open-error.

* wl-summary.el (wl-summary-read-folder): Don't pass the argument
`ignore-error'.

wl/ChangeLog
wl/wl-folder.el
wl/wl-summary.el

index 43431d2..d60ea83 100644 (file)
@@ -1,3 +1,13 @@
+2000-08-22   Daiki Ueno  <ueno@unixuser.org>
+
+       * wl-folder.el (wl-folder-create-subr): New function.
+       (wl-folder-confirm-existence): Use it.
+       (wl-folder-check-one-entity): Use it.
+       Check the error symbol is derived from 'elmo-open-error.
+
+       * wl-summary.el (wl-summary-read-folder): Don't pass the argument
+       `ignore-error'.
+
 2000-08-21  Kaoru Takahashi  <kaoru@kaisei.org>
 
        * wl-util.el (toplevel): Add (eval-when-compile (require
index 892b18b..1ad2286 100644 (file)
                   (if (wl-string-member entity wl-strict-diff-folders)
                       (elmo-strict-folder-diff entity)
                     (elmo-folder-diff entity))
-                (error
+                (error       
                  ;; maybe not exist folder.
-                 (if (not (elmo-folder-exists-p entity))
-                     (if (not (elmo-folder-creatable-p entity))
-                         (error "Folder %s is not found" entity)
-                       (if (y-or-n-p 
-                            (format "Folder %s does not exist, create it?" 
-                                    entity))
-                           (progn
-                             (unless (elmo-create-folder entity)
-                               (error "Create folder failed"))
-                             ;; one more try.
-                             (if (wl-string-member entity wl-strict-diff-folders)
-                                 (elmo-strict-folder-diff entity)
-                               (elmo-folder-diff entity)))
-                         (error "Folder is not created")))
+                 (if (and (not (memq 'elmo-open-error
+                                     (get (car err) 'error-conditions)))
+                          (not (elmo-folder-exists-p entity)))
+                     (wl-folder-create-subr entity)
                    (signal (car err) (cdr err))))))
         unread unsync nomif)
     (if (and (eq wl-folder-notify-deleted 'sync)
@@ -2648,38 +2638,24 @@ If optional arg exists, don't check any folders."
        (wl-exit)
       (kill-buffer bufname))))
 
-(defun wl-folder-confirm-existence (fld &optional ignore-error)
-  (if (or (wl-folder-entity-exists-p fld)
-         (file-exists-p (elmo-msgdb-expand-path fld)))
-      ()
-    (if ignore-error
-       (condition-case nil
-           (if (elmo-folder-exists-p fld)
-               ()
-             (if (elmo-folder-creatable-p fld)
-                 (if (y-or-n-p 
-                      (format "Folder %s does not exist, create it?" fld))
-                     (progn
-                       (setq wl-folder-entity-hashtb
-                             (wl-folder-create-entity-hashtb
-                              fld
-                              wl-folder-entity-hashtb))
-                       (elmo-create-folder fld)))))
-         (error))
-      (if (elmo-folder-exists-p fld)
-         ()
-       (if (not (elmo-folder-creatable-p fld))
-           (error "Folder %s is not found" fld)
-         (if (y-or-n-p 
-              (format "Folder %s does not exist, create it?" fld))
-             (progn
-               (setq wl-folder-entity-hashtb
-                     (wl-folder-create-entity-hashtb
-                      fld
-                      wl-folder-entity-hashtb))
-               (unless (elmo-create-folder fld)
-                 (error "Create folder failed")))
-           (error "Folder is not created")))))))
+(defun wl-folder-create-subr (entity)
+  (if (not (elmo-folder-creatable-p entity))
+      (error "Folder %s is not found" entity)
+    (if (y-or-n-p 
+        (format "Folder %s does not exist, create it?" 
+                entity))
+       (progn
+         (setq wl-folder-entity-hashtb
+               (wl-folder-create-entity-hashtb
+                entity wl-folder-entity-hashtb))
+         (unless (elmo-create-folder entity)
+           (error "Create folder failed")))
+      (error "Folder %s is not created" entity))))
+
+(defun wl-folder-confirm-existence (folder)
+  (unless (or (wl-folder-entity-exists-p folder)
+             (file-exists-p (elmo-msgdb-expand-path folder)))
+    (wl-folder-create-subr folder)))
 
 (provide 'wl-folder)
 
index 412030b..07e0aad 100644 (file)
@@ -3428,7 +3428,9 @@ If optional argument NUMBER is specified, mark message specified by NUMBER."
            (string= fld ""))
        (setq fld default))
     (unless no-create
-      (wl-folder-confirm-existence fld ignore-error))
+      (if ignore-error
+         (ignore-errors (wl-folder-confirm-existence fld))
+       (wl-folder-confirm-existence fld)))
     fld))
 
 (defun wl-summary-print-destination (msg-num folder)