diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 449dd4d896c..4a761beff12 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,30 @@
+2009-02-02 Carsten Dominik
+
+ * org.el (org-mode): Make dependence stuff work more reliably.
+ (org-update-parent-todo-statistics): Fix bug with updating
+ statistics cookie.
+ (org-yank-adjusted-subtrees, org-return-follows-link)
+ (org-use-fast-todo-selection, org-tags-column): New default
+ setting for variables.
+
+ * org-export-latex.el (org-export-latex-emphasis-alist): Use = and
+ ~ as verbatim delimiters, to avoid table bug.
+ (org-export-latex-classes): Remove the a4paper option from the
+ default styles.
+
+ * org-exp.el (org-export-html-format-image): New argument
+ PAR-OPEN, to fix XHTM validation bug.
+ (org-export-as-html): Pass par-open to
+ `org-export-html-format-image'.
+ (org-export-html-footnotes-section): Use a more consistent id for
+ footnotes.
+
+ * org-agenda.el (org-agenda-sorting-strategy)
+ (org-agenda-tags-column): New default setting for variables, based
+ on a poll what typical uses use.
+ (org-agenda-dim-blocked-tasks): Keep dimming blocked entries from
+ setting the blocked tag.
+
2009-01-31 Carsten Dominik
* org-agenda.el (org-agenda-dim-blocked-tasks): No tagging when
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 93b6310520b..6180264d073 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
@@ -781,9 +781,9 @@ a grid line."
:group 'org-agenda)
(defcustom org-agenda-sorting-strategy
- '((agenda time-up category-keep priority-down)
- (todo category-keep priority-down)
- (tags category-keep priority-down)
+ '((agenda time-up priority-down category-keep)
+ (todo priority-down category-keep)
+ (tags priority-down category-keep)
(search category-keep))
"Sorting structure for the agenda items of a single day.
This is a list of symbols which will be used in sequence to determine
@@ -1014,7 +1014,7 @@ When this is the symbol `prefix', only remove tags when
(defvaralias 'org-agenda-remove-tags-when-in-prefix
'org-agenda-remove-tags))
-(defcustom org-agenda-tags-column -80
+(defcustom org-agenda-tags-column (if (featurep 'xemacs) -79 -80)
"Shift tags in agenda items to this column.
If this number is positive, it specifies the column. If it is negative,
it means that the tags should be flushright to that column. For example,
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index 680d17102a9..a3ac5c88d43 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el
index 28c1df021ea..92988b5e60c 100644
--- a/lisp/org/org-attach.el
+++ b/lisp/org/org-attach.el
@@ -4,7 +4,7 @@
;; Author: John Wiegley
;; Keywords: org data task
-;; Version: 6.20h
+;; Version: 6.21b
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el
index 5a816d34c02..55200c2ab8c 100644
--- a/lisp/org/org-bbdb.el
+++ b/lisp/org/org-bbdb.el
@@ -7,7 +7,7 @@
;; Thomas Baumann
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el
index 7f63b839d0d..eb65e2a8803 100644
--- a/lisp/org/org-bibtex.el
+++ b/lisp/org/org-bibtex.el
@@ -5,7 +5,7 @@
;; Author: Bastien Guerry
;; Carsten Dominik
;; Keywords: org, wp, remember
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index e1decc08b99..0a0f8d0292a 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index e60fd8cd6b2..3171332e252 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index 09ee0ee230d..73d3e0c4a2b 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el
index 2094242325e..e302052a6ec 100644
--- a/lisp/org/org-exp.el
+++ b/lisp/org/org-exp.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
@@ -3625,7 +3625,7 @@ lang=\"%s\" xml:lang=\"%s\">
(org-file-image-p
path org-export-html-inline-image-extensions))
(setq rpl (org-export-html-format-image
- (concat type ":" path)))
+ (concat type ":" path) org-par-open))
(setq link (concat type ":" path))
(setq rpl (concat "
(or (eq t org-export-html-inline-images)
(and org-export-html-inline-images
(not descp))))
- (org-export-html-format-image thefile)
+ (progn
+ (message "image %s %s" thefile org-par-open)
+ (org-export-html-format-image thefile org-par-open))
(concat ""
(org-export-html-format-desc desc)
"")))
@@ -4019,7 +4021,7 @@ lang=\"%s\" xml:lang=\"%s\">
(org-html-do-expand s))
s))
-(defun org-export-html-format-image (src)
+(defun org-export-html-format-image (src par-open)
"Create image tag with source and attributes."
(save-match-data
(if (string-match "^ltxpng/" src)
@@ -4027,15 +4029,18 @@ lang=\"%s\" xml:lang=\"%s\">
(let* ((caption (org-find-text-property-in-string 'org-caption src))
(attr (org-find-text-property-in-string 'org-attributes src))
(label (org-find-text-property-in-string 'org-label src)))
- (format "
+ (format "%s
%s
-
"
+
%s"
+ (if org-par-open "
\n" "")
(if label (format "id=\"%s\" " label) "")
src
(if (string-match "\\" caption "") ""))))))
+ (if caption (concat "\n" caption "
") "")
+ (if org-par-open "\n" ""))))))
+
(defvar org-table-colgroup-info nil)
(defun org-format-table-ascii (lines)
diff --git a/lisp/org/org-export-latex.el b/lisp/org/org-export-latex.el
index 3306a1bb090..ab266aafd7f 100644
--- a/lisp/org/org-export-latex.el
+++ b/lisp/org/org-export-latex.el
@@ -4,7 +4,7 @@
;;
;; Emacs Lisp Archive Entry
;; Filename: org-export-latex.el
-;; Version: 6.20h
+;; Version: 6.21b
;; Author: Bastien Guerry
;; Maintainer: Bastien Guerry
;; Keywords: org, wp, tex
@@ -165,8 +165,8 @@ to represent the section title."
("/" "\\emph{%s}" nil)
("_" "\\underline{%s}" nil)
("+" "\\texttt{%s}" nil)
- ("=" "\\verb|%s|" nil)
- ("~" "\\verb|%s|" t))
+ ("=" "\\verb=%s=" nil)
+ ("~" "\\verb~%s~" t))
"Alist of LaTeX expressions to convert emphasis fontifiers.
Each element of the list is a list of three elements.
The first element is the character used as a marker for fontification.
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 64bc5590684..a539585d447 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el
index 89bc2ea64df..c2dbc4b0418 100644
--- a/lisp/org/org-footnote.el
+++ b/lisp/org/org-footnote.el
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el
index 61fa15cff01..9d97519e660 100644
--- a/lisp/org/org-gnus.el
+++ b/lisp/org/org-gnus.el
@@ -7,7 +7,7 @@
;; Tassilo Horn
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index 16ffe8cf7a4..fd17562ef5a 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-info.el b/lisp/org/org-info.el
index 32699314af5..1b6de745d49 100644
--- a/lisp/org/org-info.el
+++ b/lisp/org/org-info.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el
index 0d4fc4e9bdc..a5bb2bb270d 100644
--- a/lisp/org/org-irc.el
+++ b/lisp/org/org-irc.el
@@ -4,7 +4,7 @@
;;
;; Author: Philip Jackson
;; Keywords: erc, irc, link, org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-jsinfo.el b/lisp/org/org-jsinfo.el
index 748e54ca1dd..d72befda7e9 100644
--- a/lisp/org/org-jsinfo.el
+++ b/lisp/org/org-jsinfo.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el
index b3efae6a55d..4dd69564403 100644
--- a/lisp/org/org-list.el
+++ b/lisp/org/org-list.el
@@ -7,7 +7,7 @@
;; Bastien Guerry
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-mac-message.el b/lisp/org/org-mac-message.el
index 5e05899f32f..ae91be9148c 100644
--- a/lisp/org/org-mac-message.el
+++ b/lisp/org/org-mac-message.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
;; Author: John Wiegley
-;; Version: 6.20h
+;; Version: 6.21b
;; Keywords: outlines, hypermedia, calendar, wp
;; This file is part of GNU Emacs.
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index 1042a88f8f1..4990b83d0b8 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-mew.el b/lisp/org/org-mew.el
index 79a1279498e..75d087e01e9 100644
--- a/lisp/org/org-mew.el
+++ b/lisp/org/org-mew.el
@@ -5,7 +5,7 @@
;; Author: Tokuya Kameshima
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;; This file is part of GNU Emacs.
diff --git a/lisp/org/org-mhe.el b/lisp/org/org-mhe.el
index a654fb5767c..90e4468c728 100644
--- a/lisp/org/org-mhe.el
+++ b/lisp/org/org-mhe.el
@@ -6,7 +6,7 @@
;; Author: Thomas Baumann
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index 4927fff4284..798fddb0c59 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -4,7 +4,7 @@
;;
;; Author: Piotr Zielinski
;; Maintainer: Carsten Dominik
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el
index 5da3bcaaa17..c1704405505 100644
--- a/lisp/org/org-plot.el
+++ b/lisp/org/org-plot.el
@@ -5,7 +5,7 @@
;; Author: Eric Schulte
;; Keywords: tables, plotting
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el
index 2a70e1062cb..843608cb82f 100644
--- a/lisp/org/org-publish.el
+++ b/lisp/org/org-publish.el
@@ -4,7 +4,7 @@
;; Author: David O'Toole
;; Maintainer: Bastien Guerry
;; Keywords: hypermedia, outlines, wp
-;; Version: 6.20h
+;; Version: 6.21b
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el
index 13f746cdfba..2efc6a47957 100644
--- a/lisp/org/org-remember.el
+++ b/lisp/org/org-remember.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-rmail.el b/lisp/org/org-rmail.el
index e57114f4cb2..caff9cac096 100644
--- a/lisp/org/org-rmail.el
+++ b/lisp/org/org-rmail.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 20080aeca39..d561bb91bb4 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el
index c70563762d4..901693f6732 100644
--- a/lisp/org/org-timer.el
+++ b/lisp/org/org-timer.el
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-vm.el b/lisp/org/org-vm.el
index 74c42fc8f96..aec28c5f663 100644
--- a/lisp/org/org-vm.el
+++ b/lisp/org/org-vm.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-w3m.el b/lisp/org/org-w3m.el
index beded70fd91..a09d88e1536 100644
--- a/lisp/org/org-w3m.el
+++ b/lisp/org/org-w3m.el
@@ -5,7 +5,7 @@
;; Author: Andy Stewart
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org-wl.el b/lisp/org/org-wl.el
index 83b4ef54eb5..eb8936f34db 100644
--- a/lisp/org/org-wl.el
+++ b/lisp/org/org-wl.el
@@ -6,7 +6,7 @@
;; Author: Tokuya Kameshima
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
diff --git a/lisp/org/org.el b/lisp/org/org.el
index ff0451f3776..da33628e75a 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.20h
+;; Version: 6.21b
;;
;; This file is part of GNU Emacs.
;;
@@ -94,7 +94,7 @@
;;; Version
-(defconst org-version "6.20h"
+(defconst org-version "6.21b"
"The version number of the file org.el.")
(defun org-version (&optional here)
@@ -689,7 +689,7 @@ text after the yank would be swallowed into a folded tree by this action."
:group 'org-edit-structure
:type 'boolean)
-(defcustom org-yank-adjusted-subtrees t
+(defcustom org-yank-adjusted-subtrees nil
"Non-nil means, when yanking subtrees, adjust the level.
With this setting, `org-paste-subtree' is used to insert the subtree, see
this function for details."
@@ -1113,7 +1113,7 @@ Needs to be set before org.el is loaded."
:group 'org-link-follow
:type 'boolean)
-(defcustom org-return-follows-link nil
+(defcustom org-return-follows-link t
"Non-nil means, on links RET will follow the link.
Needs to be set before org.el is loaded."
:group 'org-link-follow
@@ -1565,7 +1565,7 @@ more information."
:type '(choice (const sequence)
(const type)))
-(defcustom org-use-fast-todo-selection 'prefix
+(defcustom org-use-fast-todo-selection t
"Non-nil means, use the fast todo selection scheme with C-c C-t.
This variable describes if and under what circumstances the cycling
mechanism for TODO keywords will be replaced by a single-key, direct
@@ -1636,8 +1636,9 @@ TODO state changes
"Non-nil means, undone TODO entries will block switching the parent to DONE.
Also, if a parent has an :ORDERED: property, switching an entry to DONE will
be blocked if any prior sibling is not yet done.
-You need to set this variable through the customize interface, or to
-restart emacs after changing the value."
+This variable needs to be set before org.el is loaded, and you need to
+restart Emacs after a change to make the change effective. The only way
+to change is while Emacs is running is through the customize interface."
:set (lambda (var val)
(set var val)
(if val
@@ -1653,8 +1654,9 @@ restart emacs after changing the value."
When this is nil, checkboxes have no influence on switching TODO states.
When non-nil, you first need to check off all check boxes before the TODO
entry can be switched to DONE.
-You need to set this variable through the customize interface, or to
-restart emacs after changing the value."
+This variable needs to be set before org.el is loaded, and you need to
+restart Emacs after a change to make the change effective. The only way
+to change is while Emacs is running is through the customize interface."
:set (lambda (var val)
(set var val)
(if val
@@ -2043,7 +2045,7 @@ displaying the tags menu is not even shown, until you press C-c again."
"Non-nil means, fast tags selection interface will also offer TODO states.
This is an undocumented feature, you should not rely on it.")
-(defcustom org-tags-column (if (featurep 'xemacs) -79 -80)
+(defcustom org-tags-column (if (featurep 'xemacs) -76 -77)
"The column to which tags should be indented in a headline.
If this number is positive, it specifies the column. If it is negative,
it means that the tags should be flushright to that column. For example,
@@ -3595,6 +3597,18 @@ The following commands are available:
(org-set-autofill-regexps)
(setq indent-line-function 'org-indent-line-function)
(org-update-radio-target-regexp)
+ ;; Make sure dependence stuff works reliably, even for users who set it
+ ;; too late :-(
+ (if org-enforce-todo-dependencies
+ (add-hook 'org-blocker-hook
+ 'org-block-todo-from-children-or-siblings)
+ (remove-hook 'org-blocker-hook
+ 'org-block-todo-from-children-or-siblings))
+ (if org-enforce-todo-checkbox-dependencies
+ (add-hook 'org-blocker-hook
+ 'org-block-todo-from-checkboxes)
+ (remove-hook 'org-blocker-hook
+ 'org-block-todo-from-checkboxes))
;; Comment characters
; (org-set-local 'comment-start "#") ;; FIXME: this breaks wrapping
@@ -8631,13 +8645,14 @@ changes because there are uncheckd boxes in this entry."
"Update any statistics cookie in the parent of the current headline."
(interactive)
(let ((box-re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)")
- level (cnt-all 0) (cnt-done 0) is-percent kwd)
+ level (cnt-all 0) (cnt-done 0) is-percent kwd cookie-present)
(catch 'exit
(save-excursion
(setq level (org-up-heading-safe))
(unless level
(throw 'exit nil))
(while (re-search-forward box-re (point-at-eol) t)
+ (setq cnt-all 0 cnt-done 0 cookie-present t)
(setq is-percent (match-end 2))
(save-match-data
(unless (outline-next-heading) (throw 'exit nil))
@@ -8653,8 +8668,9 @@ changes because there are uncheckd boxes in this entry."
(if is-percent
(format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all)))
(format "[%d/%d]" cnt-done cnt-all))))
- (run-hook-with-args 'org-after-todo-statistics-hook
- cnt-done (- cnt-all cnt-done))))))
+ (when cookie-present
+ (run-hook-with-args 'org-after-todo-statistics-hook
+ cnt-done (- cnt-all cnt-done)))))))
(defvar org-after-todo-statistics-hook nil
"Hook that is called after a TODO statistics cookie has been updated.