From: ueno Date: Tue, 22 Aug 2000 09:31:04 +0000 (+0000) Subject: * wl-folder.el (wl-folder-create-subr): New function. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b269b6a47cc8034e60cdc7b2c0f8dbe6157f4b89;p=elisp%2Fwanderlust.git * 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'. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 43431d2..d60ea83 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,13 @@ +2000-08-22 Daiki Ueno + + * 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 * wl-util.el (toplevel): Add (eval-when-compile (require diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 892b18b..1ad2286 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -808,22 +808,12 @@ (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) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 412030b..07e0aad 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -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)