* elmo-flag.el (elmo-folder-list-subfolders): Don't list from
authorhmurata <hmurata>
Fri, 11 Mar 2005 11:20:05 +0000 (11:20 +0000)
committerhmurata <hmurata>
Fri, 11 Mar 2005 11:20:05 +0000 (11:20 +0000)
subdirectories here.
(elmo-global-flags-initialize): New function.

* elmo.el (toplevel): Added autoload setting for
`elmo-global-flags-initialize'.

* wl.el (wl-init): Call `elmo-global-flags-initialize'.

* wl-highlight.el (wl-highlight-summary-flagged-face): New face.
(wl-highlight-get-face-by-name): New internal function.
(wl-highlight-summary-line-face-spec): Use it and fixed.

elmo/ChangeLog
elmo/elmo-flag.el
elmo/elmo.el
wl/ChangeLog
wl/wl-highlight.el
wl/wl.el

index 6bd339a..5f2ec52 100644 (file)
@@ -1,3 +1,12 @@
+2005-03-11  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elmo-flag.el (elmo-folder-list-subfolders): Don't list from
+       subdirectories here.
+       (elmo-global-flags-initialize): New function.
+
+       * elmo.el (toplevel): Added autoload setting for
+       `elmo-global-flags-initialize'.
+
 2005-03-07  Yoichi NAKAYAMA  <yoichi@geiin.org>
 
        * elmo.el (message-number-changed): Define new signal.
index abd65d3..cb2ebdc 100644 (file)
 
 (luna-define-method elmo-folder-list-subfolders ((folder elmo-flag-folder)
                                                 &optional one-level)
-  (let ((dir (expand-file-name "flag" elmo-msgdb-directory)))
-    (mapcar (lambda (flag)
-             (concat
-              (elmo-folder-prefix-internal folder)
-              (symbol-name (elmo-folder-type-internal folder))
-              "/"
-              (symbol-name flag)))
-           (elmo-uniq-list
-            (append
-             (mapcar 'intern (delete ".." (delete "." (directory-files dir))))
-             (copy-sequence elmo-global-flags))))))
+  (mapcar (lambda (flag)
+           (concat
+            (elmo-folder-prefix-internal folder)
+            (symbol-name (elmo-folder-type-internal folder))
+            "/"
+            (symbol-name flag)))
+         elmo-global-flags))
 
 (defun elmo-flag-folder-delete-message (folder number
                                               &optional keep-referrer)
@@ -445,6 +441,16 @@ If optional IGNORE-PRESERVED is non-nil, preserved flags
        (setq result (delq flag result))))
     result))
 
+(defun elmo-global-flags-initialize (&optional additional-flags)
+  (let ((dir (expand-file-name "flag" elmo-msgdb-directory)))
+    (setq elmo-global-flags
+         (elmo-uniq-list
+          (append
+           elmo-global-flags
+           additional-flags
+           (mapcar 'intern
+                   (delete ".." (delete "." (directory-files dir)))))))))
+
 ;;; To migrate from global mark folder
 (defvar elmo-global-mark-filename "global-mark"
   "Obsolete variable. (Just for migration)")
index cd583f7..20dee3d 100644 (file)
@@ -115,6 +115,7 @@ Otherwise, entire fetching of the message is aborted without confirmation."
   (autoload 'elmo-global-flag-detach-messages "elmo-flag")
   (autoload 'elmo-global-flag-set "elmo-flag")
   (autoload 'elmo-get-global-flags "elmo-flag")
+  (autoload 'elmo-global-flags-initialize "elmo-flag")
   (autoload 'elmo-global-mark-migrate "elmo-flag")
   (autoload 'elmo-folder-list-global-flag-messages "elmo-flag"))
 
index 67de5b0..6e9a023 100644 (file)
@@ -1,3 +1,11 @@
+2005-03-11  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * wl.el (wl-init): Call `elmo-global-flags-initialize'.
+
+       * wl-highlight.el (wl-highlight-summary-flagged-face): New face.
+       (wl-highlight-get-face-by-name): New internal function.
+       (wl-highlight-summary-line-face-spec): Use it and fixed.
+
 2005-03-10  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-summary.el (wl-summary-sync-update): Use
index fc3a4a9..6c3fac6 100644 (file)
 
 ;; important messages
 
+(wl-defface wl-highlight-summary-flagged-face
+  '((((type tty)
+      (background dark))
+     (:foreground "magenta"))
+    (((class color)
+      (background dark))
+     (:foreground "orange"))
+    (((class color)
+      (background light))
+     (:foreground "purple")))
+  "Face used for displaying flagged messages."
+  :group 'wl-summary-faces
+  :group 'wl-faces)
+
 (wl-defface wl-highlight-summary-new-face
   '(
     (((type tty)
              (put-text-property bol (match-end 0) 'face face)))
        (put-text-property bol eol 'face text-face)))))
 
+(defsubst wl-highlight-get-face-by-name (format &rest args)
+  (let ((face (intern (apply #'format format args))))
+    (and (find-face face)
+        face)))
+
 (defsubst wl-highlight-summary-line-face-spec (flags temp-mark indent)
   "Return a cons cell of (face . argument)."
   (let (action)
              (fl wl-summary-flag-alist)
              face result global-flags)
          (while (and (null result) priorities)
-           (if (and (eq (car priorities) 'flag)
-                    (setq global-flags
-                          (elmo-get-global-flags flags 'ignore-preserved)))
-               (while fl
-                 (when (memq (car (car fl)) global-flags)
-                   (setq result
-                         (progn
-                           (setq face
-                                 (intern (format
-                                          "wl-highlight-summary-%s-flag-face"
-                                          (car (car fl)))))
-                           (when (find-face face)
-                             (list face)))
-                         fl nil))
-                 (setq fl (cdr fl)))
+           (if (eq (car priorities) 'flag)
+               (when (setq global-flags
+                           (elmo-get-global-flags flags 'ignore-preserved))
+                 (while fl
+                   (when (memq (car (car fl)) global-flags)
+                     (setq result
+                           (list (or (wl-highlight-get-face-by-name
+                                      "wl-highlight-summary-%s-flag-face"
+                                      (car (car fl)))
+                                     'wl-highlight-summary-flagged-face))
+                           fl nil))
+                   (setq fl (cdr fl)))
+                 (unless result
+                   (setq result (list 'wl-highlight-summary-flagged-face))))
              (when (memq (car priorities) flags)
                (setq result
-                     (progn (setq face
-                                  (intern (format
-                                           "wl-highlight-summary-%s-face"
-                                           (car priorities))))
-                            (if (find-face face)
-                                (list face)
-                              (list 'wl-summary-persistent-mark-face))))))
+                     (list (or (wl-highlight-get-face-by-name
+                                "wl-highlight-summary-%s-face"
+                                (car priorities))
+                               'wl-summary-persistent-mark-face)))))
            (setq priorities (cdr priorities)))
          result))
        ((string= temp-mark wl-summary-score-below-mark)
index 250b295..5c88565 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
@@ -720,6 +720,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
        (nth 1 spec)))
     (setq elmo-no-from wl-summary-no-from-message)
     (setq elmo-no-subject wl-summary-no-subject-message)
+    (elmo-global-flags-initialize (mapcar 'car wl-summary-flag-alist))
     (elmo-connect-signal
      nil
      'message-number-changed