Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Nick Dokos <nicholas.dokos <at> hp.com>
Subject: automatic reminders in Emacs as pop ups [was: Re: Survey results ]
Newsgroups: gmane.emacs.orgmode
Date: Sunday 27th January 2008 22:11:08 UTC (over 9 years ago)
One answer to question 5 on the survey was another question: automatic
reminders in Emacs as pop ups?

Here is how I do it, using very little machinery. As part of org-mode
initialization, I add appointments from the diary to the agenda at
startup and I also make org-agenda-redo rescan the appt list:

-----------------------------------
(require 'appt)
(setq org-agenda-include-diary t)
(setq appt-time-msg-list nil)
(org-agenda-to-appt)

(defadvice  org-agenda-redo (after org-agenda-redo-add-appts)
  "Pressing `r' on the agenda will also add appointments."
  (progn 
    (setq appt-time-msg-list nil)
    (org-agenda-to-appt)))

(ad-activate 'org-agenda-redo)
-----------------------------------

I enable appt reminders, set the format to 'window and provide
a display function that calls a python program to do the popup:

-----------------------------------
(progn
  (appt-activate 1)
  (setq appt-display-format 'window)
  (setq appt-disp-window-function (function my-appt-disp-window))
  (defun my-appt-disp-window (min-to-app new-time msg)
    (call-process "/home/nick/bin/popup.py" nil 0 nil min-to-app msg
new-time)))
-----------------------------------

Finally, the popup.py program is trivial:

-----------------------------------
#!/usr/bin/env python

""" Simple dialog popup example similar to the GTK+ Tutorials one """

import gtk
import sys

mins = sys.argv[1]
text = ' '.join(sys.argv[2:])
dialog = gtk.MessageDialog(None,
                           gtk.DIALOG_MODAL |
gtk.DIALOG_DESTROY_WITH_PARENT,
                           gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
                           "Appt in %s mins: %s" % (mins, text))
dialog.run()
dialog.destroy()
-----------------------------------

HTH,
Nick


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
 
CD: 2ms