From a1bf5df28228eb8e1c5f418efb93e9aacc51d12b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 2 Jun 2014 23:53:08 +0200 Subject: auto-init appt --- .emacs.d/init.el | 13 +----------- .emacs.d/site-lisp/Makefile | 2 +- .emacs.d/site-lisp/appt-init.el | 46 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 .emacs.d/site-lisp/appt-init.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 8ee6b79..4941397 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -22,7 +22,6 @@ (autoload 'jabber-connect "jabber" nil t) (autoload 'jabber-message-libnotify "jabber-libnotify") (autoload 'jabber-muc-libnotify "jabber-libnotify") -(autoload 'jabber-send-message "jabber-chat") (autoload 'moz-minor-mode "moz" nil t) (autoload 'notifications-notify "notifications") (autoload 'php-mode "php-mode" nil t) @@ -130,7 +129,6 @@ MODE1 is enabled and vice-versa." (defvar sql-product) (defvar sql-prompt-regexp) (defvar whitespace-style) -(defvar jabber-connections) (defvar *jabber-connected*) (defvar *jabber-current-status*) @@ -156,13 +154,6 @@ MODE1 is enabled and vice-versa." (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:augment-sql-prompt () "Add the MariaDB prompt to the `sql-prompt-regexp'." (if (eq sql-product 'mysql) @@ -883,9 +874,7 @@ from myaethon2.core.decorators import ( ;;;; Module-specific settings -(stante-after appt - (setq appt-disp-window-function #'oni:appt-display-window-and-jabber) - (setq appt-display-diary nil)) +(auto-init appt) (stante-after auto-complete (add-to-list 'ac-modes 'slime-repl-mode) diff --git a/.emacs.d/site-lisp/Makefile b/.emacs.d/site-lisp/Makefile index c1976e2..ffa8ad7 100644 --- a/.emacs.d/site-lisp/Makefile +++ b/.emacs.d/site-lisp/Makefile @@ -1,5 +1,5 @@ .PHONY: all -all: jabber-init.elc org-init.elc gnus-init.elc +all: appt-init.elc jabber-init.elc org-init.elc gnus-init.elc %.elc: %.el emacs -Q -batch -eval "(byte-compile-file \"$<\")" diff --git a/.emacs.d/site-lisp/appt-init.el b/.emacs.d/site-lisp/appt-init.el new file mode 100644 index 0000000..95fcc41 --- /dev/null +++ b/.emacs.d/site-lisp/appt-init.el @@ -0,0 +1,46 @@ +;;; appt-init.el --- Initialization for appt -*- lexical-binding: t; -*- + +;; Copyright (C) 2014 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Initialization code for the `appt' library, should get loaded when +;; `appt' is. + +;;; Code: + +(require 'appt) + +(autoload 'jabber-send-message "jabber-chat") +(defvar jabber-connections) + +(defun oni:appt-display-window-and-jabber (min-to-app new-time appt-msg) + "Send a message to my phone jabber account." + (let ((fmt "%s%s (in %s minutes)")) + (jabber-send-message + (car jabber-connections) "phone@ryuslash.org" nil + (format fmt new-time appt-msg min-to-app) nil)) + (appt-disp-window min-to-app new-time appt-msg)) + +(setq appt-disp-window-function #'oni:appt-display-window-and-jabber + appt-display-diary nil) + + +(provide 'appt-init) +;;; appt-init.el ends here -- cgit v1.2.3-54-g00ecf