Go to the first, previous, next, last section, table of contents.

Customizing irchat.el

The simplest way to customize is through the defvars, that is, variables. You can place these either in your .emacs or in a special file. The most important defvars for getting irchat work the way you want it to are irchat-beep-on-bells and irchat-command-window-on-top, but there are many others.

The most used irchat variables follow, setting other variables requires deeper understanding of irchat and is not recommended.

Variables for controlling CTCP (Client-To-Client-Protocol) and irchat's own file transmission protocol.

If you're not happy with the way the keys are set up, you may wish to modify the key bindings. This is most conveniently done by defining them in your irchat-Command-mode-hook.

There are lots of other hooks, one for each server reply and so forth. For every servers message the irchat first tries to run function named irchat-handle- 'message' -hook, if that returns true it won't run internal handler for that message. The definition of these functions is somewhat tricky, you have to define it via defun and then use setq to set its variable-value as this function, see provided example for details. With these, an auto-greeter, for example, would be trivial to write. Here is two examples of using hooks. First we set up irchat-Command-mode-hook to read our abbreviations and require our own hook-code if it is not yet loaded and then we set up autogreeter. BTW, auto-greeters are annoying most of the time.

(setq irchat-Command-mode-hook
      '(lambda ()
         (make-variable-buffer-local 'blink-matching-paren)
         (setq blink-matching-paren nil)
         (setq local-abbrev-table irchat-mode-abbrev-table)
         (abbrev-mode 1)
         (require 'irchat-hooks)

(defun irchat-join-hook (prefix rest)
;;; do not greet people coming to channel #report
   ((and (not (string= prefix irchat-nickname))
	 (string= "#report" rest))
   ((and (string= "INSERT_YOUR_FAVOURITE_PERSON_HERE" prefix)
	 (string= irchat-current-channel rest))
;;; send the greeting as private message
    (irchat-Command-message prefix (format "Greetings %s" prefix)))
   (t nil)))
(setq irchat-join-hook (function irchat-join-hook))

Go to the first, previous, next, last section, table of contents.