aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Dominik2009-01-28 14:33:23 +0000
committerCarsten Dominik2009-01-28 14:33:23 +0000
commitd6685abc9e7e9940fa4e9d683c4cc52826efc0f9 (patch)
tree63bf2ad01fd427453edd023a38b92f32de965a4d
parentf088b054762a1efde71f64690d0418811812dd59 (diff)
downloademacs-d6685abc9e7e9940fa4e9d683c4cc52826efc0f9.tar.gz
emacs-d6685abc9e7e9940fa4e9d683c4cc52826efc0f9.zip
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.
-rw-r--r--doc/misc/ChangeLog4
-rw-r--r--lisp/org/ChangeLog30
-rw-r--r--lisp/org/org-agenda.el51
-rw-r--r--lisp/org/org-archive.el2
-rw-r--r--lisp/org/org-attach.el2
-rw-r--r--lisp/org/org-bbdb.el2
-rw-r--r--lisp/org/org-bibtex.el2
-rw-r--r--lisp/org/org-clock.el3
-rw-r--r--lisp/org/org-colview.el2
-rw-r--r--lisp/org/org-compat.el2
-rw-r--r--lisp/org/org-exp.el7
-rw-r--r--lisp/org/org-export-latex.el2
-rw-r--r--lisp/org/org-faces.el17
-rw-r--r--lisp/org/org-footnote.el2
-rw-r--r--lisp/org/org-gnus.el2
-rw-r--r--lisp/org/org-id.el2
-rw-r--r--lisp/org/org-info.el2
-rw-r--r--lisp/org/org-irc.el2
-rw-r--r--lisp/org/org-jsinfo.el2
-rw-r--r--lisp/org/org-list.el57
-rw-r--r--lisp/org/org-mac-message.el2
-rw-r--r--lisp/org/org-macs.el2
-rw-r--r--lisp/org/org-mew.el2
-rw-r--r--lisp/org/org-mhe.el2
-rw-r--r--lisp/org/org-mouse.el2
-rw-r--r--lisp/org/org-plot.el2
-rw-r--r--lisp/org/org-publish.el2
-rw-r--r--lisp/org/org-remember.el2
-rw-r--r--lisp/org/org-rmail.el5
-rw-r--r--lisp/org/org-table.el2
-rw-r--r--lisp/org/org-timer.el2
-rw-r--r--lisp/org/org-vm.el2
-rw-r--r--lisp/org/org-w3m.el2
-rw-r--r--lisp/org/org-wl.el2
-rw-r--r--lisp/org/org.el214
35 files changed, 314 insertions, 126 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 81bd01e7664..0155df5acd2 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,7 @@
12009-01-28 Carsten Dominik <dominik@science.uva.nl>
2
3 * org.texi (TODO dependencies): New section.
4
12009-01-27 Carsten Dominik <dominik@science.uva.nl> 52009-01-27 Carsten Dominik <dominik@science.uva.nl>
2 6
3 * org.texi (Plain lists, TODO basics, Priorities) 7 * org.texi (Plain lists, TODO basics, Priorities)
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index f73d81b6801..d52c5a204b7 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,33 @@
12009-01-28 Carsten Dominik <carsten.dominik@gmail.com>
2
3 * org-agenda.el (org-agenda-get-todos): Start search from correct
4 position.
5
6 * org.el (org-fast-todo-selection): Make sure TODO selection does
7 not change buffer position.
8
9 * org-list.el (org-toggle-checkbox): Implement adding or removing
10 checkboxes from line or region when called with a prefix
11 argument.
12
13 * org-rmail.el (org-rmail-store-link): Protect the call to
14 `rmail-narrow-to-non-pruned-header'.
15
16 * org-clock.el (org-clock-special-range): Fix week display in
17 clock tables.
18
19 * org-exp.el (org-get-current-options): Fix bug when in indirect
20 buffer.
21
22 * org-agenda.el (org-agenda-dim-blocked-tasks): New option.
23 (org-finalize-agenda): Call `org-agenda-dim-blocked-tasks'.
24 (org-agenda-dim-blocked-tasks): New function.
25
26 * org.el (org-enforce-todo-dependencies): New option.
27 (org-block-todo-from-children-or-siblings): New function.
28
29 * org-faces.el (org-agenda-dimmed-todo-face): New face.
30
12009-01-27 Carsten Dominik <carsten.dominik@gmail.com> 312009-01-27 Carsten Dominik <carsten.dominik@gmail.com>
2 32
3 * org.el (org-todo): Return correct state type even if the blocker 33 * org.el (org-todo): Return correct state type even if the blocker
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 97d68d5aa9f..091366ebaab 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -513,6 +513,21 @@ deadlines are always turned off when the item is DONE."
513 :group 'org-agenda-daily/weekly 513 :group 'org-agenda-daily/weekly
514 :type 'boolean) 514 :type 'boolean)
515 515
516(defcustom org-agenda-dim-blocked-tasks t
517 "Non-nil means, dim blocked tasks in the agenda display.
518This causes some overhead during agenda construction, but if you have turned
519on `org-enforce-todo-dependencies' or any other blocking mechanism, this
520will create useful feedback in the agenda.
521Instead ot t, this variable can also have the value `invisible'. Then
522blocked tasks will be invisible and only become visible when they
523become unblocked."
524 :group 'org-agenda-daily/weekly
525 :group 'org-agenda-todo-list
526 :type '(choice
527 (const :tag "Do not dim" nil)
528 (const :tag "Dim to a grey face" t)
529 (const :tag "Make invisibe" invisible)))
530
516(defcustom org-timeline-show-empty-dates 3 531(defcustom org-timeline-show-empty-dates 3
517 "Non-nil means, `org-timeline' also shows dates without an entry. 532 "Non-nil means, `org-timeline' also shows dates without an entry.
518When nil, only the days which actually have entries are shown. 533When nil, only the days which actually have entries are shown.
@@ -2132,6 +2147,8 @@ VALUE defaults to t."
2132 (org-agenda-columns)) 2147 (org-agenda-columns))
2133 (when org-agenda-fontify-priorities 2148 (when org-agenda-fontify-priorities
2134 (org-fontify-priorities)) 2149 (org-fontify-priorities))
2150 (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
2151 (org-agenda-dim-blocked-tasks))
2135 (run-hooks 'org-finalize-agenda-hook) 2152 (run-hooks 'org-finalize-agenda-hook)
2136 (setq org-agenda-type (get-text-property (point) 'org-agenda-type)) 2153 (setq org-agenda-type (get-text-property (point) 'org-agenda-type))
2137 ))) 2154 )))
@@ -2162,6 +2179,36 @@ VALUE defaults to t."
2162 ((equal p h) 'bold))) 2179 ((equal p h) 'bold)))
2163 (org-overlay-put ov 'org-type 'org-priority))))) 2180 (org-overlay-put ov 'org-type 'org-priority)))))
2164 2181
2182(defun org-agenda-dim-blocked-tasks ()
2183 "Dim currently blocked TODO's in the agenda display."
2184 (mapc (lambda (o) (if (eq (org-overlay-get o 'org-type) 'org-blocked-todo)
2185 (org-delete-overlay o)))
2186 (org-overlays-in (point-min) (point-max)))
2187 (save-excursion
2188 (let ((inhibit-read-only t)
2189 (invis (eq org-agenda-dim-blocked-tasks 'invisible))
2190 b e p ov h l)
2191 (goto-char (point-min))
2192 (while (let ((pos (next-single-property-change (point) 'todo-state)))
2193 (and pos (goto-char (1+ pos))))
2194 (let ((marker (get-text-property (point) 'org-hd-marker)))
2195 (when (and marker
2196 (not (with-current-buffer (marker-buffer marker)
2197 (save-excursion
2198 (goto-char marker)
2199 (run-hook-with-args-until-failure
2200 'org-blocker-hook
2201 (list :type 'todo-state-change
2202 :position marker
2203 :from 'todo
2204 :to 'done))))))
2205 (setq b (if invis (max (point-min) (1- (point))) (point))
2206 e (point-at-eol)
2207 ov (org-make-overlay b e))
2208 (if invis
2209 (org-overlay-put ov 'invisible t)
2210 (org-overlay-put ov 'face 'org-agenda-dimmed-todo-face))
2211 (org-overlay-put ov 'org-type 'org-blocked-todo)))))))
2165 2212
2166(defvar org-agenda-skip-function nil 2213(defvar org-agenda-skip-function nil
2167 "Function to be called at each match during agenda construction. 2214 "Function to be called at each match during agenda construction.
@@ -3272,7 +3319,7 @@ the documentation of `org-diary'."
3272 (catch :skip 3319 (catch :skip
3273 (save-match-data 3320 (save-match-data
3274 (beginning-of-line) 3321 (beginning-of-line)
3275 (setq beg (point) end (progn (outline-next-heading) (point))) 3322 (setq beg (point) end (save-excursion (outline-next-heading) (point)))
3276 (when (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item end) 3323 (when (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item end)
3277 (goto-char (1+ beg)) 3324 (goto-char (1+ beg))
3278 (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible)) 3325 (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible))
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index 045a505e45f..ff4c0f65e5d 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el
index d68fe410c9b..3af6d645c5f 100644
--- a/lisp/org/org-attach.el
+++ b/lisp/org/org-attach.el
@@ -4,7 +4,7 @@
4 4
5;; Author: John Wiegley <johnw@newartisans.com> 5;; Author: John Wiegley <johnw@newartisans.com>
6;; Keywords: org data task 6;; Keywords: org data task
7;; Version: 6.19e 7;; Version: 6.20c
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el
index 5656ba5f5e7..f2f6d9cadd4 100644
--- a/lisp/org/org-bbdb.el
+++ b/lisp/org/org-bbdb.el
@@ -7,7 +7,7 @@
7;; Thomas Baumann <thomas dot baumann at ch dot tum dot de> 7;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
8;; Keywords: outlines, hypermedia, calendar, wp 8;; Keywords: outlines, hypermedia, calendar, wp
9;; Homepage: http://orgmode.org 9;; Homepage: http://orgmode.org
10;; Version: 6.19e 10;; Version: 6.20c
11;; 11;;
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
13;; 13;;
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el
index 968da0044a8..d5026b9cca8 100644
--- a/lisp/org/org-bibtex.el
+++ b/lisp/org/org-bibtex.el
@@ -5,7 +5,7 @@
5;; Author: Bastien Guerry <bzg at altern dot org> 5;; Author: Bastien Guerry <bzg at altern dot org>
6;; Carsten Dominik <carsten dot dominik at gmail dot com> 6;; Carsten Dominik <carsten dot dominik at gmail dot com>
7;; Keywords: org, wp, remember 7;; Keywords: org, wp, remember
8;; Version: 6.19e 8;; Version: 6.20c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 44118471625..b800285153a 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -724,6 +724,7 @@ the returned times will be formatted strings."
724 (setq date (calendar-gregorian-from-absolute 724 (setq date (calendar-gregorian-from-absolute
725 (calendar-absolute-from-iso (list w 1 y)))) 725 (calendar-absolute-from-iso (list w 1 y))))
726 (setq d (nth 1 date) month (car date) y (nth 2 date) 726 (setq d (nth 1 date) month (car date) y (nth 2 date)
727 dow 1
727 key 'week)) 728 key 'week))
728 ((string-match "^\\([0-9]+\\)-\\([0-9]\\{1,2\\}\\)-\\([0-9]\\{1,2\\}\\)$" skey) 729 ((string-match "^\\([0-9]+\\)-\\([0-9]\\{1,2\\}\\)-\\([0-9]\\{1,2\\}\\)$" skey)
729 (setq y (string-to-number (match-string 1 skey)) 730 (setq y (string-to-number (match-string 1 skey))
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index 3de6ec95844..64dcf2326ed 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index e9e750437b5..21445c835a2 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el
index 89cbd95d61b..3b2fbbe45d1 100644
--- a/lisp/org/org-exp.el
+++ b/lisp/org/org-exp.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -3031,7 +3031,10 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
3031 (mapconcat 'identity org-export-exclude-tags " ") 3031 (mapconcat 'identity org-export-exclude-tags " ")
3032 org-export-html-link-up 3032 org-export-html-link-up
3033 org-export-html-link-home 3033 org-export-html-link-home
3034 (file-name-nondirectory buffer-file-name) 3034 (or (ignore-errors
3035 (file-name-sans-extension
3036 (file-name-nondirectory (buffer-file-name (buffer-base-buffer)))))
3037 "NOFILENAME")
3035 "TODO FEEDBACK VERIFY DONE" 3038 "TODO FEEDBACK VERIFY DONE"
3036 "Me Jason Marie DONE" 3039 "Me Jason Marie DONE"
3037 org-highest-priority org-lowest-priority org-default-priority 3040 org-highest-priority org-lowest-priority org-default-priority
diff --git a/lisp/org/org-export-latex.el b/lisp/org/org-export-latex.el
index ce79337b4f6..945dee0a5f3 100644
--- a/lisp/org/org-export-latex.el
+++ b/lisp/org/org-export-latex.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Emacs Lisp Archive Entry 5;; Emacs Lisp Archive Entry
6;; Filename: org-export-latex.el 6;; Filename: org-export-latex.el
7;; Version: 6.19e 7;; Version: 6.20c
8;; Author: Bastien Guerry <bzg AT altern DOT org> 8;; Author: Bastien Guerry <bzg AT altern DOT org>
9;; Maintainer: Bastien Guerry <bzg AT altern DOT org> 9;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
10;; Keywords: org, wp, tex 10;; Keywords: org, wp, tex
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 2ba13d2e965..18b169bebf7 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -400,15 +400,15 @@ changes."
400(defface org-clock-overlay ;; copied from secondary-selection 400(defface org-clock-overlay ;; copied from secondary-selection
401 (org-compatible-face nil 401 (org-compatible-face nil
402 '((((class color) (min-colors 88) (background light)) 402 '((((class color) (min-colors 88) (background light))
403 :background "yellow1") 403 (:background "yellow1"))
404 (((class color) (min-colors 88) (background dark)) 404 (((class color) (min-colors 88) (background dark))
405 :background "SkyBlue4") 405 (:background "SkyBlue4"))
406 (((class color) (min-colors 16) (background light)) 406 (((class color) (min-colors 16) (background light))
407 :background "yellow") 407 (:background "yellow"))
408 (((class color) (min-colors 16) (background dark)) 408 (((class color) (min-colors 16) (background dark))
409 :background "SkyBlue4") 409 (:background "SkyBlue4"))
410 (((class color) (min-colors 8)) 410 (((class color) (min-colors 8))
411 :background "cyan" :foreground "black") 411 (:background "cyan" :foreground "black"))
412 (t (:inverse-video t)))) 412 (t (:inverse-video t))))
413 "Basic face for displaying the secondary selection." 413 "Basic face for displaying the secondary selection."
414 :group 'org-faces) 414 :group 'org-faces)
@@ -456,6 +456,11 @@ belong to the weekend.")
456 "Face for items scheduled for a certain day." 456 "Face for items scheduled for a certain day."
457 :group 'org-faces) 457 :group 'org-faces)
458 458
459(defface org-agenda-dimmed-todo-face
460 '((((background light)) (:foreground "grey50"))
461 (((background dark)) (:foreground "grey50")))
462 "Face used to dimm blocked tasks in the agenda."
463 :group 'org-faces)
459 464
460(defface org-scheduled-previously 465(defface org-scheduled-previously
461 (org-compatible-face nil 466 (org-compatible-face nil
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el
index 4372411c06d..94112d0f450 100644
--- a/lisp/org/org-footnote.el
+++ b/lisp/org/org-footnote.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.19e 8;; Version: 6.20c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el
index 393d47b25c9..ee5fcbcfb81 100644
--- a/lisp/org/org-gnus.el
+++ b/lisp/org/org-gnus.el
@@ -7,7 +7,7 @@
7;; Tassilo Horn <tassilo at member dot fsf dot org> 7;; Tassilo Horn <tassilo at member dot fsf dot org>
8;; Keywords: outlines, hypermedia, calendar, wp 8;; Keywords: outlines, hypermedia, calendar, wp
9;; Homepage: http://orgmode.org 9;; Homepage: http://orgmode.org
10;; Version: 6.19e 10;; Version: 6.20c
11;; 11;;
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
13;; 13;;
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index 659142b7191..b68241d7257 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.19e 8;; Version: 6.20c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-info.el b/lisp/org/org-info.el
index 388ae9d8212..223248f568a 100644
--- a/lisp/org/org-info.el
+++ b/lisp/org/org-info.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el
index ddf9e3bc635..d9ecf6524ce 100644
--- a/lisp/org/org-irc.el
+++ b/lisp/org/org-irc.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Author: Philip Jackson <emacs@shellarchive.co.uk> 5;; Author: Philip Jackson <emacs@shellarchive.co.uk>
6;; Keywords: erc, irc, link, org 6;; Keywords: erc, irc, link, org
7;; Version: 6.19e 7;; Version: 6.20c
8;; 8;;
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
diff --git a/lisp/org/org-jsinfo.el b/lisp/org/org-jsinfo.el
index d2b49a007d4..b74122b9cf9 100644
--- a/lisp/org/org-jsinfo.el
+++ b/lisp/org/org-jsinfo.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el
index 08140a34803..78f3552e9b3 100644
--- a/lisp/org/org-list.el
+++ b/lisp/org/org-list.el
@@ -7,7 +7,7 @@
7;; Bastien Guerry <bzg AT altern DOT org> 7;; Bastien Guerry <bzg AT altern DOT org>
8;; Keywords: outlines, hypermedia, calendar, wp 8;; Keywords: outlines, hypermedia, calendar, wp
9;; Homepage: http://orgmode.org 9;; Homepage: http://orgmode.org
10;; Version: 6.19e 10;; Version: 6.20c
11;; 11;;
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
13;; 13;;
@@ -248,11 +248,15 @@ Return t when things worked, nil when we are not in an item."
248 (skip-chars-forward " \t") 248 (skip-chars-forward " \t")
249 (looking-at "\\[[- X]\\]")))) 249 (looking-at "\\[[- X]\\]"))))
250 250
251(defun org-toggle-checkbox (&optional arg) 251(defun org-toggle-checkbox (&optional toggle-presence)
252 "Toggle the checkbox in the current line." 252 "Toggle the checkbox in the current line.
253With prefix arg TOGGLE-PRESENCE, add or remove checkboxes.
254When there is an active region, toggle status or presence of the checkbox
255in the first line, and make every item in the region have the same
256status or precence, respectively."
253 (interactive "P") 257 (interactive "P")
254 (catch 'exit 258 (catch 'exit
255 (let (beg end status (firstnew 'unknown)) 259 (let (beg end status first-present first-status)
256 (cond 260 (cond
257 ((org-region-active-p) 261 ((org-region-active-p)
258 (setq beg (region-beginning) end (region-end))) 262 (setq beg (region-beginning) end (region-end)))
@@ -260,23 +264,46 @@ Return t when things worked, nil when we are not in an item."
260 (setq beg (point) end (save-excursion (outline-next-heading) (point)))) 264 (setq beg (point) end (save-excursion (outline-next-heading) (point))))
261 ((org-at-item-checkbox-p) 265 ((org-at-item-checkbox-p)
262 (let ((pos (point))) 266 (let ((pos (point)))
263 (replace-match 267 (if toggle-presence
264 (cond (arg "[-]") 268 (progn
265 ((member (match-string 0) '("[ ]" "[-]")) "[X]") 269 (replace-match "")
266 (t "[ ]")) 270 (goto-char (match-beginning 0))
267 t t) 271 (just-one-space))
272 (replace-match
273 (cond ((member (match-string 0) '("[ ]" "[-]")) "[X]")
274 (t "[ ]"))
275 t t))
268 (goto-char pos)) 276 (goto-char pos))
269 (throw 'exit t)) 277 (throw 'exit t))
278 ((org-at-item-p)
279 ;; add a checkbox
280 (save-excursion
281 (goto-char (match-end 0))
282 (insert "[ ] "))
283 (throw 'exit t))
270 (t (error "Not at a checkbox or heading, and no active region"))) 284 (t (error "Not at a checkbox or heading, and no active region")))
285 (setq end (move-marker (make-marker) end))
271 (save-excursion 286 (save-excursion
272 (goto-char beg) 287 (goto-char beg)
288 (setq first-present (org-at-item-checkbox-p)
289 first-status (and first-present (equal (match-string 0) "[X]")))
273 (while (< (point) end) 290 (while (< (point) end)
274 (when (org-at-item-checkbox-p) 291 (if toggle-presence
275 (setq status (equal (match-string 0) "[X]")) 292 (cond
276 (when (eq firstnew 'unknown) 293 ((and first-present (org-at-item-checkbox-p))
277 (setq firstnew (not status))) 294 (save-excursion
278 (replace-match 295 (replace-match "")
279 (if (if arg (not status) firstnew) "[X]" "[ ]") t t)) 296 (goto-char (match-beginning 0))
297 (just-one-space)))
298 ((and (not first-present) (not (org-at-item-checkbox-p))
299 (org-at-item-p))
300 (save-excursion
301 (goto-char (match-end 0))
302 (insert "[ ] "))))
303 (when (org-at-item-checkbox-p)
304 (setq status (equal (match-string 0) "[X]"))
305 (replace-match
306 (if first-status "[ ]" "[X]") t t)))
280 (beginning-of-line 2))))) 307 (beginning-of-line 2)))))
281 (org-update-checkbox-count-maybe)) 308 (org-update-checkbox-count-maybe))
282 309
diff --git a/lisp/org/org-mac-message.el b/lisp/org/org-mac-message.el
index 3a94d2feafa..6d721261fec 100644
--- a/lisp/org/org-mac-message.el
+++ b/lisp/org/org-mac-message.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 2008, 2009 Free Software Foundation, Inc. 3;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Version: 6.19e 6;; Version: 6.20c
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index 70c9fc390a8..5f8c5cf07c8 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-mew.el b/lisp/org/org-mew.el
index afbbe9a88f1..99678a348ae 100644
--- a/lisp/org/org-mew.el
+++ b/lisp/org/org-mew.el
@@ -5,7 +5,7 @@
5;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> 5;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.19e 8;; Version: 6.20c
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
diff --git a/lisp/org/org-mhe.el b/lisp/org/org-mhe.el
index d8276f09e53..7333e146c7b 100644
--- a/lisp/org/org-mhe.el
+++ b/lisp/org/org-mhe.el
@@ -6,7 +6,7 @@
6;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de> 6;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index a0597fec6ee..2fef3c5aa89 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com> 5;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
6;; Maintainer: Carsten Dominik <carsten at orgmode dot org> 6;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
7;; Version: 6.19e 7;; Version: 6.20c
8;; 8;;
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el
index fadd3541d0a..9c0bb14e495 100644
--- a/lisp/org/org-plot.el
+++ b/lisp/org/org-plot.el
@@ -5,7 +5,7 @@
5;; Author: Eric Schulte <schulte dot eric at gmail dot com> 5;; Author: Eric Schulte <schulte dot eric at gmail dot com>
6;; Keywords: tables, plotting 6;; Keywords: tables, plotting
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.19e 8;; Version: 6.20c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el
index 1ad5ae6820b..d08a1ce5cc5 100644
--- a/lisp/org/org-publish.el
+++ b/lisp/org/org-publish.el
@@ -4,7 +4,7 @@
4;; Author: David O'Toole <dto@gnu.org> 4;; Author: David O'Toole <dto@gnu.org>
5;; Maintainer: Bastien Guerry <bzg AT altern DOT org> 5;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
6;; Keywords: hypermedia, outlines, wp 6;; Keywords: hypermedia, outlines, wp
7;; Version: 6.19e 7;; Version: 6.20c
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el
index 74a7ada51db..a16d3bdea0a 100644
--- a/lisp/org/org-remember.el
+++ b/lisp/org/org-remember.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-rmail.el b/lisp/org/org-rmail.el
index 895da636dec..e24815c99e8 100644
--- a/lisp/org/org-rmail.el
+++ b/lisp/org/org-rmail.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -52,7 +52,8 @@
52 (save-restriction 52 (save-restriction
53 (when (eq major-mode 'rmail-summary-mode) 53 (when (eq major-mode 'rmail-summary-mode)
54 (rmail-show-message rmail-current-message)) 54 (rmail-show-message rmail-current-message))
55 (rmail-narrow-to-non-pruned-header) 55 (when (fboundp 'rmail-narrow-to-non-pruned-header)
56 (rmail-narrow-to-non-pruned-header))
56 (let* ((folder buffer-file-name) 57 (let* ((folder buffer-file-name)
57 (message-id (mail-fetch-field "message-id")) 58 (message-id (mail-fetch-field "message-id"))
58 (from (mail-fetch-field "from")) 59 (from (mail-fetch-field "from"))
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 0c78685752c..0b369a73adf 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el
index 4c3584b4e7b..632fe6d8fd0 100644
--- a/lisp/org/org-timer.el
+++ b/lisp/org/org-timer.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.19e 8;; Version: 6.20c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-vm.el b/lisp/org/org-vm.el
index 2f12d6de07f..cd625248a95 100644
--- a/lisp/org/org-vm.el
+++ b/lisp/org/org-vm.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-w3m.el b/lisp/org/org-w3m.el
index 808199e4bba..f466fc34b32 100644
--- a/lisp/org/org-w3m.el
+++ b/lisp/org/org-w3m.el
@@ -5,7 +5,7 @@
5;; Author: Andy Stewart <lazycat dot manatee at gmail dot com> 5;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.19e 8;; Version: 6.20c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-wl.el b/lisp/org/org-wl.el
index 91d29ff0d9c..ffbfee42e3d 100644
--- a/lisp/org/org-wl.el
+++ b/lisp/org/org-wl.el
@@ -6,7 +6,7 @@
6;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> 6;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 5508b814f99..c99159c754f 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.19e 9;; Version: 6.20c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -94,7 +94,7 @@
94 94
95;;; Version 95;;; Version
96 96
97(defconst org-version "6.19e" 97(defconst org-version "6.20c"
98 "The version number of the file org.el.") 98 "The version number of the file org.el.")
99 99
100(defun org-version (&optional here) 100(defun org-version (&optional here)
@@ -1603,6 +1603,49 @@ Lisp variable `state'."
1603 :group 'org-todo 1603 :group 'org-todo
1604 :type 'hook) 1604 :type 'hook)
1605 1605
1606(defvar org-blocker-hook nil
1607 "Hook for functions that are allowed to block a state change.
1608
1609Each function gets as its single argument a property list, see
1610`org-trigger-hook' for more information about this list.
1611
1612If any of the functions in this hook returns nil, the state change
1613is blocked.")
1614
1615(defvar org-trigger-hook nil
1616 "Hook for functions that are triggered by a state change.
1617
1618Each function gets as its single argument a property list with at least
1619the following elements:
1620
1621 (:type type-of-change :position pos-at-entry-start
1622 :from old-state :to new-state)
1623
1624Depending on the type, more properties may be present.
1625
1626This mechanism is currently implemented for:
1627
1628TODO state changes
1629------------------
1630:type todo-state-change
1631:from previous state (keyword as a string), or nil, or a symbol
1632 'todo' or 'done', to indicate the general type of state.
1633:to new state, like in :from")
1634
1635(defcustom org-enforce-todo-dependencies nil
1636 "Non-nil means, undone TODO entries will block switching the parent to DONE.
1637Also, if a parent has an :ORDERED: property, switching an entry to DONE will
1638be blocked if any prior sibling is not yet done.
1639You need to set this variable through the customize interface, or to
1640restart emacs after changing the value."
1641 :set (lambda (var val)
1642 (set var val)
1643 (if val
1644 (add-hook 'org-blocker-hook 'org-block-todo-from-children-or-siblings)
1645 (remove-hook 'org-blocker-hook 'org-block-todo-from-children-or-siblings)))
1646 :group 'org-todo
1647 :type 'boolean)
1648
1606(defcustom org-todo-state-tags-triggers nil 1649(defcustom org-todo-state-tags-triggers nil
1607 "Tag changes that should be triggered by TODO state changes. 1650 "Tag changes that should be triggered by TODO state changes.
1608This is a list. Each entry is 1651This is a list. Each entry is
@@ -8272,34 +8315,6 @@ this is nil.")
8272 (push (nth 2 e) rtn))) 8315 (push (nth 2 e) rtn)))
8273 rtn))))) 8316 rtn)))))
8274 8317
8275(defvar org-blocker-hook nil
8276 "Hook for functions that are allowed to block a state change.
8277
8278Each function gets as its single argument a property list, see
8279`org-trigger-hook' for more information about this list.
8280
8281If any of the functions in this hook returns nil, the state change
8282is blocked.")
8283
8284(defvar org-trigger-hook nil
8285 "Hook for functions that are triggered by a state change.
8286
8287Each function gets as its single argument a property list with at least
8288the following elements:
8289
8290 (:type type-of-change :position pos-at-entry-start
8291 :from old-state :to new-state)
8292
8293Depending on the type, more properties may be present.
8294
8295This mechanism is currently implemented for:
8296
8297TODO state changes
8298------------------
8299:type todo-state-change
8300:from previous state (keyword as a string), or nil
8301:to new state (keyword as a string), or nil")
8302
8303(defvar org-agenda-headline-snapshot-before-repeat) 8318(defvar org-agenda-headline-snapshot-before-repeat)
8304(defun org-todo (&optional arg) 8319(defun org-todo (&optional arg)
8305 "Change the TODO state of an item. 8320 "Change the TODO state of an item.
@@ -8492,6 +8507,60 @@ For calling through lisp, arg is also interpreted in the following way:
8492 (save-excursion 8507 (save-excursion
8493 (run-hook-with-args 'org-trigger-hook change-plist))))))) 8508 (run-hook-with-args 'org-trigger-hook change-plist)))))))
8494 8509
8510(defun org-block-todo-from-children-or-siblings (change-plist)
8511 "Block turning an entry into a TODO, using the hierarchy.
8512This checks whether the current task should be blocked from state
8513changes. Such blocking occurs when:
8514
8515 1. The task has children which are not all in a completed state.
8516
8517 2. A task has a parent with the property :ORDERED:, and there
8518 are siblings prior to the current task with incomplete
8519 status."
8520 (catch 'dont-block
8521 ;; If this is not a todo state change, or if this entry is already DONE,
8522 ;; do not block
8523 (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))
8524 (member (plist-get change-plist :from)
8525 (cons 'done org-done-keywords)))
8526 (throw 'dont-block t))
8527 ;; If this task has children, and any are undone, it's blocked
8528 (save-excursion
8529 (org-back-to-heading t)
8530 (let ((this-level (funcall outline-level)))
8531 (outline-next-heading)
8532 (let ((child-level (funcall outline-level)))
8533 (while (and (not (eobp))
8534 (> child-level this-level))
8535 ;; this todo has children, check whether they are all
8536 ;; completed
8537 (if (and (not (org-entry-is-done-p))
8538 (org-entry-is-todo-p))
8539 (throw 'dont-block nil))
8540 (outline-next-heading)
8541 (setq child-level (funcall outline-level))))))
8542 ;; Otherwise, if the task's parent has the :ORDERED: property, and
8543 ;; any previous siblings are undone, it's blocked
8544 (save-excursion
8545 (org-back-to-heading t)
8546 (when (save-excursion
8547 (ignore-errors
8548 (outline-up-heading 1)
8549 (org-entry-get (point) "ORDERED")))
8550 (let* ((this-level (funcall outline-level))
8551 (current-level this-level))
8552 (while (and (not (bobp))
8553 (= current-level this-level))
8554 (outline-previous-heading)
8555 (setq current-level (funcall outline-level))
8556 (if (= current-level this-level)
8557 ;; this todo has children, check whether they are all
8558 ;; completed
8559 (if (and (not (org-entry-is-done-p))
8560 (org-entry-is-todo-p))
8561 (throw 'dont-block nil)))))))
8562 t)) ; don't block
8563
8495(defun org-update-parent-todo-statistics () 8564(defun org-update-parent-todo-statistics ()
8496 "Update any statistics cookie in the parent of the current headline." 8565 "Update any statistics cookie in the parent of the current headline."
8497 (interactive) 8566 (interactive)
@@ -8599,49 +8668,50 @@ Returns the new TODO keyword, or nil if no state change should occur."
8599 (ncol (/ (- (window-width) 4) fwidth)) 8668 (ncol (/ (- (window-width) 4) fwidth))
8600 tg cnt e c tbl 8669 tg cnt e c tbl
8601 groups ingroup) 8670 groups ingroup)
8602 (save-window-excursion 8671 (save-excursion
8603 (if expert 8672 (save-window-excursion
8604 (set-buffer (get-buffer-create " *Org todo*")) 8673 (if expert
8605 (org-switch-to-buffer-other-window (get-buffer-create " *Org todo*"))) 8674 (set-buffer (get-buffer-create " *Org todo*"))
8606 (erase-buffer) 8675 (org-switch-to-buffer-other-window (get-buffer-create " *Org todo*")))
8607 (org-set-local 'org-done-keywords done-keywords) 8676 (erase-buffer)
8608 (setq tbl fulltable cnt 0) 8677 (org-set-local 'org-done-keywords done-keywords)
8609 (while (setq e (pop tbl)) 8678 (setq tbl fulltable cnt 0)
8679 (while (setq e (pop tbl))
8680 (cond
8681 ((equal e '(:startgroup))
8682 (push '() groups) (setq ingroup t)
8683 (when (not (= cnt 0))
8684 (setq cnt 0)
8685 (insert "\n"))
8686 (insert "{ "))
8687 ((equal e '(:endgroup))
8688 (setq ingroup nil cnt 0)
8689 (insert "}\n"))
8690 (t
8691 (setq tg (car e) c (cdr e))
8692 (if ingroup (push tg (car groups)))
8693 (setq tg (org-add-props tg nil 'face
8694 (org-get-todo-face tg)))
8695 (if (and (= cnt 0) (not ingroup)) (insert " "))
8696 (insert "[" c "] " tg (make-string
8697 (- fwidth 4 (length tg)) ?\ ))
8698 (when (= (setq cnt (1+ cnt)) ncol)
8699 (insert "\n")
8700 (if ingroup (insert " "))
8701 (setq cnt 0)))))
8702 (insert "\n")
8703 (goto-char (point-min))
8704 (if (not expert) (org-fit-window-to-buffer))
8705 (message "[a-z..]:Set [SPC]:clear")
8706 (setq c (let ((inhibit-quit t)) (read-char-exclusive)))
8610 (cond 8707 (cond
8611 ((equal e '(:startgroup)) 8708 ((or (= c ?\C-g)
8612 (push '() groups) (setq ingroup t) 8709 (and (= c ?q) (not (rassoc c fulltable))))
8613 (when (not (= cnt 0)) 8710 (setq quit-flag t))
8614 (setq cnt 0) 8711 ((= c ?\ ) nil)
8615 (insert "\n")) 8712 ((setq e (rassoc c fulltable) tg (car e))
8616 (insert "{ ")) 8713 tg)
8617 ((equal e '(:endgroup)) 8714 (t (setq quit-flag t)))))))
8618 (setq ingroup nil cnt 0)
8619 (insert "}\n"))
8620 (t
8621 (setq tg (car e) c (cdr e))
8622 (if ingroup (push tg (car groups)))
8623 (setq tg (org-add-props tg nil 'face
8624 (org-get-todo-face tg)))
8625 (if (and (= cnt 0) (not ingroup)) (insert " "))
8626 (insert "[" c "] " tg (make-string
8627 (- fwidth 4 (length tg)) ?\ ))
8628 (when (= (setq cnt (1+ cnt)) ncol)
8629 (insert "\n")
8630 (if ingroup (insert " "))
8631 (setq cnt 0)))))
8632 (insert "\n")
8633 (goto-char (point-min))
8634 (if (not expert) (org-fit-window-to-buffer))
8635 (message "[a-z..]:Set [SPC]:clear")
8636 (setq c (let ((inhibit-quit t)) (read-char-exclusive)))
8637 (cond
8638 ((or (= c ?\C-g)
8639 (and (= c ?q) (not (rassoc c fulltable))))
8640 (setq quit-flag t))
8641 ((= c ?\ ) nil)
8642 ((setq e (rassoc c fulltable) tg (car e))
8643 tg)
8644 (t (setq quit-flag t))))))
8645 8715
8646(defun org-entry-is-todo-p () 8716(defun org-entry-is-todo-p ()
8647 (member (org-get-todo-state) org-not-done-keywords)) 8717 (member (org-get-todo-state) org-not-done-keywords))