From: teranisi Date: Thu, 12 Feb 2004 14:53:01 +0000 (+0000) Subject: * wl-summary.el (wl-summary-mode-map): Revival of X-Git-Tag: wl-2_11_25~68 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=0bb5ce6ab4c0438356a70861133dee6e7b7b544c;p=elisp%2Fwanderlust.git * wl-summary.el (wl-summary-mode-map): Revival of wl-summary-mark-as-important related bindings; Bind 'F','tF','mF','rF','m&'. (wl-summary-mark-as-important-region): Revival. (wl-summary-target-mark-mark-as-important): Ditto. (wl-summary-target-mark-operation): New function. (wl-summary-target-mark-mark-as-answered): Use it. (wl-summary-decide-flag): Don't set Important as default. (wl-summary-mark-as-important-internal): Revival. (wl-summary-mark-as-important): Ditto. * wl-thread.el (wl-thread-mark-as-important): Ditto. * wl-highlight.el (wl-highlight-summary-line-face-spec): Use find-face instead of facep. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 67acd41..bf43cb3 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,21 @@ +2004-02-12 Yuuichi Teranishi + + * wl-summary.el (wl-summary-mode-map): Revival of + wl-summary-mark-as-important related bindings; + Bind 'F','tF','mF','rF','m&'. + (wl-summary-mark-as-important-region): Revival. + (wl-summary-target-mark-mark-as-important): Ditto. + (wl-summary-target-mark-operation): New function. + (wl-summary-target-mark-mark-as-answered): Use it. + (wl-summary-decide-flag): Don't set Important as default. + (wl-summary-mark-as-important-internal): Revival. + (wl-summary-mark-as-important): Ditto. + + * wl-thread.el (wl-thread-mark-as-important): Ditto. + + * wl-highlight.el (wl-highlight-summary-line-face-spec): Use find-face + instead of facep. + 2004-02-10 Yuuichi Teranishi * wl-dnd.el (wl-dnd-drop-func): Fix. diff --git a/wl/wl-highlight.el b/wl/wl-highlight.el index a191dcf..f03fe3b 100644 --- a/wl/wl-highlight.el +++ b/wl/wl-highlight.el @@ -839,7 +839,7 @@ (intern (format "wl-highlight-summary-%s-flag-face" (car (car fl))))) - (when (facep face) + (when (find-face face) (list face))) fl nil)) (setq fl (cdr fl))) @@ -849,7 +849,7 @@ (intern (format "wl-highlight-summary-%s-face" (car priorities)))) - (when (facep face) + (when (find-face face) (list face)))))) (setq priorities (cdr priorities))) result)) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index b815513..9dfb639 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -414,7 +414,8 @@ See also variable `wl-use-petname'." (define-key wl-summary-mode-map "E" 'wl-summary-reedit) (define-key wl-summary-mode-map "\eE" 'wl-summary-resend-bounced-mail) (define-key wl-summary-mode-map "f" 'wl-summary-forward) - (define-key wl-summary-mode-map "$" 'wl-summary-set-flags) + (define-key wl-summary-mode-map "$" 'wl-summary-mark-as-important) + (define-key wl-summary-mode-map "F" 'wl-summary-set-flags) (define-key wl-summary-mode-map "&" 'wl-summary-mark-as-answered) (define-key wl-summary-mode-map "@" 'wl-summary-edit-addresses) @@ -493,7 +494,8 @@ See also variable `wl-use-petname'." (define-key wl-summary-mode-map "t~" 'wl-thread-resend) (define-key wl-summary-mode-map "tu" 'wl-thread-unmark) (define-key wl-summary-mode-map "t!" 'wl-thread-mark-as-unread) - (define-key wl-summary-mode-map "t$" 'wl-thread-set-flags) + (define-key wl-summary-mode-map "t$" 'wl-thread-mark-as-important) + (define-key wl-summary-mode-map "tF" 'wl-thread-set-flags) (define-key wl-summary-mode-map "t&" 'wl-thread-mark-as-answered) (define-key wl-summary-mode-map "ty" 'wl-thread-save) (define-key wl-summary-mode-map "ts" 'wl-thread-set-parent) @@ -513,7 +515,9 @@ See also variable `wl-use-petname'." (define-key wl-summary-mode-map "my" 'wl-summary-target-mark-save) (define-key wl-summary-mode-map "mR" 'wl-summary-target-mark-mark-as-read) (define-key wl-summary-mode-map "m!" 'wl-summary-target-mark-mark-as-unread) - (define-key wl-summary-mode-map "m$" 'wl-summary-target-mark-set-flags) + (define-key wl-summary-mode-map "m&" 'wl-summary-target-mark-mark-as-answered) + (define-key wl-summary-mode-map "m$" 'wl-summary-target-mark-mark-as-important) + (define-key wl-summary-mode-map "mF" 'wl-summary-target-mark-set-flags) (define-key wl-summary-mode-map "mU" 'wl-summary-target-mark-uudecode) (define-key wl-summary-mode-map "ma" 'wl-summary-target-mark-all) (define-key wl-summary-mode-map "mt" 'wl-summary-target-mark-thread) @@ -538,7 +542,8 @@ See also variable `wl-use-petname'." (define-key wl-summary-mode-map "r~" 'wl-summary-resend-region) (define-key wl-summary-mode-map "ru" 'wl-summary-unmark-region) (define-key wl-summary-mode-map "r!" 'wl-summary-mark-as-unread-region) - (define-key wl-summary-mode-map "r$" 'wl-summary-set-flags-region) + (define-key wl-summary-mode-map "r$" 'wl-summary-mark-as-important-region) + (define-key wl-summary-mode-map "rF" 'wl-summary-set-flags-region) (define-key wl-summary-mode-map "r&" 'wl-summary-mark-as-answered-region) (define-key wl-summary-mode-map "ry" 'wl-summary-save-region) @@ -1626,6 +1631,35 @@ If ARG is non-nil, checking is omitted." (wl-summary-count-unread) (wl-summary-update-modeline)) +(defun wl-summary-mark-as-important-region (beg end) + (interactive "r") + (save-excursion + (save-restriction + (wl-summary-narrow-to-region beg end) + (goto-char (point-min)) + (let ((inverse (elmo-message-flagged-p wl-summary-buffer-elmo-folder + (wl-summary-message-number) + 'important))) + (if (eq wl-summary-buffer-view 'thread) + (while (not (eobp)) + (let* ((number (wl-summary-message-number)) + (entity (wl-thread-get-entity number)) + children) + (if (wl-thread-entity-get-opened entity) + ;; opened...mark line. + ;; Crossposts are not processed + (wl-summary-mark-as-important-internal inverse) + ;; closed + (wl-summary-mark-as-important-internal + inverse + (wl-thread-get-children-msgs number))) + (forward-line 1))) + (while (not (eobp)) + (wl-summary-mark-as-important-internal inverse) + (forward-line 1)))))) + (wl-summary-count-unread) + (wl-summary-update-modeline)) + (defun wl-summary-mark-as-read-all () (interactive) (if (or (not (interactive-p)) @@ -2909,6 +2943,27 @@ The mark is decided according to the FOLDER, FLAGS and CACHED." (dolist (number wl-summary-buffer-target-mark-list) (wl-summary-unset-mark number))))) +(defun wl-summary-target-mark-operation (flag) + (save-excursion + (goto-char (point-min)) + (let ((inhibit-read-only t) + (buffer-read-only nil) + wl-summary-buffer-disp-msg) + (funcall + (intern (format "wl-summary-mark-as-%s-internal" flag)) + nil + wl-summary-buffer-target-mark-list) + (dolist (number wl-summary-buffer-target-mark-list) + (wl-summary-unset-mark number))))) + +(defun wl-summary-target-mark-mark-as-important () + (interactive) + (wl-summary-target-mark-operation 'important)) + +(defun wl-summary-target-mark-mark-as-answered () + (interactive) + (wl-summary-target-mark-operation 'answered)) + (defun wl-summary-target-mark-set-flags () (interactive) (save-excursion @@ -3096,7 +3151,7 @@ Return non-nil if the mark is updated" elmo-global-flag-list) nil nil (mapconcat (lambda (flag) (capitalize (symbol-name flag))) - (or flags '(important)) + flags ","))))) (dolist (flag new-flags) (unless (memq flag elmo-global-flag-list) @@ -3200,6 +3255,24 @@ Return non-nil if the mark is updated" (error "Cannot process flags in this folder")) (wl-summary-set-flags-internal nil nil nil remove)) +(defun wl-summary-mark-as-important-internal (inverse + &optional number-or-numbers) + (if inverse + (wl-summary-remove-flags-internal number-or-numbers '(important)) + (wl-summary-add-flags-internal number-or-numbers '(important)))) + +(defun wl-summary-mark-as-important (&optional prompt) + (interactive "P") + (if (eq 'flag (elmo-folder-type-internal wl-summary-buffer-elmo-folder)) + (error "Cannot process flags in this folder")) + (if prompt + (wl-summary-set-flags-internal) + (wl-summary-mark-as-important-internal + (and (interactive-p) + (elmo-message-flagged-p wl-summary-buffer-elmo-folder + (wl-summary-message-number) + 'important))))) + ;;; Summary line. (defvar wl-summary-line-formatter nil) diff --git a/wl/wl-thread.el b/wl/wl-thread.el index a491ef5..56b761d 100644 --- a/wl/wl-thread.el +++ b/wl/wl-thread.el @@ -735,6 +735,10 @@ Message is inserted to the summary buffer." (interactive "P") (wl-thread-call-region-func 'wl-summary-mark-as-unread-region arg)) +(defun wl-thread-mark-as-important (&optional arg) + (interactive "P") + (wl-thread-call-region-func 'wl-summary-mark-as-important-region arg)) + (defun wl-thread-set-flags (&optional arg) (interactive "P") (wl-thread-call-region-func 'wl-summary-set-flags-region arg))