From cc0e55691bdc3a7911158815eba9bd2ef8b73e93 Mon Sep 17 00:00:00 2001 From: hmurata Date: Fri, 11 Mar 2005 11:20:05 +0000 Subject: [PATCH] * 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'. * 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 | 9 ++++++++ elmo/elmo-flag.el | 28 +++++++++++++++---------- elmo/elmo.el | 1 + wl/ChangeLog | 8 +++++++ wl/wl-highlight.el | 59 ++++++++++++++++++++++++++++++++-------------------- wl/wl.el | 1 + 6 files changed, 73 insertions(+), 33 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 6bd339a..5f2ec52 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,12 @@ +2005-03-11 Hiroya Murata + + * 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 * elmo.el (message-number-changed): Define new signal. diff --git a/elmo/elmo-flag.el b/elmo/elmo-flag.el index abd65d3..cb2ebdc 100644 --- a/elmo/elmo-flag.el +++ b/elmo/elmo-flag.el @@ -132,17 +132,13 @@ (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)") diff --git a/elmo/elmo.el b/elmo/elmo.el index cd583f7..20dee3d 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -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")) diff --git a/wl/ChangeLog b/wl/ChangeLog index 67de5b0..6e9a023 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,11 @@ +2005-03-11 Hiroya Murata + + * 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 * wl-summary.el (wl-summary-sync-update): Use diff --git a/wl/wl-highlight.el b/wl/wl-highlight.el index fc3a4a9..6c3fac6 100644 --- a/wl/wl-highlight.el +++ b/wl/wl-highlight.el @@ -189,6 +189,20 @@ ;; 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) @@ -840,6 +854,11 @@ (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) @@ -856,30 +875,26 @@ (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) diff --git a/wl/wl.el b/wl/wl.el index 250b295..5c88565 100644 --- 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 -- 1.7.10.4