From e44e6c044b8f188fb13723e9c20a9d1e080ecf08 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 27 Aug 2013 08:33:01 -0400 Subject: [PATCH] Remove ERC stuff. Fix remaining absolute paths to be relative. --- erc-nick-notify.el | 205 ----------------------------------- mode-hooks.el | 5 +- mode-hooks/erc-mode-hooks.el | 9 -- 3 files changed, 3 insertions(+), 216 deletions(-) delete mode 100644 erc-nick-notify.el delete mode 100644 mode-hooks/erc-mode-hooks.el diff --git a/erc-nick-notify.el b/erc-nick-notify.el deleted file mode 100644 index baa15c8..0000000 --- a/erc-nick-notify.el +++ /dev/null @@ -1,205 +0,0 @@ -;;; erc-nick-notify.el --- Notify popup for ERC - -;; Filename: erc-nick-notify.el -;; Description: Notify popup for ERC -;; Author: Andy Stewart lazycat.manatee@gmail.com -;; Maintainer: Andy Stewart lazycat.manatee@gmail.com -;; Copyright (C) 2008, 2009, Andy Stewart, all rights reserved. -;; Created: 2008-12-04 12:47:28 -;; Version: 0.2.1 -;; Last-Updated: 2009-01-31 10:47:32 -;; By: Andy Stewart -;; URL: http://www.emacswiki.org/emacs/download/erc-nick-notify.el -;; Keywords: erc, notify -;; Compatibility: GNU Emacs 23.0.60.1 -;; -;; Features that might be required by this library: -;; -;; `erc' -;; - -;;; This file is NOT part of GNU Emacs - -;;; License -;; -;; 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, 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; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth -;; Floor, Boston, MA 02110-1301, USA. - -;;; Commentary: -;; -;; Notify popup for ERC -;; -;; This extension use `notify-send' for notify. -;; So make you have install `notify-send' in your system. -;; - -;;; Installation: -;; -;; Put erc-nick-notify.el to your load-path. -;; The load-path is usually ~/elisp/. -;; It's set in your ~/.emacs like this: -;; (add-to-list 'load-path (expand-file-name "~/elisp")) -;; -;; And the following to your ~/.emacs startup file. -;; -;; (require 'erc-nick-notify) -;; -;; No need more. - -;;; Customize: -;; -;; `erc-nick-notify-delay' -;; The delay time that between two messages. -;; `erc-nick-notify-cmd' -;; The command that use for notify. -;; `erc-nick-notify-icon' -;; The file name of icon display. -;; `erc-nick-notify-timeout' -;; The timeout in milliseconds at which to expire the notification. -;; `erc-nick-notify' -;; The urgency level. -;; `erc-nick-notify-category' -;; The notification category. -;; -;; All of the above can be customize by: -;; M-x customize-group RET erc-nick-notify RET -;; - -;;; Change log: -;; -;; 2009/01/31 -;; Fix doc. -;; -;; 2008/12/21 -;; Fix `void-variable' bug. -;; -;; 2008/12/08 -;; Add customize support. -;; -;; 2008/12/04 -;; First released. -;; - -;;; Acknowledgements: -;; -;; -;; - -;;; TODO -;; -;; -;; - -;;; Require -(require 'erc) - -;;; Code: - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Customize ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defgroup erc-nick-notify nil - "Notify popup for ERC." - :group 'erc) - -(defcustom erc-nick-notify-delay '(0 5 0) - "The delay time that between two message. -Default is 5 minutes." - :type 'list - :group 'erc-nick-notify) - -(defcustom erc-nick-notify-cmd "notify-send" - "The command that use for notify." - :type 'string - :group 'erc-nick-notify) - -(defcustom erc-nick-notify-icon "~/MyEmacs/Image/Irc.png" - "Specifies an icon filename or stock icon to display." - :type 'string - :group 'erc-nick-notify) - -(defcustom erc-nick-notify-timeout 10000 - "Specifies the timeout in milliseconds at which to expire the notification." - :type 'number - :group 'erc-nick-notify) - -(defcustom erc-nick-notify-urgency "low" - "Specifies the urgency level (low, normal, critical)." - :type 'string - :group 'erc-nick-notify) - -(defcustom erc-nick-notify-category "im.received" - "Specifies the notification category." - :type 'string - :group 'erc-nick-notify) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Variable ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defvar erc-nick-notify-last '(0 0 0) - "The last time that receive message.") - -(defvar erc-nick-notify-buffer nil - "The buffer name of last notify me.") - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Interactive Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun erc-nick-notify-jump-last-channel () - "Jump to last channel that notify me." - (interactive) - (if erc-nick-notify-buffer - (switch-to-buffer erc-nick-notify-buffer) - (message "Nobody notify you in IRC."))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Utilities Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun erc-nick-notify () - "Notify me when my nick show up. -This function should be in the insert-post-hook." - (let ((now (current-time))) - (when (time-less-p erc-nick-notify-delay - (time-since erc-nick-notify-last)) - (setq erc-nick-notify-last now) - (goto-char (point-min)) - (when (re-search-forward - (concat "\\(" - "\\(<\\([^>]*\\)>\\)" ; - "\\|" - ;; Don't match if we're saying something - "\\(\\* " (regexp-quote (erc-current-nick)) "\\)" - "\\)" - "\\(.*" (regexp-quote (erc-current-nick)) ".*\\)") - nil t) - (let ((msg (concat - (when (> (length (match-string-no-properties 2)) 0) - (concat "<" (match-string-no-properties 3) - "> ")) - (match-string-no-properties 5)))) - (setq erc-nick-notify-buffer (buffer-name)) - (shell-command (concat erc-nick-notify-cmd - " -i " erc-nick-notify-icon - " -t " (int-to-string - erc-nick-notify-timeout) - " -u " erc-nick-notify-urgency - " -c " erc-nick-notify-category - " -- " - " \"" erc-nick-notify-buffer "\"" - " \"" - (if (boundp 'msg) - msg "") - "\""))))))) - -;; Add `erc-nick-notify' to `erc-insert-post-hook' -(add-hook 'erc-insert-post-hook 'erc-nick-notify) - -(provide 'erc-nick-notify) - -;;; erc-nick-notify.el ends here - -;;; LocalWords: erc cmd im msg lt diff --git a/mode-hooks.el b/mode-hooks.el index bab2c84..6e05593 100644 --- a/mode-hooks.el +++ b/mode-hooks.el @@ -1,9 +1,10 @@ -(add-to-list 'load-path "~/src/emacs.d/mode-hooks/") +(add-to-list + 'load-path + (file-name-sans-extension load-file-name)) (load-library "csharp-mode-hooks") (load-library "css-mode-hooks") (load-library "js-mode-hooks") -(load-library "erc-mode-hooks") (load-library "haskell-mode-hooks") (load-library "nxml-mode-hooks") (load-library "ruby-mode-hooks") diff --git a/mode-hooks/erc-mode-hooks.el b/mode-hooks/erc-mode-hooks.el deleted file mode 100644 index e92a761..0000000 --- a/mode-hooks/erc-mode-hooks.el +++ /dev/null @@ -1,9 +0,0 @@ -(defun ercm-hook() - ;; Load ERC-specific libraries. - (load-library "erc-nick-notify") - (setq erc-nick-notify-cmd "mplayer ~/src/emacs.d/audio/beep.mp3 &>/dev/null; notify-send &>/dev/null") - (setq erc-nick-notify-delay '(0 1 0)) - (setq erc-nick-notify-icon "~/.home/emacs.d/images/dialog-warning.png") - ) - -(add-hook 'erc-mode-hook (function ercm-hook)) -- 2.43.2