* wl-fldmgr.el (wl-fldmgr-add): Create folder after testing parent
authoryoichi <yoichi>
Sun, 20 Mar 2005 05:26:15 +0000 (05:26 +0000)
committeryoichi <yoichi>
Sun, 20 Mar 2005 05:26:15 +0000 (05:26 +0000)
group is access or not (it is not strict, like wl-fldmgr-rename).

wl/ChangeLog
wl/wl-fldmgr.el

index 7bdd60b..681b08e 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-20  Yoichi NAKAYAMA  <yoichi@geiin.org>
+
+       * wl-fldmgr.el (wl-fldmgr-add): Create folder after testing parent
+       group is access or not (it is not strict, like wl-fldmgr-rename).
+
 2005-03-17  Yoichi NAKAYAMA  <yoichi@geiin.org>
 
        * wl-thread.el (wl-thread-update-line-on-buffer-sub): Avoid
index 821e144..ec79f5b 100644 (file)
@@ -831,20 +831,34 @@ return value is diffs '(-new -unread -all)."
        (setq indent (wl-fldmgr-make-indent (nth 1 tmp)))
        (or name
            (setq name (wl-fldmgr-read-string
-                       (wl-summary-read-folder wl-default-folder "to add"))))
-       ;; maybe add elmo-plugged-alist.
-       (elmo-folder-set-plugged (wl-folder-get-elmo-folder
-                                 (if (listp name) (car name) name))
-                                wl-plugged t)
-       (when (setq diffs
-                   (wl-add-entity
-                    path (list name) wl-folder-entity (nth 3 tmp) t))
-         (wl-folder-insert-entity indent name)
-         (wl-fldmgr-update-group path diffs)
-         (setq wl-fldmgr-modified t)
-         (set-buffer-modified-p nil)
-         (setq ret-val t)))
-      ret-val)))
+                       (wl-summary-read-folder wl-default-folder
+                                               "to add" nil t))))
+       (let ((parent (nth 2 (wl-fldmgr-get-path-from-buffer))))
+         (if (eq (cdr parent) 'access)
+             (if (string-match
+                  (format "^%s" (regexp-quote (car parent))) name)
+                 ;; force update access group
+                 (progn
+                   (wl-folder-confirm-existence
+                    (wl-folder-get-elmo-folder name))
+                   (wl-folder-open-close)
+                   (wl-folder-jump-to-current-entity t)
+                   (setq ret-val t))
+               (error "Can't insert folder under access group"))
+           (wl-folder-confirm-existence (wl-folder-get-elmo-folder name))
+           ;; maybe add elmo-plugged-alist.
+           (elmo-folder-set-plugged (wl-folder-get-elmo-folder
+                                     (if (listp name) (car name) name))
+                                    wl-plugged t)
+           (when (setq diffs
+                       (wl-add-entity
+                        path (list name) wl-folder-entity (nth 3 tmp) t))
+             (wl-folder-insert-entity indent name)
+             (wl-fldmgr-update-group path diffs)
+             (setq wl-fldmgr-modified t)
+             (set-buffer-modified-p nil)
+             (setq ret-val t)))
+         ret-val)))))
 
 (defun wl-fldmgr-delete ()
   (interactive)