emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] org-toggle-checkbox bug


From: Nick Dokos
Subject: Re: [Orgmode] org-toggle-checkbox bug
Date: Fri, 25 Feb 2011 00:03:50 -0500

Matt Lundin <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]