Function: erc-channel-p

erc-channel-p is a byte-compiled function defined in erc.el.gz.

Signature

(erc-channel-p TARGET)

Documentation

Return non-nil if TARGET is a valid channel name or a channel buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-channel-p (target)
  "Return non-nil if TARGET is a valid channel name or a channel buffer."
  (cond ((stringp target)
         (and-let*
             (((not (string-empty-p target)))
              (value (let ((entry (erc--get-isupport-entry 'CHANTYPES)))
                       (if entry (cadr entry) erc--fallback-channel-prefixes)))
              ((erc--strpos (aref target 0) value)))))
        ((and-let* (((buffer-live-p target))
                    (target (buffer-local-value 'erc--target target))
                    ((erc--target-channel-p target)))))))