summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-12-31 18:20:30 +0100
committerBastien Guerry <bzg@altern.org>2012-01-03 09:19:46 +0100
commitc535c276feed8f54a8bd3ef2a581445150dbe5bb (patch)
tree749252ebf66ee7de5204010276550423338b8585
parentb77df8397d99a1f6616d4053814afb8ce8b6f17a (diff)
downloadorg-mode-c535c276feed8f54a8bd3ef2a581445150dbe5bb.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.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index af1c4a5..6598994 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18330,7 +18330,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
@@ -18367,7 +18367,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 "[ ]")))