From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: [Exporter] How to extract timestamp from headline's title? Date: Sat, 16 Nov 2013 01:15:58 +0100 Message-ID: <878uwp19s1.fsf@gmail.com> References: <87li0pqt3y.fsf@gmail.com> <87iovtjpjm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhTYh-0004qB-EO for emacs-orgmode@gnu.org; Fri, 15 Nov 2013 19:16:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhTYa-0006UW-4w for emacs-orgmode@gnu.org; Fri, 15 Nov 2013 19:16:19 -0500 Received: from plane.gmane.org ([80.91.229.3]:54682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhTYZ-0006UR-Ur for emacs-orgmode@gnu.org; Fri, 15 Nov 2013 19:16:12 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VhTYW-0006pC-R9 for emacs-orgmode@gnu.org; Sat, 16 Nov 2013 01:16:08 +0100 Received: from e178189095.adsl.alicedsl.de ([85.178.189.95]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Nov 2013 01:16:08 +0100 Received: from tjolitz by e178189095.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Nov 2013 01:16:08 +0100 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 Nicolas Goaziou writes: Hello, > Thorsten Jolitz 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