Function: erc-button-setup

erc-button-setup is a byte-compiled function defined in erc-button.el.gz.

Signature

(erc-button-setup)

Documentation

Perform major-mode setup for ERC's button module.

Note that prior to ERC 5.6, this function used to modify erc-mode-map, but that's now handled by the mode toggles themselves.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-button.el.gz
(defun erc-button-setup ()
  "Perform major-mode setup for ERC's button module.
Note that prior to ERC 5.6, this function used to modify
`erc-mode-map', but that's now handled by the mode toggles
themselves."
  (setq erc-button-keys-added t)
  (cl-assert (derived-mode-p 'erc-mode))
  ;; It would probably suffice to run this in server buffers alone,
  ;; even though buttonizing happens in all ERC buffers and users have
  ;; been known to set `erc-button-alist' locally.
  (dolist (entry erc-button-alist)
    (pcase entry
      ((or `(nicknames ,_ ,sym . ,_) `('nicknames ,_ ,sym . ,_))
       (setq erc-button--has-nickname-entry t)
       (unless (eq sym 'erc-button-buttonize-nicks)
         (erc--warn-once-before-connect 'erc-button-mode
           "The legacy `nicknames' entry in `erc-button-alist'"
           " is deprecated.  See doc string for details.")))
      ((and `(,_ ,_ ,form . ,_)
            (guard (not (or (and (symbolp form)
                                 (special-variable-p form))
                            (functionp form)))))
       (erc--warn-once-before-connect 'erc-button-mode
         "Arbitrary sexps for the third, FORM slot of `erc-button-alist'"
         " entries are deprecated. Either use a variable or a function"
         " that conditionally calls `erc-button-add-button'.")))))