KalyanErcConfig

(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" "#dns" "#sed")
						      ))
		  (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)
					;			    (require 'erc-tab)
					;			    (erc-tab-mode 1)
		  (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
						  "324" "329" "332" "333" "353" "477"))
		  (setq erc-track-shorten-function nil)
		  (setq erc-track-exclude-server-buffer t)
		  (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
   "/usr/share/icons/hicolor/48x48/apps/yast-scripts.png")
 (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>&lt class="comment">;" (match-string-no-properties 3)
 			    "&gt class="comment">;</b> "))
 		  (match-string-no-properties 5))))
 					;	  (concat msg "aaaa")
 					;	  (message "%s" msg) 
 	(shell-command (concat mah/erc-nick-notify-cmd
 			       " -i " mah/erc-nick-notify-icon
 			       " -t " (int-to-string
 				       mah/erc-nick-notify-timeout)
 			       " -u " mah/erc-nick-notify-urgency
 			       " -c " mah/erc-nick-notify-category
 			       " -- "
 			       "'" (buffer-name) "'"
 			       " '" msg "'")))))))
  
 
 (defun erc-cmd-HOWMANY (&rest ignore)
  "Display how many users (and ops) the current channel has."
  (interactive)
  (erc-display-message nil 'notice (current-buffer)
  (let ((hash-table (with-current-buffer
 			(erc-server-buffer)
 		      erc-server-users))
 	(users 0)
 	(ops 0))
    (maphash (lambda (k v)
 	       (when (member (current-buffer)
 			     (erc-server-user-buffers v))
 		 (incf users))
 	       (when (erc-channel-user-op-p k)
 		 (incf ops)))
 	     hash-table)
    (format
     "There are %s users (%s ops) on the current channel"
     users ops))))