Variable: erc-server-005-functions
erc-server-005-functions is a variable defined in erc-backend.el.gz.
Value
(erc-server-005)
Documentation
Hook called upon receiving a 005 server response.
Each function is called with two arguments, the process associated with the response and the parsed response. If the function returns non-nil, stop processing the hook. Otherwise, continue.
See also erc-server-005.
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc-backend.el.gz
(define-erc-response-handler (005)
"Set the variable `erc-server-parameters' and display the received message.
According to RFC 2812, suggests alternate servers on the network.
Many servers, however, use this code to show which parameters they have set,
for example, the network identifier, maximum allowed topic length, whether
certain commands are accepted and more. See documentation for
`erc-server-parameters' for more information on the parameters sent.
A server may send more than one 005 message."
nil
(unless erc--isupport-params
(setq erc--isupport-params (make-hash-table)))
(let* ((args (cdr (erc-response.command-args parsed)))
(line (string-join args " ")))
(while args
(let ((section (pop args))
key
value
negated)
(when (string-match
(rx bot (| (: (group (+ (any "A-Z"))) "=" (group (* nonl)))
(: (? (group "-")) (group (+ (any "A-Z")))))
eot)
section)
(setq key (or (match-string 1 section) (match-string 4 section))
value (match-string 2 section)
negated (and (match-string 3 section) '-))
(setf (alist-get key erc-server-parameters '- 'remove #'equal)
(or value negated))
(remhash (intern key) erc--isupport-params))))
(erc-display-message parsed 'notice proc line)
nil))