diff options
author | Bastien Guerry <bzg@altern.org> | 2011-12-31 18:20:30 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-12-31 18:20:30 +0100 |
commit | 59bd41a907fafb12057e9c7577659d8b7efbc67d (patch) | |
tree | 984f2e6126bc1ae24d91f98fd203ff5b52e6436e | |
parent | 4752725b6441b678689d818315fe8494cf3eae5f (diff) | |
download | org-mode-59bd41a907fafb12057e9c7577659d8b7efbc67d.tar.gz |
More small fixes on `C-u C-c C-c' and checkboxes.
* org.el (org-ctrl-c-ctrl-c): Preserve symmetry when adding
and removing checkboxes with `C-u C-c C-c' on the first item
of a list. Also, don't reinitialize checkboxes that are
already ticked.
Thanks to Nicolas Goaziou for these fixes.
-rw-r--r-- | lisp/org.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index c0add60..64236f1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18395,7 +18395,7 @@ This command does many different things, depending on context: ((equal arg '(4)) nil) ((equal "[X]" cbox) "[ ]") (t "[X]")))) - (if firstp + (if (and firstp arg) ;; If at first item of sub-list, remove check-box from ;; every item at the same level. (mapc @@ -18432,7 +18432,9 @@ This command does many different things, depending on context: ;; If at first item of sub-list, add check-box to every ;; item at the same level. (mapc - (lambda (pos) (org-list-set-checkbox pos new-struct "[ ]")) + (lambda (pos) + (unless (org-list-get-checkbox pos new-struct) + (org-list-set-checkbox pos new-struct "[ ]"))) (org-list-get-all-items (point-at-bol) new-struct (org-list-prevs-alist new-struct))) (org-list-set-checkbox (point-at-bol) new-struct "[ ]"))) |