Coder Social home page Coder Social logo

gntp's Introduction

gntp.el

GNTP implementation for Emacs. It's very incomplete, no encryption, no real error handling etc. but has just what I need. Feel free to improve it.

Usage

This is the setup I use for rcirc:

;;; Growl notifications for IRC
(setq gntp-icon-path "C:/home/site-lisp/todochiku-icons/")
(setq gntp-application-icon (concat gntp-icon-path "emacs_32.png"))
(setq gntp-server "localhost")

;; register notifications, only needs to be done once per server

(let ((notifications
       `((irc-mention
            :display "IRC Mention"
            :enabled t
            :icon ,(concat gntp-icon-path "groupevent.png"))
           (irc-convo
            :display "IRC Convo"
            :enabled t
            :icon ,(concat gntp-icon-path "chat.png")))))
  (gntp-register notifications gntp-server))

(defun gntp-convo-rcirc-print-hook (process sender response target text)
  (when (and (string= sender target)
             (not (string= (rcirc-nick process) sender))
             (not (string= (rcirc-server-name process) sender))
             (not (memq (rcirc-get-buffer process target t)
                        (rcirc-visible-buffers))))
    (gntp-notify 'irc-convo "IRC convo"
                 (format "<%s> %s" sender text) gntp-server)))
(add-hook 'rcirc-print-functions 'gntp-convo-rcirc-print-hook)

(defun gntp-rcirc-print-hook (process sender response target text)
  (when (and (rcirc-channel-p target)
             (string-match (rcirc-nick process) text)
             (not (string= (rcirc-nick process) sender))
             (not (string= (rcirc-server-name process) sender)))
    (gntp-notify 'irc-mention (format "IRC mention" target)
                 (format "%s <%s> %s" target sender text)
                 gntp-server)))
(add-hook 'rcirc-print-functions 'gntp-rcirc-print-hook)

Authors & Contributors

gntp's People

Contributors

myuhe avatar tekai avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.