emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Is it any function similar to appoinment alert in the plan


From: Bastien Guerry
Subject: Re: [Orgmode] Is it any function similar to appoinment alert in the planner mode?
Date: Wed, 25 Jul 2007 21:15:42 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux)

<address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]