Function: erc-sync-banlist

erc-sync-banlist is a byte-compiled function defined in erc.el.gz.

Signature

(erc-sync-banlist &optional DONE-FN)

Documentation

Initialize syncing of current channel's erc-channel-banlist.

Arrange for it to remain synced for the rest of the IRC session. When DONE-FN is non-nil, call it with no args once fully updated. Expect it to return non-nil, if necessary, to inhibit further processing.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-sync-banlist (&optional done-fn)
  "Initialize syncing of current channel's `erc-channel-banlist'.
Arrange for it to remain synced for the rest of the IRC session.  When
DONE-FN is non-nil, call it with no args once fully updated. Expect it
to return non-nil, if necessary, to inhibit further processing."
  (unless (erc-channel-p (current-buffer))
    (error "Not a channel buffer"))
  (let ((channel (erc-target))
        (buffer (current-buffer))
        (hook (lambda (&rest r) (apply #'erc-banlist-store r) t)))
    (setq erc-channel-banlist nil)
    (erc-with-server-buffer
      (add-hook 'erc-server-367-functions hook -98 t)
      (erc-once-with-server-event
       368 (lambda (&rest _)
             (remove-hook 'erc-server-367-functions hook t)
             (with-current-buffer buffer
               (prog1 (if done-fn (funcall done-fn) t)
                 (setq erc--channel-banlist-synchronized-p t)))))
      (erc-server-send (format "MODE %s b" channel)))))