unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs for IM: Notification
@ 2008-04-02 18:15 briwood
  2008-04-03  8:37 ` Tassilo Horn
  2008-04-03 13:26 ` Jason Rumney
  0 siblings, 2 replies; 4+ messages in thread
From: briwood @ 2008-04-02 18:15 UTC (permalink / raw)
  To: help-gnu-emacs

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?

Thanks for any ideas.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs for IM: Notification
  2008-04-02 18:15 Emacs for IM: Notification briwood
@ 2008-04-03  8:37 ` Tassilo Horn
  2008-04-03 13:26 ` Jason Rumney
  1 sibling, 0 replies; 4+ messages in thread
From: Tassilo Horn @ 2008-04-03  8:37 UTC (permalink / raw)
  To: help-gnu-emacs

briwood <deweysquare@gmail.com> 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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs for IM: Notification
  2008-04-02 18:15 Emacs for IM: Notification briwood
  2008-04-03  8:37 ` Tassilo Horn
@ 2008-04-03 13:26 ` Jason Rumney
  2008-04-15 19:09   ` briwood
  1 sibling, 1 reply; 4+ messages in thread
From: Jason Rumney @ 2008-04-03 13:26 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 2, 7:15 pm, briwood <deweysqu...@gmail.com> wrote:

> I would like to find a way to bring the emacs window to the front when
> someone initiates a chat with me.

The function `raise-frame' seems to be what you want.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs for IM: Notification
  2008-04-03 13:26 ` Jason Rumney
@ 2008-04-15 19:09   ` briwood
  0 siblings, 0 replies; 4+ messages in thread
From: briwood @ 2008-04-15 19:09 UTC (permalink / raw)
  To: help-gnu-emacs

Thank you very much for your responses. I'll give that a try.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-15 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-02 18:15 Emacs for IM: Notification briwood
2008-04-03  8:37 ` Tassilo Horn
2008-04-03 13:26 ` Jason Rumney
2008-04-15 19:09   ` briwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).