From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: getting todo-keywords from org-element-property Date: Sat, 18 Jul 2015 16:04:26 -0400 Message-ID: References: <87a8ututi1.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec5486072b8b9c0051b2bcfb5 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGYLT-00035v-Q0 for emacs-orgmode@gnu.org; Sat, 18 Jul 2015 16:04:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGYLS-0000HZ-Iq for emacs-orgmode@gnu.org; Sat, 18 Jul 2015 16:04:27 -0400 Received: from mail-vn0-x22e.google.com ([2607:f8b0:400c:c0f::22e]:35780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGYLS-0000HV-Em for emacs-orgmode@gnu.org; Sat, 18 Jul 2015 16:04:26 -0400 Received: by vnaa140 with SMTP id a140so11475430vna.2 for ; Sat, 18 Jul 2015 13:04:26 -0700 (PDT) In-Reply-To: <87a8ututi1.fsf@nicolasgoaziou.fr> 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: Matt Price , Org Mode --bcaec5486072b8b9c0051b2bcfb5 Content-Type: text/plain; charset=UTF-8 On Sat, Jul 18, 2015 at 3:59 PM, Nicolas Goaziou wrote: > Hello, > > Matt Price writes: > > > I don't understand how to extract todo-keyword values from a headline > using > > org-element-property. > > > > I am trying something like this: > > > > (org-element-map (org-element-parse-buffer) 'headline > > (lambda (item) > > (print (nth 0 (org-element-property :todo-keyword item))) > > (org-element-property :todo-keyword item) returns a string, so `nth' > doesn't make sense in this situation. > > > (when (eq (org-element-property :todo-keyword item) "READY") > > Strings cannot be compared with `eq'. You need `equal' (or string= > although they are not equivalent). > > ah, that was the problem, thank you as always nicolas! m > > Regards, > > -- > Nicolas Goaziou > --bcaec5486072b8b9c0051b2bcfb5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Sat, Jul 18, 2015 at 3:59 PM, Nicolas Goaziou <= mail@nicolasgoa= ziou.fr> wrote:
Hello,

Matt Price <moptop99@gmail.com= > writes:

> I don't understand how to extract todo-keyword values from a headl= ine using
> org-element-property.
>
> I am trying something like this:
>
>=C2=A0 (org-element-map (org-element-parse-buffer) 'headline
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (item)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (print (nth 0 (org-element-pr= operty :todo-keyword item)))

(org-element-property :todo-keyword item) returns a string, so `nth&= #39;
doesn't make sense in this situation.

>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when (eq (org-element-= property :todo-keyword item) "READY")

Strings cannot be compared with `eq'. You need `equal' (or s= tring=3D
although they are not equivalent).

ah, that was the problem, thank you as always nicolas= !
m

Regards,

--
Nicolas Goaziou

--bcaec5486072b8b9c0051b2bcfb5--