From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: get all todo items as lisp list Date: Sun, 19 Feb 2012 10:31:36 +0530 Message-ID: <811uprfmbz.fsf@gmail.com> References: <87wr7krqd9.fsf@micropit.couberia.bzh> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:39360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyyuI-0006oy-8N for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 00:01:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyyuG-0004rk-E8 for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 00:01:54 -0500 Received: from mail-pz0-f41.google.com ([209.85.210.41]:41184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyyuG-0004rZ-3r for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 00:01:52 -0500 Received: by dadv6 with SMTP id v6so4920383dad.0 for ; Sat, 18 Feb 2012 21:01:50 -0800 (PST) In-Reply-To: <87wr7krqd9.fsf@micropit.couberia.bzh> ("Peter \=\?utf-8\?Q\?M\?\= \=\?utf-8\?Q\?\=C3\=BCnster\=22's\?\= message of "Sat, 18 Feb 2012 18:41:22 +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: Peter =?utf-8?Q?M=C3=BCnster?= Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain > Hi, > > 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. --8<---------------cut here---------------start------------->8--- (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*" (write-file out-file nil)))) --8<---------------cut here---------------end--------------->8--- I am attaching sample todo.org and and the todo.el file created by the above command. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=todo.org Content-Description: todo.org * TODO todo-test DEADLINE: <2012-04-19 Thu 13:33> :PROPERTIES: :notify: notify-test :END: * TODO todo-test2 DEADLINE: <2012-05-20 Sun 16:66> :PROPERTIES: :notify: notify-test2 :END: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=todo.el Content-Transfer-Encoding: quoted-printable Content-Description: todo.el (org-data nil=0D (headline=0D (:raw-value "todo-test" :title=0D ("todo-test")=0D :begin 3 :end 106 :pre-blank 0 :hiddenp nil :contents-begin 20 :co= ntents-end 106 :level 1 :priority nil :tags nil :todo-keyword "TODO" :todo-= type todo :scheduled nil :deadline "2012-04-19 Thu 13:33" :timestamp nil :c= lock nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp n= il :quotedp nil :notify "notify-test" :category "todo")=0D (section=0D (:begin 20 :end 106 :contents-begin 20 :contents-end 106 :post-blank 0= )=0D (paragraph=0D (:begin 20 :end 55 :contents-begin 20 :contents-end 54 :post-blank 0)= =0D " "=0D (time-stamp=0D (:appt-type deadline :type active :value "<2012-04-19 Thu 13:33>" :b= egin 22 :end 54 :post-blank 0)))=0D (property-drawer=0D (:begin 55 :end 106 :hiddenp nil :properties=0D ((#("notify" 0 6=0D (fontified t face org-special-keyword org-category "todo"))=0D .=0D #("notify-test" 0 11=0D (fontified t face org-property-value org-category "todo"))))=0D :post-blank 0))))=0D (headline=0D (:raw-value "todo-test2" :title=0D ("todo-test2")=0D :begin 106 :end 211 :pre-blank 0 :hiddenp nil :contents-begin 124 = :contents-end 211 :level 1 :priority nil :tags nil :todo-keyword "TODO" :to= do-type todo :scheduled nil :deadline "2012-05-20 Sun 16:66" :timestamp nil= :clock nil :post-blank 0 :footnote-section-p nil :archivedp nil :commented= p nil :quotedp nil :notify "notify-test2" :category "todo")=0D (section=0D (:begin 124 :end 211 :contents-begin 124 :contents-end 211 :post-blank= 0)=0D (paragraph=0D (:begin 124 :end 159 :contents-begin 124 :contents-end 158 :post-blan= k 0)=0D " "=0D (time-stamp=0D (:appt-type deadline :type active :value "<2012-05-20 Sun 16:66>" :b= egin 126 :end 158 :post-blank 0)))=0D (property-drawer=0D (:begin 159 :end 211 :hiddenp outline :properties=0D ((#("notify" 0 6=0D (fontified t face org-special-keyword org-category "todo"))=0D .=0D #("notify-test2" 0 12=0D (fontified t face org-property-value org-category "todo"))))=0D :post-blank 0)))))=0D --=-=-= Content-Type: text/plain > Example output: > ((file "test.org" heading "TODO todo-test" deadline (111 222 333) > properties (notify notify-test)) > (file "test.org" heading "TODO todo-test2" deadline (123 456 789) > properties (notify notify-test2))) > > Or are there functions, that could help me, to do it myself? > (I've tried with `org-agenda-get-day-entries', but without success...) > > TIA for any help! -- --=-=-=--