emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] get all todo items as lisp list


From: Jambunathan K
Subject: Re: [O] get all todo items as lisp list
Date: Sun, 19 Feb 2012 10:31:36 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (windows-nt)

> 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.



* 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:

Attachment: todo.el
Description: todo.el



> 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!

-- 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]