From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Kanis Subject: patch for warning time (first baby sted) Date: Sun, 19 Feb 2012 12:21:12 +0100 Message-ID: <877gzj83x3.fsf@googlemail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rz4pY-0007p8-G5 for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 06:21:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rz4pX-00089l-D5 for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 06:21:24 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:63806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rz4pX-00089e-7u for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 06:21:23 -0500 Received: by wgbdt13 with SMTP id dt13so3179079wgb.30 for ; Sun, 19 Feb 2012 03:21:22 -0800 (PST) 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: org mode Hi, This patch implements warn time for org appt. It only works on emacs bzr (the variable appt-warning-time-regexp appears in it). You need to add the warntime in the text of the entry, like so : * doctor warntime 10 <2012-02-19 10:00> or * doctor warntime 10 <2012-02-19 10:00> The patch is not fit to be included in org. I am submitting it in case it interests others to have the functionality. diff --git a/emacs/org/org-agenda.el b/emacs/org/org-agenda.el index 780794e..78194b1 100644 --- a/emacs/org/org-agenda.el +++ b/emacs/org/org-agenda.el @@ -8518,6 +8518,11 @@ details and examples." (let* ((evt (org-trim (or (get-text-property 1 'txt x) ""))) (cat (get-text-property 1 'org-category x)) (tod (get-text-property 1 'time-of-day x)) + (warn-match (string-match appt-warning-time-regexp evt)) + (warntime + (when warn-match + (string-to-number (match-string 1 evt)) + (setq evt (substring literal 0 warn-match)))) (ok (or (null filter) (and (stringp filter) (string-match filter evt)) (and (functionp filter) (funcall filter x)) @@ -8536,7 +8541,9 @@ details and examples." "\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)\\'" tod) (concat (match-string 1 tod) ":" (match-string 2 tod)))) - (appt-add tod evt) + (if warntime + (appt-add tod evt warntime) + (appt-add tod evt)) (setq cnt (1+ cnt))))) entries) (org-release-buffers org-agenda-new-buffers) (if (eq cnt 0)