From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Peter_M=C3=BCnster?= Subject: [PATCH] Make org-notify.el work with latest org-element.el Date: Tue, 6 Nov 2012 12:27:39 +0100 Message-ID: <878vafkm22.fsf@micropit.couberia.selfip.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVhKm-0002TO-0S for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 06:28:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVhKc-0006gf-6i for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 06:28:43 -0500 Received: from plane.gmane.org ([80.91.229.3]:48389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVhKb-0006gH-Vy for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 06:28:34 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TVhKi-0006wd-L4 for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 12:28:40 +0100 Received: from arennes-651-1-217-194.w90-32.abo.wanadoo.fr ([90.32.92.194]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Nov 2012 12:28:40 +0100 Received: from pmlists by arennes-651-1-217-194.w90-32.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Nov 2012 12:28:40 +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: emacs-orgmode@gnu.org * contrib/lisp/org-notify.el (org-notify-convert-deadline): New function. (org-notify-make-todo): Use that function. --- contrib/lisp/org-notify.el | 11 ++++++++++- 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)) -- 1.7.3.4 -- Peter