Update of /cvsroot/emacs-jabber/emacs-jabber
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv4610
Modified Files:
jabber-alert.el
Added Files:
jabber-wmii.el
Log Message:
Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-357
Creator: Magnus Henoch <ma...@fr...>
Add alert messages for wmii
Patch from Detlev Zundel.
--- NEW FILE: jabber-wmii.el ---
;; jabber-wmii.el - emacs-jabber interface to wmii
;; Copyright (C) 2007 - Detlev Zundel - dz...@gn...
;; This file is NOT a part of jabber.el.
;; 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 2 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, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(defvar jabber-wmii-color "#ffffff #335577 #447799"
"Color specification as needed by the wmii window manager for the jabber alert messages.")
(defvar jabber-wmii-reset-time "20 sec"
"If non-nil time to reset wmii message. If nil the message has to be cleared by other means, i.e. from wmiirc.")
(defvar jabber-wmii-timer nil
"Timer to clear wmii message.")
(defun jabber-wmii-clear ()
"Clear any previous message output through wmii window manager."
(condition-case e
(call-process "wmiir" nil nil nil "remove" "/rbar/jabber")
(error nil)))
(defun jabber-wmii-message (msg)
"Show MSG in wmii."
(when jabber-wmii-timer
(cancel-timer jabber-wmii-timer))
(let ((tmp (make-temp-file temporary-file-directory)))
(with-temp-file tmp
(insert jabber-wmii-color " " msg))
;; Possible errors include not finding the wmiir binary, and
;; too many pipes open because of message flood.
(condition-case e
(call-process "wmiir" tmp nil nil "create" "/rbar/jabber")
(error nil))
(delete-file tmp))
(when jabber-wmii-reset-time
(setq jabber-wmii-timer
(run-at-time jabber-wmii-reset-time nil 'jabber-wmii-clear))))
(define-jabber-alert wmii "Show a message through the wmii window manager."
'jabber-wmii-message)
(provide 'jabber-wmii)
Index: jabber-alert.el
===================================================================
RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-alert.el,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- jabber-alert.el 14 Mar 2007 10:55:36 -0000 1.31
+++ jabber-alert.el 7 May 2007 02:05:12 -0000 1.32
@@ -1,7 +1,7 @@
;; jabber-alert.el - alert hooks
+;; Copyright (C) 2003, 2004, 2005, 2007 - Magnus Henoch - ma...@fr...
;; Copyright (C) 2002, 2003, 2004 - tom berger - ob...@in...
-;; Copyright (C) 2003, 2004, 2005 - Magnus Henoch - ma...@fr...
;; This file is a part of jabber.el.
@@ -281,6 +281,7 @@
(require 'jabber-sawfish)
(require 'jabber-festival)
(require 'jabber-xmessage)
+(require 'jabber-wmii)
;; Message alert hooks
(defun jabber-message-default-message (from buffer text)
|