Previous: , Up: Hacking and Tweaking   [Contents][Index]

4.6 Using rcirc with bouncers

Some bouncers multiplex connections to various servers, but have to modify nicks and channel names to make this work. The channel #emacs on becomes #emacs/

The options rcirc-nick-filter and rcirc-channel-filter can be used to make this feel more natural. When set to functions, these will be used to change how nicks and channel names are displayed. A simple configuration to fix the above example might be:

(defun my/rcirc-remove-suffix (STR)
  "Remove suffixes from STR."
    (if (string-match "/[[:alpha:]]+?\\'" str)
        (substring str 0 (match-beginning 0))

(setq rcirc-nick-filter #'my/rcirc-remove-suffix
      rcirc-channel-filter #'local/rcirc-soju-suffix)