From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cecil Westerhof Subject: Fwd: API problem Date: Wed, 22 Jan 2014 21:24:32 +0100 Message-ID: References: <8738kgvthz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113a8a1aaa7a8604f094e965 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W64Li-0003jq-Rf for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 15:24:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W64Lh-0001CP-QB for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 15:24:34 -0500 Received: from mail-qc0-x22c.google.com ([2607:f8b0:400d:c01::22c]:50244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W64Lh-0001CG-GV for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 15:24:33 -0500 Received: by mail-qc0-f172.google.com with SMTP id c9so1246223qcz.3 for ; Wed, 22 Jan 2014 12:24:33 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --001a113a8a1aaa7a8604f094e965 Content-Type: text/plain; charset=ISO-8859-1 Did not go to the list. :'( ---------- Forwarded message ---------- From: Cecil Westerhof Date: 2014/1/22 Subject: Re: API problem To: Nicolas Goaziou 2014/1/22 Nicolas Goaziou > > 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. -- Cecil Westerhof --001a113a8a1aaa7a8604f094e965 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Did not go to the list. :'(

---------- Forwarded message ----------
From: Cecil Westerhof <cldwesterhof@gmail.com>
Date: 2014/1/22
Subject: Re: API problem
To: Nicolas Goaziou <n.goaziou@gmail.com>


<= div dir=3D"ltr">
2014/1/22 Nicolas Goaziou <n.goaziou@gmail.com>
> To solve a problem I have the following line in an org file:
> =A0 =A0 =A0 =A0 - [ ] B (org-list-set-checkbox (line-beginning-positio= n)
> (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 li= st,
> but executing org-list-set-checkbox does nothing. What am I doing
> wrong?

`org-list-set-checkbox' modifies the structure, i.e., the interna= l 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 ra= sa. ;-)

=A0
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.
=A0
So I = have to work out how to use org-list-wrte-struct.

--
Cecil Westerhof --001a113a8a1aaa7a8604f094e965--