Function: erc-with-server-buffer
erc-with-server-buffer is a macro defined in erc-common.el.gz.
Signature
(erc-with-server-buffer &rest BODY)
Documentation
Execute BODY in the current ERC server buffer.
If no server buffer exists, return nil.
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc-common.el.gz
(defmacro erc-with-server-buffer (&rest body)
"Execute BODY in the current ERC server buffer.
If no server buffer exists, return nil."
(declare (indent 0) (debug (body)))
(let ((varp (and (symbolp (car body))
(not (cdr body))
(special-variable-p (car body))))
(buffer (make-symbol "buffer")))
`(when-let* (((processp erc-server-process))
(,buffer (process-buffer erc-server-process))
((buffer-live-p ,buffer)))
,(if varp
`(buffer-local-value ',(car body) ,buffer)
`(with-current-buffer ,buffer
,@body)))))