emacs-jabber/jabber-xmessage.el

44 lines
1.7 KiB
EmacsLisp
Raw Normal View History

;; 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.
;; 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
(eval-when-compile (require 'jabber))
Revision: mange@freemail.hu--2005/emacs-jabber--cvs-head--0--patch-479 Creator: Magnus Henoch <mange@freemail.hu> Merge autotools and test suite Patches applied: * mange@freemail.hu--2005/emacs-jabber--autotools--0--base-0 tag of mange@freemail.hu--2005/emacs-jabber--cvs-head--0--patch-477 * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-1 Add Makefile.am and configure.ac * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-2 Don't require jabber-muc-nick-completion from jabber-alert, but add an autoload * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-3 Require external notifiers from jabber.el, not jabber-alert.el * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-4 External notifiers require jabber-alert when compiling * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-5 Build autoloads * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-6 Break lines in Makefile.am * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-7 Rearrange Makefile.am to avoid circular dependency * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-8 Remove unnecessary BUILT_SOURCES * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-9 Add jabber.texi to Makefile.am * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-10 Maintainer-clean jabber-autoload.el * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-11 Distribute and install xmppuri.sh * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-12 Create zip file too * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-13 Remove explicit autoloads from jabber.el; add corresponding cookies * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-14 Merge CDATA fix * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-15 Add comment explaining double-compilation * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-16 Add test suite * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-17 Use subdirectory makefile for tests * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-18 Distribute tests * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-19 -Wall and -Werror for automake * mange@freemail.hu--2005/emacs-jabber--autotools--0--patch-20 Use makefile variables instead of autoconf ones
2008-04-20 06:21:40 +00:00
(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)
2010-01-08 09:42:11 +00:00
(defun jabber-xmessage-display-message (text &optional title)
"Displays MESSAGE using the xmessage program."
(let* ((process-connection-type nil)
(timeout-args (when jabber-xmessage-timeout
(list "-timeout" (number-to-string jabber-xmessage-timeout))))
2010-01-08 09:42:11 +00:00
(args (append timeout-args (list (or title text)))))
(apply 'start-process "xmessage" nil "xmessage" args)))
(define-jabber-alert xmessage "Display a message using the xmessage program."
'jabber-xmessage-display-message)
(provide 'jabber-xmessage)
;; arch-tag: 10A74D00-5D2C-11D9-A294-000A95C2FCD0