Subject: bug#6836: bug #6836 23.2; ERC -vs- uniquify

From: Binjo <[email-masked]>
Date: Thu, 12 Apr 2012 16:18:43 +0800

hi, Tom

I had the same need of uniquifing the same channel name with different irc
servers, and found your bug report. It seems not easy to integrate such feature
into uniquify.el, so here is my workaround, in case you need it, for such a long
time passed. ;)

--8<---------------cut here---------------start------------->8---
(defadvice erc-generate-new-buffer-name (after binjo-ad-rename-buffer-uniquify activate)
  "Uniquify erc buffer names with parts of server name."
  (let* ((server (ad-get-arg 0))
         (target (ad-get-arg 2))
         (server-name (nth 1 (reverse (split-string server "\\.")))))
    (if (string-match ">$" ad-return-value)
        (setq ad-return-value (concat target ":" server-name)))))
--8<---------------cut here---------------end--------------->8---

-- 
Life is like a prison, can you break it?