Function: erc--get-isupport-entry

erc--get-isupport-entry is a byte-compiled function defined in erc-backend.el.gz.

Signature

(erc--get-isupport-entry KEY &optional SINGLE)

Documentation

Return an item for "ISUPPORT" token KEY, a symbol.

When a lookup fails return nil. Otherwise return a list whose CAR is KEY and whose CDR is zero or more strings. With SINGLE, just return the first value, if any. The latter is potentially ambiguous and only useful for tokens supporting a single primitive value.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-backend.el.gz
(defun erc--get-isupport-entry (key &optional single)
  "Return an item for \"ISUPPORT\" token KEY, a symbol.
When a lookup fails return nil.  Otherwise return a list whose
CAR is KEY and whose CDR is zero or more strings.  With SINGLE,
just return the first value, if any.  The latter is potentially
ambiguous and only useful for tokens supporting a single
primitive value."
  (if-let* ((table (or erc--isupport-params
                       (erc-with-server-buffer erc--isupport-params)))
            (value (erc-compat--with-memoization (gethash key table)
                     (when-let ((v (assoc (symbol-name key)
                                          erc-server-parameters)))
                       (if (cdr v)
                           (erc--parse-isupport-value (cdr v))
                         '--empty--)))))
      (pcase value
        ('--empty-- (unless single (list key)))
        (`(,head . ,_) (if single head (cons key value))))
    (when table
      (remhash key table))))