(elmo-flag-valid-p): Simplify.
authorhmurata <hmurata>
Tue, 1 Feb 2005 11:20:24 +0000 (11:20 +0000)
committerhmurata <hmurata>
Tue, 1 Feb 2005 11:20:24 +0000 (11:20 +0000)
(elmo-folder-list-subfolders): Copy `elmo-global-flags'.
(elmo-folder-delete): Update `elmo-global-flag-folder-alist'.

elmo/ChangeLog
elmo/elmo-flag.el

index b9102c0..f7fc547 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-01  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elmo-flag.el (elmo-flag-valid-p): Simplify.
+       (elmo-folder-list-subfolders): Copy `elmo-global-flags'.
+       (elmo-folder-delete): Update `elmo-global-flag-folder-alist'.
+
 2005-01-30  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * elmo-util.el (elmo-passwd-alist-load, elmo-passwd-alist-save):
index bd4f0f7..c3ae100 100644 (file)
   (defconst elmo-flag-char-regexp "]!#$&'+,./0-9:;<=>?@A-Z[^_`a-z|}~-"))
 
 (defun elmo-flag-valid-p (flag)
-  (unless (stringp flag)
-    (setq flag (symbol-name flag)))
   (string-match (eval-when-compile
                  (concat "^[" elmo-flag-char-regexp "]+$"))
-               flag))
+               (if (stringp flag) flag (symbol-name flag))))
 
 (eval-and-compile
   (luna-define-class elmo-flag-folder (elmo-localdir-folder)
            (elmo-uniq-list
             (append
              (mapcar 'intern (delete ".." (delete "." (directory-files dir))))
-             elmo-global-flags)))))
+             (copy-sequence elmo-global-flags))))))
 
 (defun elmo-flag-folder-delete-message (folder number
                                               &optional keep-referrer)
@@ -483,6 +481,9 @@ If optional IGNORE-PRESERVED is non-nil, preserved flags
   (let ((flag (elmo-flag-folder-flag-internal folder)))
     (when (luna-call-next-method)
       (setq elmo-global-flags (delq flag elmo-global-flags))
+      (setq elmo-global-flag-folder-alist
+           (delq (assq flag elmo-global-flag-folder-alist)
+                 elmo-global-flag-folder-alist))
       t)))
 
 (require 'product)