Mercurial > emacs
diff lisp/org/org-agenda.el @ 101607:59ea090317cd
2009-01-28 Carsten Dominik <carsten.dominik@gmail.com>
* org-agenda.el (org-agenda-get-todos): Start search from correct
position.
* org.el (org-fast-todo-selection): Make sure TODO selection does
not change buffer position.
* org-list.el (org-toggle-checkbox): Implement adding or removing
checkboxes from line or region when called with a prefix
argument.
* org-rmail.el (org-rmail-store-link): Protect the call to
`rmail-narrow-to-non-pruned-header'.
* org-clock.el (org-clock-special-range): Fix week display in
clock tables.
* org-exp.el (org-get-current-options): Fix bug when in indirect
buffer.
* org-agenda.el (org-agenda-dim-blocked-tasks): New option.
(org-finalize-agenda): Call `org-agenda-dim-blocked-tasks'.
(org-agenda-dim-blocked-tasks): New function.
* org.el (org-enforce-todo-dependencies): New option.
(org-block-todo-from-children-or-siblings): New function.
* org-faces.el (org-agenda-dimmed-todo-face): New face.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Wed, 28 Jan 2009 14:31:59 +0000 |
parents | f5aedb5cbd80 |
children | a15c11f894f1 |
line wrap: on
line diff
--- a/lisp/org/org-agenda.el Wed Jan 28 11:50:18 2009 +0000 +++ b/lisp/org/org-agenda.el Wed Jan 28 14:31:59 2009 +0000 @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik <carsten at orgmode dot org> ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.19e +;; Version: 6.20c ;; ;; This file is part of GNU Emacs. ;; @@ -513,6 +513,21 @@ :group 'org-agenda-daily/weekly :type 'boolean) +(defcustom org-agenda-dim-blocked-tasks t + "Non-nil means, dim blocked tasks in the agenda display. +This causes some overhead during agenda construction, but if you have turned +on `org-enforce-todo-dependencies' or any other blocking mechanism, this +will create useful feedback in the agenda. +Instead ot t, this variable can also have the value `invisible'. Then +blocked tasks will be invisible and only become visible when they +become unblocked." + :group 'org-agenda-daily/weekly + :group 'org-agenda-todo-list + :type '(choice + (const :tag "Do not dim" nil) + (const :tag "Dim to a grey face" t) + (const :tag "Make invisibe" invisible))) + (defcustom org-timeline-show-empty-dates 3 "Non-nil means, `org-timeline' also shows dates without an entry. When nil, only the days which actually have entries are shown. @@ -2132,6 +2147,8 @@ (org-agenda-columns)) (when org-agenda-fontify-priorities (org-fontify-priorities)) + (when (and org-agenda-dim-blocked-tasks org-blocker-hook) + (org-agenda-dim-blocked-tasks)) (run-hooks 'org-finalize-agenda-hook) (setq org-agenda-type (get-text-property (point) 'org-agenda-type)) ))) @@ -2162,6 +2179,36 @@ ((equal p h) 'bold))) (org-overlay-put ov 'org-type 'org-priority))))) +(defun org-agenda-dim-blocked-tasks () + "Dim currently blocked TODO's in the agenda display." + (mapc (lambda (o) (if (eq (org-overlay-get o 'org-type) 'org-blocked-todo) + (org-delete-overlay o))) + (org-overlays-in (point-min) (point-max))) + (save-excursion + (let ((inhibit-read-only t) + (invis (eq org-agenda-dim-blocked-tasks 'invisible)) + b e p ov h l) + (goto-char (point-min)) + (while (let ((pos (next-single-property-change (point) 'todo-state))) + (and pos (goto-char (1+ pos)))) + (let ((marker (get-text-property (point) 'org-hd-marker))) + (when (and marker + (not (with-current-buffer (marker-buffer marker) + (save-excursion + (goto-char marker) + (run-hook-with-args-until-failure + 'org-blocker-hook + (list :type 'todo-state-change + :position marker + :from 'todo + :to 'done)))))) + (setq b (if invis (max (point-min) (1- (point))) (point)) + e (point-at-eol) + ov (org-make-overlay b e)) + (if invis + (org-overlay-put ov 'invisible t) + (org-overlay-put ov 'face 'org-agenda-dimmed-todo-face)) + (org-overlay-put ov 'org-type 'org-blocked-todo))))))) (defvar org-agenda-skip-function nil "Function to be called at each match during agenda construction. @@ -3272,7 +3319,7 @@ (catch :skip (save-match-data (beginning-of-line) - (setq beg (point) end (progn (outline-next-heading) (point))) + (setq beg (point) end (save-excursion (outline-next-heading) (point))) (when (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item end) (goto-char (1+ beg)) (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible))