From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cecil Westerhof Subject: Re: API problem Date: Thu, 23 Jan 2014 00:52:26 +0100 Message-ID: References: <8738kgvthz.fsf@gmail.com> <87r47zvjgb.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c129ca2d399604f097d1ff Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W67au-0007xh-VT for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 18:52:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W67au-0007wd-12 for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 18:52:28 -0500 Received: from mail-qc0-x229.google.com ([2607:f8b0:400d:c01::229]:41720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W67at-0007w2-Pe for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 18:52:27 -0500 Received: by mail-qc0-f169.google.com with SMTP id w7so1589287qcr.0 for ; Wed, 22 Jan 2014 15:52:27 -0800 (PST) In-Reply-To: <87r47zvjgb.fsf@gmail.com> 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 --001a11c129ca2d399604f097d1ff Content-Type: text/plain; charset=ISO-8859-1 2014/1/22 Nicolas Goaziou > See `org-list-write-struct' docstring. Basically, STRUCT doesn't match > real structure anymore since step C. You need to provide the original > structure as a third argument so `org-list-write-struct' can modify > buffer by set difference. > > (let* ((struct (org-list-struct)) > (old (copy-tree struct))) > (org-list-set-checkbox (line-beginning-position) struct "[X]") > (org-list-write-struct struct (org-list-parents-alist struct) old)) > I implemented it. See my post: Check checkbox and move to end of list -- Cecil Westerhof --001a11c129ca2d399604f097d1ff Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2014= /1/22 Nicolas Goaziou <n.goaziou@gmail.com>
See `org-list-write-struct' docstring. Basically, STRUCT doesn't ma= tch
real structure anymore since step C. You need to provide the original
structure as a third argument so `org-list-write-struct' can modify
buffer by set difference.

=A0 (let* ((struct (org-list-struct))
=A0 =A0 =A0 =A0 =A0(old (copy-tree struct)))
=A0 =A0 (org-list-set-checkbox (line-beginning-position) struct "[X]&q= uot;)
=A0 =A0 (org-list-write-struct struct (org-list-parents-alist struct) old))=

I implemented it. See my post:
= =A0=A0=A0 Check checkbox and move to end of list

--
Cecil Westerhof
--001a11c129ca2d399604f097d1ff--