diff lisp/org/org-list.el @ 101670:a15c11f894f1

2009-01-30 Carsten Dominik <carsten.dominik@gmail.com> * org-timer.el (org-timer): Provide the timer feature. * org.el (org-require-autoloaded-modules): Add a few more files to the list of autoloaded modules. * org-agenda.el (org-agenda-todo): Pass ARG to `org-todo'. * org-exp.el (org-export-remove-or-extract-drawers): Only remove drawers that are unprotected. (org-export-html-format-image): Make sure inlined LaTeX fragment images remain inlined. * org.el (org-toggle-ordered-property): New function. (org-mode-map): Add a key for `org-toggle-ordered-property'. (org-org-menu): Add menu entries for TODO dependencies. * org.el (org-default-properties): Add ORDERED to the default properties, to get completion support for it. * org-list.el (org-update-checkbox-count): Update more than one cookie. * org.el (org-update-parent-todo-statistics): Update more than one cookie.
author Carsten Dominik <dominik@science.uva.nl>
date Fri, 30 Jan 2009 08:32:49 +0000
parents 59ea090317cd
children 9bc864ce1de6
line wrap: on
line diff
--- a/lisp/org/org-list.el	Fri Jan 30 08:16:26 2009 +0000
+++ b/lisp/org/org-list.el	Fri Jan 30 08:32:49 2009 +0000
@@ -7,7 +7,7 @@
 ;;	   Bastien Guerry <bzg AT altern DOT org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.20c
+;; Version: 6.20g
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -253,7 +253,9 @@
 With prefix arg TOGGLE-PRESENCE, add or remove checkboxes.
 When there is an active region, toggle status or presence of the checkbox
 in the first line, and make every item in the region have the same
-status or precence, respectively."
+status or precence, respectively.
+If the cursor is in a headline, apply this to all checkbox items in the
+text below the heading."
   (interactive "P")
   (catch 'exit
     (let (beg end status first-present first-status)
@@ -286,7 +288,10 @@
       (save-excursion
 	(goto-char beg)
 	(setq first-present (org-at-item-checkbox-p)
-	      first-status (and first-present (equal (match-string 0) "[X]")))
+	      first-status
+	      (save-excursion
+		(and (re-search-forward "[ \t]\\(\\[[ X]\\]\\)" end t)
+		     (equal (match-string 1) "[X]"))))
 	(while (< (point) end)
 	  (if toggle-presence
 	      (cond
@@ -343,7 +348,7 @@
 	     end-cookie (match-end 1)
 	     cstat (+ cstat (if end-cookie 1 0))
 	     startsearch (point-at-eol)
-	     continue-from (point-at-bol)
+	     continue-from (match-beginning 0)
 	     is-percent (match-beginning 2)
 	     lim (cond
 		  ((org-on-heading-p) (outline-next-heading) (point))