From 614fcffbb7cc3d04d3ad7f4d2e0da86e452fdec2 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 6 Dec 2012 22:40:43 +0100 Subject: [PATCH] Send jabber message as appt reminders --- .emacs.d/init.el | 1 + .emacs.d/site-lisp/oni.el | 8 ++++++++ .emacs.d/site-lisp/org-init.el | 2 ++ 3 files changed, 11 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 40bd732..e62a2b0 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -140,6 +140,7 @@ (setq-default tab-width 4) (setq-default truncate-lines t) +(setq appt-disp-window-function #'oni:appt-display-window-and-jabber) (setq appt-display-diary nil) (setq auto-mode-case-fold nil) (setq auto-save-file-name-transforms diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el index 5b2cf65..f636587 100644 --- a/.emacs.d/site-lisp/oni.el +++ b/.emacs.d/site-lisp/oni.el @@ -25,6 +25,7 @@ ;;; Code: (autoload 'notifications-notify "notifications") +(autoload 'jabber-send-message "jabber-chat") (defmacro oni:define-mailbox (name email &optional signature longname) "Define a mailbox function for mailbox NAME with address EMAIL. @@ -72,6 +73,13 @@ DOT are intentionally being skipped." (shell-command (concat "make -C " dom-dir " TAGS >/dev/null 2>&1"))))) +(defun oni:appt-display-window-and-jabber (min-to-app new-time appt-msg) + "Send a message to my phone jabber account." + (jabber-send-message (car jabber-connections) "phone@ryuslash.org" + nil (format "%s%s (in %s minutes)" + new-time appt-msg min-to-app) nil) + (appt-disp-window min-to-app new-time appt-msg)) + (defun oni:before-save-func () "Function for `before-save-hook'." (if (eq major-mode 'html-mode) diff --git a/.emacs.d/site-lisp/org-init.el b/.emacs.d/site-lisp/org-init.el index 3bacaad..793b453 100644 --- a/.emacs.d/site-lisp/org-init.el +++ b/.emacs.d/site-lisp/org-init.el @@ -93,6 +93,8 @@ (setq org-use-fast-todo-selection t) (setq org-use-property-inheritance '("slug")) +(add-hook 'org-agenda-mode-hook 'org-agenda-to-appt) + (add-to-list 'org-modules 'habit) (org-indent-mode t)