[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [Exporter] How to extract timestamp from headline's title?
From: |
Thorsten Jolitz |
Subject: |
Re: [O] [Exporter] How to extract timestamp from headline's title? |
Date: |
Sat, 16 Nov 2013 01:15:58 +0100 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) |
Nicolas Goaziou <address@hidden> writes:
Hello,
> Thorsten Jolitz <address@hidden> writes:
>
>> when writing an exporter backend, I wonder what is the canonical way to
>> extract the (optional) timestamp element from a headline's :title
>> attribute (which holds a secondary string)?
>>
>> I could do something like this to extract the timestamp from the headline
>>
>> #+begin_src emacs-lisp
>> (let ((ttl (org-element-property :title headline)))
>> (and (> (length ttl) 1)
>> (car (last ttl))))
>> #+end_src
>>
>> but I hope there is a more straight-forward and reliable way to do
>> this?
>
> You can map over a secondary string. E.g.:
>
> (org-element-map (org-element-property :title headline) 'timestamp
> 'identity)
I knew there must be a better way to do this - thanks for the tip!
--
cheers,
Thorsten