From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: getting todo-keywords from org-element-property Date: Sat, 18 Jul 2015 21:59:34 +0200 Message-ID: <87a8ututi1.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGYFP-0001AR-1w for emacs-orgmode@gnu.org; Sat, 18 Jul 2015 15:58:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGYFO-0005zb-7c for emacs-orgmode@gnu.org; Sat, 18 Jul 2015 15:58:10 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:55867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGYFO-0005zR-0o for emacs-orgmode@gnu.org; Sat, 18 Jul 2015 15:58:10 -0400 In-Reply-To: (Matt Price's message of "Sat, 18 Jul 2015 13:41:12 -0400") 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 Cc: Org Mode 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). Regards, -- Nicolas Goaziou