2014/1/22 Cecil Westerhof <cldwester...@gmail.com>

> 2014/1/22 Nicolas Goaziou <n.goaz...@gmail.com>
>
>> > To solve a problem I have the following line in an org file:
>> >         - [ ] B (org-list-set-checkbox (line-beginning-position)
>> > (org-list-struct) "[X]") ITEM STRUCT CHECKBOX (org-list-send-item
>> > (line-beginning-position) 'end (org-list-struct)) ITEM DEST STRUCT
>> >
>> > Executing the org-list-send-item brings the entry to the end of the
>> list,
>> > but executing org-list-set-checkbox does nothing. What am I doing
>> > wrong?
>>
>> `org-list-set-checkbox' modifies the structure, i.e., the internal list
>> representation. It doesn't modify the buffer. You would have to apply
>> the new structure to the buffer with `org-list-write-struct'.
>>
>
> Just started today to want to do some thing, so I am a tabula rasa. ;-)
>
>
>
>> Anyway, it's much simpler to use `org-toggle-checkbox'.
>>
>
> That goes wrong when there is a marked region. I only want to set the
> current checkbox.
>
> So I have to work out how to use org-list-wrte-struct.
>

I have an org-file wth the folowing:
- [ ] A (setq struct (org-list-struct))
- [-] B (org-list-get-checkbox 41 struct)
- [ ] C (org-list-set-checkbox 41 struct "[X]")
- [ ] D (org-list-get-checkbox 41 struct)
- [ ] E (org-list-write-struct struct (org-list-parents-alist struct))

In A I fill the struct.
B displays "[-]"
C displays "[X]"
D displays "[X]", so the struct is correctly updated.
E gives: #<marker in no buffer>

What is going wrong here?


-- 
Cecil Westerhof

Reply via email to