From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [Exporter] How to extract timestamp from headline's title? Date: Fri, 15 Nov 2013 22:58:05 +0100 Message-ID: <87iovtjpjm.fsf@gmail.com> References: <87li0pqt3y.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhROm-0003QL-GN for emacs-orgmode@gnu.org; Fri, 15 Nov 2013 16:58:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhROd-0002Ew-EB for emacs-orgmode@gnu.org; Fri, 15 Nov 2013 16:57:56 -0500 Received: from mail-ea0-x235.google.com ([2a00:1450:4013:c01::235]:35085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhROd-0002Eo-8B for emacs-orgmode@gnu.org; Fri, 15 Nov 2013 16:57:47 -0500 Received: by mail-ea0-f181.google.com with SMTP id q16so1279667ead.12 for ; Fri, 15 Nov 2013 13:57:46 -0800 (PST) In-Reply-To: <87li0pqt3y.fsf@gmail.com> (Thorsten Jolitz's message of "Fri, 15 Nov 2013 21:59:13 +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: Thorsten Jolitz Cc: emacs-orgmode@gnu.org 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) Regards, -- Nicolas Goaziou