From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: org-toggle-checkbox bug Date: Fri, 25 Feb 2011 00:03:50 -0500 Message-ID: <4325.1298610230@alphaville.dokosmarshall.org> References: <87lj15dm7h.fsf@fastmail.fm> Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=39619 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pspwl-0005SH-Jy for emacs-orgmode@gnu.org; Fri, 25 Feb 2011 00:10:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pspwk-0001fq-EY for emacs-orgmode@gnu.org; Fri, 25 Feb 2011 00:10:31 -0500 Received: from vms173019pub.verizon.net ([206.46.173.19]:46459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pspwk-0001fh-B8 for emacs-orgmode@gnu.org; Fri, 25 Feb 2011 00:10:30 -0500 Received: from alphaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173019.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LH500EAOQCZQHB0@vms173019.mailsrvcs.net> for emacs-orgmode@gnu.org; Thu, 24 Feb 2011 23:10:17 -0600 (CST) In-reply-to: Message from Matt Lundin of "Thu, 24 Feb 2011 18:52:50 EST." <87lj15dm7h.fsf@fastmail.fm> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matt Lundin Cc: Nicolas Goaziou , nicholas.dokos@hp.com, Org Mode Matt Lundin wrote: > According to the docstring of org-toggle-checkbox, the function can be > called on headlines: > > ,---- > | If the cursor is in a headline, apply this to all checkbox items > | in the text below the heading, taking as reference the first item > | in subtree, ignoring drawers. > `---- > > When I call org-toggle-checkbox on the following entry... > > --8<---------------cut here---------------start------------->8--- > * Test > - [ ] Now > - [ ] Not now > - [ ] Later > - Not yet > - Never > --8<---------------cut here---------------end--------------->8--- > > ...I get the following results... > > --8<---------------cut here---------------start------------->8--- > * Test > - [ ] Now > - [X] Not now > - [X] Later > - Not yet > - Never > --8<---------------cut here---------------end--------------->8--- > > Then if I call org-toggle-checkbox on the headline again, nothing > happens. The two boxes remain checked. > Try this patch: diff --git a/lisp/org-list.el b/lisp/org-list.el index f66c665..1449062 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2134,7 +2134,7 @@ in subtree, ignoring drawers." (bottom (copy-marker (org-list-get-bottom-point struct))) (items-to-toggle (org-remove-if (lambda (e) (or (< e lim-up) (> e lim-down))) - (mapcar 'car (cdr struct))))) + (mapcar 'car struct)))) (mapc (lambda (e) (org-list-set-checkbox e struct ;; if there is no box at item, leave as-is Nick