From: okada Date: Fri, 18 Jan 2002 16:23:23 +0000 (+0000) Subject: * wl-vars.el (wl-fldmgr-allow-rename-access-group): New variable. X-Git-Tag: wl-2_9_5~1 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f69384e4b4dc241a3990d49b9f2674eb0b717b6;p=elisp%2Fwanderlust.git * 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 --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 8e82c9c..6b1f7b9 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,10 @@ +2002-01-19 Kenichi OKADA + + * 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 + 2002-01-18 Kenichi OKADA * wl-draft.el (wl-draft-raw-send): Fix for diff --git a/wl/wl-fldmgr.el b/wl/wl-fldmgr.el index 71986d1..1975285 100644 --- a/wl/wl-fldmgr.el +++ b/wl/wl-fldmgr.el @@ -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) diff --git a/wl/wl-vars.el b/wl/wl-vars.el index 9ad4af2..925fd34 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -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