From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: get all todo items as lisp list Date: Sun, 19 Feb 2012 11:57:58 +0100 Message-ID: <874nunw0nd.fsf@gmail.com> References: <87wr7krqd9.fsf@micropit.couberia.bzh> <811uprfmbz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rz4UR-0002IY-Qp for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 05:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rz4UQ-00048v-PY for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 05:59:35 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:45689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rz4UQ-00048p-HP for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 05:59:34 -0500 Received: by wera13 with SMTP id a13so3453603wer.0 for ; Sun, 19 Feb 2012 02:59:33 -0800 (PST) In-Reply-To: <811uprfmbz.fsf@gmail.com> (Jambunathan K.'s message of "Sun, 19 Feb 2012 10:31:36 +0530") 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: Jambunathan K Cc: Peter =?utf-8?Q?M=C3=BCnster?= , emacs-orgmode@gnu.org Hello, Jambunathan K writes: >> Given a todo list in an org file, is there already a function, that >> converts this list to an elisp list, that contains at least heading, >> deadline and properties? > > Create the following interactive function. This functions exports Org > file to a *pretty* lisp file. > > (defun org-export-as-lisp () > (interactive) > (or (featurep 'pp) (require 'pp)) > (let ((out-file > (concat (file-name-sans-extension (buffer-file-name)) ".el"))) > (pp-display-expression (org-element-parse-buffer) "*Org Data*") > (with-current-buffer "*Org Data*" Nice example. Also, the OP may replace (org-element-parse-buffer) with (org-element-parse-buffer 'headline) for quicker results, since parsed headlines already contain all the required information. Regards, -- Nicolas Goaziou