* wl-vars.el (wl-fldmgr-allow-rename-access-group): New variable.
authorokada <okada>
Fri, 18 Jan 2002 16:23:23 +0000 (16:23 +0000)
committerokada <okada>
Fri, 18 Jan 2002 16:23:23 +0000 (16:23 +0000)
* wl-fldmgr.el (wl-fldmgr-rename): Allow rename for access group.
Based on the patch written by
Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp>

wl/ChangeLog
wl/wl-fldmgr.el
wl/wl-vars.el

index 8e82c9c..6b1f7b9 100644 (file)
@@ -1,3 +1,10 @@
+2002-01-19  Kenichi OKADA  <okada@opaopa.org>
+
+       * wl-vars.el (wl-fldmgr-allow-rename-access-group): New variable.
+       * wl-fldmgr.el (wl-fldmgr-rename): Allow rename for access group.
+       Based on the patch written by
+       Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp>
+
 2002-01-18  Kenichi OKADA  <okada@opaopa.org>
 
        * wl-draft.el (wl-draft-raw-send): Fix for
index 71986d1..1975285 100644 (file)
@@ -900,8 +900,6 @@ return value is diffs '(-new -unread -all)."
        (let* ((tmp (wl-fldmgr-get-path-from-buffer))
               (old-folder (nth 4 tmp))
               new-folder)
-         (if (eq (cdr (nth 2 tmp)) 'access)
-             (error "Can't rename access folder"))
          (setq new-folder
                (wl-fldmgr-read-string
                 (wl-summary-read-folder old-folder "to rename" t t old-folder)))
@@ -909,13 +907,29 @@ return value is diffs '(-new -unread -all)."
                  (file-exists-p (elmo-folder-msgdb-path
                                  (wl-folder-get-elmo-folder new-folder))))
              (error "Already exists folder: %s" new-folder))
+         (if (and (eq (cdr (nth 2 tmp)) 'access)
+                  (null wl-fldmgr-allow-rename-access-group)
+                  (null (string-match
+                         (format "^%s" (regexp-quote (car (nth 2 tmp))))
+                         new-folder)))
+             (error "Can't rename access folder"))
          (elmo-folder-rename (wl-folder-get-elmo-folder old-folder)
                              new-folder)
          (wl-folder-set-entity-info
           new-folder
           (wl-folder-get-entity-info old-folder))
-         (when (wl-fldmgr-cut tmp nil t)
-           (wl-fldmgr-add new-folder))))))))
+         (wl-folder-clear-entity-info old-folder)
+         (if (eq (cdr (nth 2 tmp)) 'access)
+
+             ;; force update access group
+             (progn
+               (wl-folder-open-close)
+               (wl-folder-jump-to-current-entity t)
+               (message (format "%s is renamed to %s" new-folder old-folder))
+               (sit-for 1))
+           ;; update folder list
+           (when (wl-fldmgr-cut tmp nil t)
+             (wl-fldmgr-add new-folder)))))))))
 
 (defun wl-fldmgr-make-access-group ()
   (interactive)
index 9ad4af2..925fd34 100644 (file)
@@ -1987,6 +1987,11 @@ ex.
                (string :tag "Other"))
   :group 'wl-folder)
 
+(defcustom wl-fldmgr-allow-rename-access-group nil
+  "*If non-nil, allow to rename folder in access group."
+  :type 'boolean
+  :group 'wl-folder)
+
 ;;; For Expire and Archive
 
 (defcustom wl-expire-alist nil