(defun wl-fldmgr-exit ()
(when (and wl-fldmgr-modified
(or (not wl-interactive-save-folders)
- (y-or-n-p "Folder view was modified. Save current folders? ")))
+ (y-or-n-p
+ (concat "Folder view was modified"
+ (and wl-fldmgr-cut-entity-list
+ (format " (%s in cut stack)"
+ (length wl-fldmgr-cut-entity-list)))
+ ". Save current folders? "))))
(wl-fldmgr-save-folders)))
;;; Macro and misc Function
;; (defun wl-fldmgr-get-previous-entity (entity key-id)
;; (cdr (wl-fldmgr-get-previous-entity-internal '(nil . nil) entity key-id)))
-;;
+;;
;; (defun wl-fldmgr-get-previous-entity-internal (result entity key-id)
;; (cond
;; ((stringp entity)
(message "%s not found" key)
(setq update nil)
(throw 'done t)))
- (when access
+ (when (and access (not clear))
(if is-group
(wl-append unsubscribes
(list (list (elmo-string key) 'access nil)))
(throw 'found (symbol-value atom)))))
wl-fldmgr-add-completion-hashtb)))
(pattern
- (if (string-match "\\.$"
+ (if (string-match "\\.$"
(elmo-folder-prefix-internal
(wl-folder-get-elmo-folder string)))
(substring string 0 (match-beginning 0))
(entity (elmo-string (nth 4 tmp)))
(folder (wl-folder-get-elmo-folder entity)))
(when (elmo-folder-delete folder)
- (wl-fldmgr-cut tmp nil t)))))
+ (wl-folder-clear-entity-info entity)
+ (wl-fldmgr-cut tmp nil t)
+ (wl-fldmgr-save-access-list)))))
(defun wl-fldmgr-rename ()
(interactive)
(let ((inhibit-read-only t)
entity flist indent opened)
(when (and (wl-folder-buffer-group-p)
- (looking-at wl-folder-group-regexp))
+ (looking-at wl-folder-group-regexp)
+ (prog1
+ (y-or-n-p (format "Sort subfolders of %s? "
+ (wl-folder-get-entity-from-buffer)))
+ (message nil)))
(setq indent (wl-match-buffer 1))
(setq opened (wl-match-buffer 2))
(setq entity (wl-folder-search-group-entity-by-name
(save-excursion (forward-line -1)
(wl-highlight-folder-current-line))
(remove-text-properties beg (point) '(wl-folder-entity-id))
- (setq execed t))))))
+ (setq execed t))
+ (message "not an access group folder")))))
(set-buffer-modified-p nil)))
(if (or force execed)
(progn
(if (string= petname old-petname)
nil
(if (or (rassoc petname wl-folder-petname-alist)
- (wl-string-assoc petname wl-folder-group-alist))
+ (and is-group
+ (wl-string-assoc petname wl-folder-group-alist)))
(message "%s: already exists" petname)
(wl-folder-append-petname name petname)
(setq change t)))))
(defun wl-fldmgr-save-folders ()
(interactive)
(let ((tmp-buf (get-buffer-create " *wl-fldmgr-tmp*"))
- (access-list wl-fldmgr-modified-access-list)
- entity
save-petname-entities)
(message "Saving folders...")
(set-buffer tmp-buf)
'no-msg)
(set-file-modes wl-folders-file (+ (* 64 6) (* 8 0) 0))) ; chmod 0600
(kill-buffer tmp-buf)
+ (wl-fldmgr-save-access-list)
+ (setq wl-fldmgr-modified nil)
+ (message "Saving folders...done")))
+
+(defun wl-fldmgr-save-access-list ()
+ (let ((access-list wl-fldmgr-modified-access-list)
+ entity)
(while access-list
(setq entity (wl-folder-search-group-entity-by-name
(car access-list) wl-folder-entity))
(wl-folder-make-save-access-list (nth 2 entity))
(wl-folder-make-save-access-list (nth 3 entity))))
(setq access-list (cdr access-list)))
- (setq wl-fldmgr-modified nil)
- (setq wl-fldmgr-modified-access-list nil)
- (message "Saving folders...done")))
+ (setq wl-fldmgr-modified-access-list nil)))
(require 'product)
(product-provide (provide 'wl-fldmgr) (require 'wl-version))