Re: [O] agenda appt warn time (baby step part 2)

2012-04-24 Thread Ivan Kanis
Hi Bastien,

FYI I sent an e-mail to b...@altern.org and it bounced.

Bastien b...@altern.org wrote:

 Inserting warntime in the headline looks hackish.  

Yeah it's an ugly hack. It would belong in the time stamp. Adding
something there is beyond my skill.

 Maybe have a look at contrib/lisp/org-notify.el by Peter?

Someone suggested that on the mailing list. It's on my todo list.
-- 
Ivan Kanis
http://ivan.kanis.fr

Art washes from the soul the dust of everyday life.
-- Pablo Picasso



Re: [O] agenda appt warn time (baby step part 2)

2012-04-20 Thread Bastien
Hi Ivan,

Ivan Kanis ivan.ka...@googlemail.com writes:

 The previous patch I sent was completely buggy. This one works but
 doesn't fulfill my RFC. I think the warn time should be somewhere within
 the time stamp...

Inserting warntime in the headline looks hackish.  

Maybe have a look at contrib/lisp/org-notify.el by Peter?

It does this and much more.

Best,

-- 
 Bastien



[O] agenda appt warn time (baby step part 2)

2012-02-23 Thread Ivan Kanis
Hi,

The previous patch I sent was completely buggy. This one works but
doesn't fulfill my RFC. I think the warn time should be somewhere within
the time stamp...

diff --git a/emacs/org/org-agenda.el b/emacs/org/org-agenda.el
index 780794e..2a8e926 100644
--- a/emacs/org/org-agenda.el
+++ b/emacs/org/org-agenda.el
@@ -8490,6 +8490,7 @@ By default `org-agenda-to-appt' will use :deadline, :scheduled
 and :timestamp entries.  See the docstring of `org-diary' for
 details and examples.
   (interactive P)
+  (require 'appt)
   (if refresh (setq appt-time-msg-list nil))
   (if (eq filter t)
   (setq filter (read-from-minibuffer Regexp filter: )))
@@ -8518,6 +8519,12 @@ 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
+ (prog1
+   (string-to-number (match-string 1 evt))
+   (setq evt (substring evt 0 warn-match)
 	  (ok (or (null filter)
 		  (and (stringp filter) (string-match filter evt))
 		  (and (functionp filter) (funcall filter x))
@@ -8536,7 +8543,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)