From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Emacs for IM: Notification Date: Thu, 03 Apr 2008 10:37:14 +0200 Message-ID: <87myob49mt.fsf@member.fsf.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207211890 4398 80.91.229.12 (3 Apr 2008 08:38:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2008 08:38:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 03 10:38:42 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JhKxn-00048m-IK for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Apr 2008 10:38:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JhKxB-0003Ys-3X for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Apr 2008 04:37:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JhKwt-0003Yn-GM for help-gnu-emacs@gnu.org; Thu, 03 Apr 2008 04:37:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JhKwq-0003YL-2Z for help-gnu-emacs@gnu.org; Thu, 03 Apr 2008 04:37:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JhKwp-0003YI-Vy for help-gnu-emacs@gnu.org; Thu, 03 Apr 2008 04:37:28 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JhKwp-0002Yp-JZ for help-gnu-emacs@gnu.org; Thu, 03 Apr 2008 04:37:27 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JhKwl-0006MZ-JI for help-gnu-emacs@gnu.org; Thu, 03 Apr 2008 08:37:23 +0000 Original-Received: from dslb-092-072-014-008.pools.arcor-ip.net ([92.72.14.8]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Apr 2008 08:37:23 +0000 Original-Received: from tassilo by dslb-092-072-014-008.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Apr 2008 08:37:23 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-092-072-014-008.pools.arcor-ip.net User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:SskbN5FJMfqLVaxMci4w2OSLZdE= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53006 Archived-At: briwood writes: Hi! > I'm trying yod.el to chat via Yahoo. I'm on GNU Emacs for windows > 22.1.1. > > I would like to find a way to bring the emacs window to the front when > someone initiates a chat with me. Is there any way to get emacs to > interact with either the windows (vista) os or some third party > software that could notify me of events like this? I use rcirc (combined with bitlbee) for IRC and IM chat. I use this function to get notifications if my nick was mentioned in a channel or I got a private message. --8<---------------cut here---------------start------------->8--- (defun th-rcirc-notification (process sender response target text) (let ((my-nick (rcirc-nick process)) (wm (getenv "WINDOW_MANAGER"))) (when (and (string= response "PRIVMSG") (not (string= sender my-nick)) (or ;; BitlBee messages (string-match "localhost" (format "%s" process)) ;; Messages that mention my name (string-match my-nick text))) (cond ;; StumpWM ((string= wm "stumpwm") (th-notifications-add (concat "rcirc: " target))) ;; Other (use libnotifies notify-send) (t (start-process "rcirc-notify-send" nil "notify-send" "-t" "172800000" (concat "(rcirc) " target ": " text))))))) (add-hook 'rcirc-print-hooks 'th-rcirc-notification) --8<---------------cut here---------------end--------------->8--- Depending on the current window manager the notifications differ. For any WM except stumpwm I use libnotify's notify-send command which pops up a simple message with the text I received. HTH, Tassilo