-
Notifications
You must be signed in to change notification settings - Fork 0
/
growl.el
49 lines (39 loc) · 1.64 KB
/
growl.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
;;; growl.el --- Growl notifications
;; Copyright (C) 2006 Brian Templeton
;; Author: Brian Templeton <[email protected]>
;; Keywords: growl notification mac osx
;; This file is not part of GNU Emacs.
;; This 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 2, or (at your option) any later
;; version.
;;
;; This 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 GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
;; MA 02110-1301, USA.
;;; Code:
(defvar growl-program "growlnotify")
(defun growl (title message)
(start-process "growl" " growl"
growl-program
title
"-a" "Emacs")
(process-send-string " growl" message)
(process-send-string " growl" "\n")
(process-send-eof " growl"))
(defun growl-rcirc-print-hook (process sender response target text)
(when (and (string-match (rcirc-nick process) text)
(not (string= (rcirc-nick process) sender))
(not (string= (rcirc-server process) sender)))
(growl "You Were Mentioned"
(format "You were mentioned by %s in %s" sender target))))
(eval-after-load 'rcirc
'(add-hook 'rcirc-print-hooks 'growl-rcirc-print-hook))
(provide 'growl)
;;; growl.el ends here