emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* getting todo-keywords from org-element-property
@ 2015-07-18 17:41 Matt Price
  2015-07-18 19:59 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Price @ 2015-07-18 17:41 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

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)))
            (when (eq (org-element-property :todo-keyword item) "READY")

[-- Attachment #2: Type: text/html, Size: 467 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: getting todo-keywords from org-element-property
  2015-07-18 17:41 getting todo-keywords from org-element-property Matt Price
@ 2015-07-18 19:59 ` Nicolas Goaziou
  2015-07-18 20:04   ` Matt Price
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2015-07-18 19:59 UTC (permalink / raw)
  To: Matt Price; +Cc: Org Mode

Hello,

Matt Price <moptop99@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: getting todo-keywords from org-element-property
  2015-07-18 19:59 ` Nicolas Goaziou
@ 2015-07-18 20:04   ` Matt Price
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Price @ 2015-07-18 20:04 UTC (permalink / raw)
  To: Matt Price, Org Mode

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

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

> Hello,
>
> Matt Price <moptop99@gmail.com> 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
>

[-- Attachment #2: Type: text/html, Size: 1605 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-18 20:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-18 17:41 getting todo-keywords from org-element-property Matt Price
2015-07-18 19:59 ` Nicolas Goaziou
2015-07-18 20:04   ` Matt Price

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).