New face for items switched in agenda to DONE.

Items are listed in the agenda sometimes in bright colors, to draw
attention to important tasks or deadlines.  When such an item is
switched to DONE, the state change is reflected by the new TODO
keyword, but the line itself might still be bright.  Org de-emphasizes
the line by changing the face of the line.  It used to change it to
the face `org-done', but now we use a new, independent face
`org-agenda-done'.
This commit is contained in:
Carsten Dominik 2009-03-21 14:33:52 +01:00
parent 132dc95042
commit 7924dcb1bf
4 changed files with 35 additions and 9 deletions

View File

@ -1,5 +1,14 @@
2009-03-21 Carsten Dominik <carsten.dominik@gmail.com>
* org-agenda.el (org-agenda-export-html-style): Define color for
org-agenda-done face.
(org-search-view, org-agenda-get-todos, org-agenda-get-progress)
(org-agenda-get-deadlines, org-agenda-get-scheduled): Use new face.
* org.el (org-scan-tags): Use the new face.
* org-faces.el (org-agenda-done): New face.
* org.el (org-scan-tags): Test the value org
`org-tags-match-list-sublevels'.
(org-tags-match-list-sublevels): New allowed value: indented.

View File

@ -154,6 +154,9 @@ the fonts used by the agenda, here is an example:
color: #cc6666;
font-weight: bold;
}
.org-agenda-done {
color: #339933;
}
.org-done {
color: #339933;
}
@ -2857,7 +2860,7 @@ in `org-agenda-text-search-extra-files'."
(org-set-sorting-strategy 'search)
(org-prepare-agenda "SEARCH")
(let* ((props (list 'face nil
'done-face 'org-done
'done-face 'org-agenda-done
'org-not-done-regexp org-not-done-regexp
'org-todo-regexp org-todo-regexp
'org-complex-heading-regexp org-complex-heading-regexp
@ -3536,7 +3539,7 @@ the documentation of `org-diary'."
(defun org-agenda-get-todos ()
"Return the TODO information for agenda display."
(let* ((props (list 'face nil
'done-face 'org-done
'done-face 'org-agenda-done
'org-not-done-regexp org-not-done-regexp
'org-todo-regexp org-todo-regexp
'org-complex-heading-regexp org-complex-heading-regexp
@ -3814,10 +3817,10 @@ the documentation of `org-diary'."
(setq txt org-agenda-no-heading-message))
(setq priority 100000)
(org-add-props txt props
'org-marker marker 'org-hd-marker hdmarker 'face 'org-done
'org-marker marker 'org-hd-marker hdmarker 'face 'org-agenda-done
'priority priority 'org-category category
'type "closed" 'date date
'undone-face 'org-warning 'done-face 'org-done)
'undone-face 'org-warning 'done-face 'org-agenda-done)
(push txt ee))
(goto-char (point-at-eol))))
(nreverse ee)))
@ -3898,8 +3901,8 @@ the documentation of `org-diary'."
'todo-state todo-state
'type (if upcomingp "upcoming-deadline" "deadline")
'date (if upcomingp date d2)
'face (if donep 'org-done face)
'undone-face face 'done-face 'org-done)
'face (if donep 'org-agenda-done face)
'undone-face face 'done-face 'org-agenda-done)
(push txt ee))))))
(nreverse ee)))
@ -3917,7 +3920,7 @@ FRACTION is what fraction of the head-warning time has passed."
(let* ((props (list 'org-not-done-regexp org-not-done-regexp
'org-todo-regexp org-todo-regexp
'org-complex-heading-regexp org-complex-heading-regexp
'done-face 'org-done
'done-face 'org-agenda-done
'mouse-face 'highlight
'keymap org-agenda-keymap
'help-echo
@ -3981,7 +3984,7 @@ FRACTION is what fraction of the head-warning time has passed."
(t 'org-scheduled)))
(org-add-props txt props
'undone-face face
'face (if donep 'org-done face)
'face (if donep 'org-agenda-done face)
'org-marker (org-agenda-new-marker pos)
'org-hd-marker (org-agenda-new-marker pos1)
'type (if pastschedp "past-scheduled" "scheduled")

View File

@ -301,6 +301,20 @@ specific tags."
"Face used for todo keywords that indicate DONE items."
:group 'org-faces)
(defface org-agenda-done ;; originally copied from font-lock-type-face
(org-compatible-face nil
'((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
(((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
(((class color) (min-colors 8)) (:foreground "green"))
(t (:bold nil))))
"Face used in agenda, to indicate lines switched to DONE.
This face is used to de-emphasize items that where brightly colord in the
agenda because they were things to do, or overdue. The DONE state itself
is of course immediately visible, but for example a passed deadline is
\(by default) very bright read. This face could be simply the default face
of the frame, for example."
:group 'org-faces)
(defface org-headline-done ;; originally copied from font-lock-string-face
(org-compatible-face nil
'((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))

View File

@ -9891,7 +9891,7 @@ only lines with a TODO keyword are included in the output."
(org-re
"\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*$")))
(props (list 'face 'default
'done-face 'org-done
'done-face 'org-agenda-done
'undone-face 'default
'mouse-face 'highlight
'org-not-done-regexp org-not-done-regexp