emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Matt Lundin <mdl@imapmail.org>
Cc: Nicolas Goaziou <n.goaziou@gmail.com>,
	nicholas.dokos@hp.com, Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org-toggle-checkbox bug
Date: Fri, 25 Feb 2011 00:03:50 -0500	[thread overview]
Message-ID: <4325.1298610230@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Matt Lundin <mdl@imapmail.org> of "Thu, 24 Feb 2011 18:52:50 EST." <87lj15dm7h.fsf@fastmail.fm>

Matt Lundin <mdl@imapmail.org> 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

  parent reply	other threads:[~2011-02-25  5:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24 23:52 org-toggle-checkbox bug Matt Lundin
2011-02-25  0:09 ` John Hendy
2011-02-25  0:26   ` Nick Dokos
2011-02-25  5:03 ` Nick Dokos [this message]
2011-02-25 17:17   ` Nicolas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4325.1298610230@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mdl@imapmail.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).