~:: kalyan ::~


(global-set-key “\C-cerc” (lambda () (interactive)

(add-to-list ‘load-path “~/.emacs.d/erc-5.2/”)
(require ‘erc)

‘(erc-modules (quote
(autoaway autojoin completion fill irccontrols
log match menu netsplit noncommands page
readonly ring scrolltobottom smiley sound
stamp spelling track)))

(erc :server “irc.freenode.net” :port 6667 :full-name “kalyanasundaram” :nick “kalyan”)
(erc :server “irc.gimp.org” :port 6667 :full-name “kalyanasundaram” :nick “kalyan”)

(setq erc-autojoin-channels-alist ‘((“freenode.net” “#erc” “#emacs” “#regex” “#ldap” “#dns”)
(“gimp.org” “#novell-india” “#evolution”)))

(load “~/.emacs.d/erc-nick-colors.el”)
(require ‘erc-nick-colors)

(setq erc-timestamp-only-if-changed-flag nil
erc-timestamp-format “%H:%M ”
erc-fill-prefix ” ”
erc-insert-timestamp-function ‘erc-insert-timestamp-left)

(setq erc-pal-highlight-type ‘nil
;;erc-highlight-strings ‘()
erc-keywords ‘(“\\bmtorus”)
erc-current-nick-highlight-type ‘nil)
(setq erc-replace-alist ‘((“” . “”)))

(setq erc-prompt (lambda ()
(if (and (boundp ‘erc-default-recipients) (erc-default-target))
(erc-propertize (concat (erc-default-target) “>”) ‘read-only t ‘rear-nonsticky t ‘front-nonsticky t)
(erc-propertize (concat “>”) ‘read-only t ‘rear-nonsticky t ‘front-nonsticky t))))

;(load “~/.emacs.d/erc-nicklist.el”)
(require ‘erc-nicklist)

(add-hook ‘erc-insert-post-hook ‘mah/erc-nick-notify)

(setq frame-title-format ‘(“irc”))

) ;lambda ends here

(defvar mah/erc-nick-notify-last ‘(0 0 0))
(defvar mah/erc-nick-notify-delay ‘(0 5 0))
(defvar mah/erc-nick-notify-cmd “notify-send”)
(defvar mah/erc-nick-notify-icon
(defvar mah/erc-nick-notify-timeout 10000)
(defvar mah/erc-nick-notify-urgency “low”) ;
(defvar mah/erc-nick-notify-category “im.received”) ;

(defun mah/erc-nick-notify ()
“Notify me when my nick shows up. This function should be in
the insert-post-hook.”
(let ((now (current-time)))
(when (time-less-p mah/erc-nick-notify-delay
(time-since mah/erc-nick-notify-last))
(setq mah/erc-nick-notify-last now)
(goto-char (point-min))
; (my-theme-cycle)
(when (re-search-forward
(concat “\\(”
“\\(<\\([^>]*\\)>\\)” ; <someone>
;; Don’t match if we’re saying something
“\\(\\* ” (regexp-quote (erc-current-nick)) “\\)”
(regexp-quote (erc-current-nick)) “.*\\)”)
nil t)
(let ((msg (concat
(when (> (length (match-string-no-properties 2)) 0)
(concat “<b><” (match-string-no-properties 3)
“></b> “))
(match-string-no-properties 5))))
(concat msg “test”)
(message “%s” msg)
(shell-command (concat mah/erc-nick-notify-cmd
” -i ” mah/erc-nick-notify-icon
” -t ” (int-to-string
” -u ” mah/erc-nick-notify-urgency
” -c ” mah/erc-nick-notify-category
” — ”
“‘” (buffer-name) “‘”
” ‘” msg “‘”)))))))


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: