all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* org-toggle-checkbox bug
@ 2011-02-24 23:52 Matt Lundin
  2011-02-25  0:09 ` John Hendy
  2011-02-25  5:03 ` Nick Dokos
  0 siblings, 2 replies; 5+ messages in thread
From: Matt Lundin @ 2011-02-24 23:52 UTC (permalink / raw
  To: Org Mode

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.

Best,
Matt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-toggle-checkbox bug
  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
  1 sibling, 1 reply; 5+ messages in thread
From: John Hendy @ 2011-02-25  0:09 UTC (permalink / raw
  To: Matt Lundin; +Cc: Org Mode


[-- Attachment #1.1: Type: text/plain, Size: 1608 bytes --]

On Thu, Feb 24, 2011 at 5:52 PM, 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, [I get (shortened
> from your example)]:
>
> --8<---------------cut here---------------start------------->8---
> * Test
>  - [ ] Now
>  - [ ] Not now ---> [x]
>  - [ ] Later ---> [x]
>  - 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.
>
>
Odd; this is not the behavior I get. I just tried on a structure and got
this cycling:
,-----
| * top
| ** next
| *** next
| - [x] item 1  --> [ ]  --> [x]
| - [ ] item 2  --> [ ]  --> [x]
| - [ ] item 3  --> [ ]  --> [x]
| - [ ] item 4  --> [ ]  --> [x]
`-----

So... it seems to be working for me, though I was not sure based on the
docstring whether "taking as reference the first item in subtree" meant it
would toggle the rest to be like it or everything to be the opposite of it.
It appears it's the latter definition.

Maybe provide your version? I'm using 7.4.

Best,
> Matt
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

[-- Attachment #1.2: Type: text/html, Size: 2888 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-toggle-checkbox bug
  2011-02-25  0:09 ` John Hendy
@ 2011-02-25  0:26   ` Nick Dokos
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Dokos @ 2011-02-25  0:26 UTC (permalink / raw
  To: John Hendy; +Cc: Matt Lundin, Org Mode, nicholas.dokos

John Hendy <jw.hendy@gmail.com> wrote:

> On Thu, Feb 24, 2011 at 5:52 PM, 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, [I get (shortened from your example)]:
>    
>     --8<---------------cut here---------------start------------->8---
>     * Test
>      - [ ] Now
>      - [ ] Not now ---> [x]
>      - [ ] Later ---> [x]
>      - 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.
> 
> Odd; this is not the behavior I get. I just tried on a structure and got this cycling:
> ,-----
> | * top
> | ** next
> | *** next
> | - [x] item 1  --> [ ]  --> [x]  
> | - [ ] item 2  --> [ ]  --> [x]
> | - [ ] item 3  --> [ ]  --> [x]
> | - [ ] item 4  --> [ ]  --> [x]
> `-----
> 
> So... it seems to be working for me, though I was not sure based on the docstring whether "taking as reference the first item in subtree" meant it would toggle the rest to be like it or everything to be the opposite of it. It appears it's the latter definition.
> 
> Maybe provide your version? I'm using 7.4.
> 

Not working for me: I can reproduce the behavior that Matt reported.

Org-mode version 7.4 (release_7.4.529.gb23d.dirty)

Nick

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-toggle-checkbox bug
  2011-02-24 23:52 org-toggle-checkbox bug Matt Lundin
  2011-02-25  0:09 ` John Hendy
@ 2011-02-25  5:03 ` Nick Dokos
  2011-02-25 17:17   ` Nicolas
  1 sibling, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2011-02-25  5:03 UTC (permalink / raw
  To: Matt Lundin; +Cc: Nicolas Goaziou, nicholas.dokos, Org Mode

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: org-toggle-checkbox bug
  2011-02-25  5:03 ` Nick Dokos
@ 2011-02-25 17:17   ` Nicolas
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas @ 2011-02-25 17:17 UTC (permalink / raw
  To: nicholas.dokos; +Cc: Matt Lundin, Org Mode

Hello,

Patch applied. Thanks for catching this.

Regards,

-- 
Nicolas

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-25 17:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-02-25 17:17   ` Nicolas

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.