summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2010-07-28 16:51:28 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2010-09-01 19:05:51 +0200
commita73ce76fe378f07cee27a05a5f7a51977d7b0500 (patch)
treea32985719f73d20a58171abbb1411418750a78bd
parent4d40259e56928853330c3adeb2bb19f0dcc91320 (diff)
downloadorg-mode-a73ce76fe378f07cee27a05a5f7a51977d7b0500.tar.gz
Checkbox rule forbids inserting checkboxes in description item
-rw-r--r--lisp/org-list.el16
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el
index c0799d3..95051e4 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -173,15 +173,18 @@ precedence over it."
By default, automatic actions are taken when using
\\[org-shiftmetaup], \\[org-shiftmetadown], \\[org-meta-return],
\\[org-metaright], \\[org-metaleft], \\[org-shiftmetaright],
-\\[org-shiftmetaleft], \\[org-ctrl-c-minus] or
-\\[org-insert-todo-heading]. You can disable individually these
-rules by setting sets to nil. Valid sets are:
+\\[org-shiftmetaleft], \\[org-ctrl-c-minus],
+\\[org-toggle-checkbox] or \\[org-insert-todo-heading]. You can
+disable individually these rules by setting them to nil. Valid
+rules are:
bullet when non-nil, cycling bullet do not allow lists at
column 0 to have * as a bullet and descriptions lists
to be numbered.
checkbox when non-nil, checkbox statistics is updated each time
you either insert a new checkbox or toggle a checkbox.
+ It also prevents from inserting a checkbox in a
+ description item.
indent when non-nil indenting or outdenting list top-item will
move the whole list, indenting the first item of a
sub-list will be forbidden and outdenting a list whose
@@ -734,8 +737,13 @@ invisible."
(and (org-beginning-of-item)
(org-at-item-description-p)))
(concat (read-string "Term: ") " :: "))))
+ ;; Don't insert a checkbox if checkbox rule is applied and it
+ ;; is a description item.
(org-list-insert-item-generic
- (point) (and checkbox (not desc-text)) desc-text)))))
+ (point) (and checkbox
+ (or (not desc-text)
+ (not (cdr (assq 'checkbox org-list-automatic-rules)))))
+ desc-text)))))
;;; Indentation