diff options
author | Bastien Guerry <bzg@altern.org> | 2011-12-31 18:13:23 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-01-03 09:19:41 +0100 |
commit | b77df8397d99a1f6616d4053814afb8ce8b6f17a (patch) | |
tree | 86adbe74ca9a5705986e3bcf97700acdff77c081 | |
parent | a15cb0ad13c60019d575a7c75854e6e74cea00da (diff) | |
download | org-mode-b77df8397d99a1f6616d4053814afb8ce8b6f17a.tar.gz |
Revert "Fix problem with `org-ctrl-c-ctrl-c' on the checkbox of the first item."
This reverts commit 4789bb5a79f004346c37e3a84d12f90ada24d277.
-rw-r--r-- | lisp/org.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/org.el b/lisp/org.el index 14744e3..af1c4a5 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18325,12 +18325,19 @@ This command does many different things, depending on context: block-item) ;; Use a light version of `org-toggle-checkbox' to avoid ;; computing list structure twice. - (org-list-set-checkbox (point-at-bol) struct - (cond - ((equal arg '(16)) "[-]") - ((equal arg '(4)) nil) - ((equal "[X]" cbox) "[ ]") - (t "[X]"))) + (let ((new-box (cond + ((equal arg '(16)) "[-]") + ((equal arg '(4)) nil) + ((equal "[X]" cbox) "[ ]") + (t "[X]")))) + (if firstp + ;; If at first item of sub-list, remove check-box from + ;; every item at the same level. + (mapc + (lambda (pos) (org-list-set-checkbox pos struct new-box)) + (org-list-get-all-items + (point-at-bol) struct (org-list-prevs-alist struct))) + (org-list-set-checkbox (point-at-bol) struct new-box))) ;; Replicate `org-list-write-struct', while grabbing a return ;; value from `org-list-struct-fix-box'. (org-list-struct-fix-ind struct parents 2) |