From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: automatic reminders in Emacs as pop ups [was: Re: Survey results ] Date: Sun, 27 Jan 2008 17:11:08 -0500 Message-ID: <13222.1201471868@gamaville.dokosmarshall.org> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JJFk4-000770-3H for emacs-orgmode@gnu.org; Sun, 27 Jan 2008 17:12:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JJFk1-00075l-TY for emacs-orgmode@gnu.org; Sun, 27 Jan 2008 17:12:43 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJFk1-00075i-Oa for emacs-orgmode@gnu.org; Sun, 27 Jan 2008 17:12:41 -0500 Received: from qmta10.emeryville.ca.mail.comcast.net ([76.96.30.17]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JJFk1-0008B6-G2 for emacs-orgmode@gnu.org; Sun, 27 Jan 2008 17:12:41 -0500 In-Reply-To: Message from Carsten Dominik of "Sun, 27 Jan 2008 22:22:46 +0100." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: org-mode mailing list 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