<[EMAIL PROTECTED]> writes:

> I have just switched from Planner to Org recent and I find the Org mode
> fit my need more.  But I failed to find a function that I used a lot in
> the Planner mode. The function is that a alert window is pop up (with a
> beep as well) when an appointment time is coming with in a few minutes.
> Is it such a function in current Org mode. If no, can we implement it?

Here is a solution that works for me.  

(defun bzg-org-agenda-to-appt ()
  "Activate appointments found in `org-agenda-files'."
  (interactive)
  (require 'org)
  (let* ((today (org-date-to-gregorian 
                 (time-to-days (current-time))))
         (files org-agenda-files)
         entries file)
    (while (setq file (pop files))
      (setq entries (append entries (org-agenda-get-day-entries 
                                     file today :timestamp))))
    (mapc (lambda(x) 
            (let* ((event (org-trim (get-text-property 1 'txt x)))
                   (time (number-to-string
                          (get-text-property 1 'time-of-day x)))
                   (time-st (concat (substring time 0 2) ":" 
                                    (substring time 2 4))))
              (appt-add time-st event))) entries)))

Of course you should have initialized appt and this could be hooked
somewhere. Let me know if it's okay for you.

Regards,

-- 
Bastien


_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to