From ae5b0f5c440d15d079491f5f36776f0d236d624b Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 15 Feb 2009 10:00:44 +0100 Subject: [PATCH] Checkboxes: Make C-u C-c C-c C-c set the box to "[-]" Requested by Chris Randle. --- lisp/ChangeLog | 3 +++ lisp/org-list.el | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a3acc61a5..8d961ecce 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-02-15 Carsten Dominik + * org-list.el (org-toggle-checkbox): Make double prefix set the + checkbox to "[-]". + * org.el (org-add-log-setup): Fix positioning when `org-log-states-order-reversed' is nil. diff --git a/lisp/org-list.el b/lisp/org-list.el index a4fe37eba..0440644d6 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -251,6 +251,7 @@ Return t when things worked, nil when we are not in an item." (defun org-toggle-checkbox (&optional toggle-presence) "Toggle the checkbox in the current line. With prefix arg TOGGLE-PRESENCE, add or remove checkboxes. +With double prefix, set checkbox to [-]. 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 presence, respectively. @@ -266,13 +267,14 @@ text below the heading." (setq beg (point) end (save-excursion (outline-next-heading) (point)))) ((org-at-item-checkbox-p) (let ((pos (point))) - (if toggle-presence + (if (equal toggle-presence '(4)) (progn (replace-match "") (goto-char (match-beginning 0)) (just-one-space)) (replace-match - (cond ((member (match-string 0) '("[ ]" "[-]")) "[X]") + (cond ((equal toggle-presence '(16)) "[-]") + ((member (match-string 0) '("[ ]" "[-]")) "[X]") (t "[ ]")) t t)) (goto-char pos))