Function: erc-wash-quit-reason
erc-wash-quit-reason is a byte-compiled function defined in erc.el.gz.
Signature
(erc-wash-quit-reason REASON NICK LOGIN HOST)
Documentation
Remove duplicate text from quit REASON.
Specifically in relation to NICK (user@host) information. Returns REASON
unmodified if nothing can be removed.
E.g. "Read error to Nick [user@some.host]: 110" would be shortened to
"Read error: 110". The same applies for "Ping Timeout".
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-wash-quit-reason (reason nick login host)
"Remove duplicate text from quit REASON.
Specifically in relation to NICK (user@host) information. Returns REASON
unmodified if nothing can be removed.
E.g. \"Read error to Nick [user@some.host]: 110\" would be shortened to
\"Read error: 110\". The same applies for \"Ping Timeout\"."
(setq nick (regexp-quote nick)
login (regexp-quote login)
host (regexp-quote host))
(or (when (string-match (concat "^\\(Read error\\) to "
nick "\\[" host "\\]: "
"\\(.+\\)$")
reason)
(concat (match-string 1 reason) ": " (match-string 2 reason)))
(when (string-match (concat "^\\(Ping timeout\\) for "
nick "\\[" host "\\]$")
reason)
(match-string 1 reason))
reason))