summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Münster <pmlists@free.fr>2012-11-06 16:27:39 +0000
committerNicolas Goaziou <n.goaziou@gmail.com>2012-11-14 19:28:30 +0100
commit8fb2cb8c19913baa0e6c4768caa5e1da34836104 (patch)
tree411f74c38d47b057e82c5802e26dbb852d5a7dd2
parent907110e9133634670d31f6ca31bc0a3f4cd555ca (diff)
downloadorg-mode-8fb2cb8c19913baa0e6c4768caa5e1da34836104.tar.gz
Make org-notify.el work with latest org-element.el
* contrib/lisp/org-notify.el (org-notify-convert-deadline): New function. (org-notify-make-todo): Use that function.
-rw-r--r--contrib/lisp/org-notify.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/lisp/org-notify.el b/contrib/lisp/org-notify.el
index c4ff8ae..a4002c4 100644
--- a/contrib/lisp/org-notify.el
+++ b/contrib/lisp/org-notify.el
@@ -106,12 +106,21 @@
(cdr (assoc (match-string 3 str) conv))
(if (= (length (match-string 1 str)) 1) -1 1)))))
+(defun org-notify-convert-deadline (orig)
+ "Convert original deadline from `org-element-parse-buffer' to
+simple timestamp string."
+ (if orig
+ (replace-regexp-in-string "^<\\|>$" ""
+ (plist-get (plist-get orig 'timestamp)
+ :raw-value))))
+
(defun org-notify-make-todo (heading &rest ignored)
"Create one todo item."
(macrolet ((get (k) `(plist-get list ,k))
(pr (k v) `(setq result (plist-put result ,k ,v))))
(let* ((list (nth 1 heading)) (notify (or (get :notify) "default"))
- (deadline (get :deadline)) (heading (get :raw-value))
+ (deadline (org-notify-convert-deadline (get :deadline)))
+ (heading (get :raw-value))
result)
(when (and (eq (get :todo-type) 'todo) heading deadline)
(pr :heading heading) (pr :notify (intern notify))