Update of /cvsroot/emacs-jabber/emacs-jabber
In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv14322
Modified Files:
jabber-xmessage.el
Log Message:
Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-437
Creator: Magnus Henoch <ma...@fr...>
Add timeout option to xmessage alerts
Index: jabber-xmessage.el
===================================================================
RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-xmessage.el,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- jabber-xmessage.el 31 Aug 2005 20:10:15 -0000 1.1
+++ jabber-xmessage.el 16 Jan 2008 18:08:29 -0000 1.2
@@ -1,5 +1,6 @@
;; jabber-xmessage.el - emacs-jabber interface to xmessage
+;; Copyright (C) 2008 - Magnus Henoch
;; Copyright (C) 2005 - Mario Domenech Goulart
;; This file is a part of jabber.el.
@@ -18,10 +19,20 @@
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+(defcustom jabber-xmessage-timeout 15
+ "Timeout in seconds for xmessage alerts.
+Set this to nil to have no timeout."
+ :type '(choice (integer :tag "Seconds")
+ (const :tag "No timeout" nil))
+ :group 'jabber-alerts)
+
(defun jabber-xmessage-display-message (message)
"Displays MESSAGE using the xmessage program."
- (let ((process-connection-type nil))
- (start-process "xmessage" nil "xmessage" message)))
+ (let* ((process-connection-type nil)
+ (timeout-args (when jabber-xmessage-timeout
+ (list "-timeout" (number-to-string jabber-xmessage-timeout))))
+ (args (append timeout-args (list message))))
+ (apply 'start-process "xmessage" nil "xmessage" args)))
(define-jabber-alert xmessage "Display a message using the xmessage program."
'jabber-xmessage-display-message)
|