Function: erc-determine-network

erc-determine-network is an autoloaded and byte-compiled function defined in erc-networks.el.gz.

This function is obsolete since 29.1; maybe see erc-networks--determine

Signature

(erc-determine-network)

Documentation

Return the name of the network or "Unknown" as a symbol.

Use the server parameter NETWORK if provided, otherwise parse the server name and search for a match in erc-networks-alist.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-networks.el.gz
;; Functions:

;;;###autoload
(defun erc-determine-network ()
  "Return the name of the network or \"Unknown\" as a symbol.
Use the server parameter NETWORK if provided, otherwise parse the
server name and search for a match in `erc-networks-alist'."
  ;; The server made it easy for us and told us the name of the NETWORK
  (declare (obsolete "maybe see `erc-networks--determine'" "29.1"))
  (defvar erc-server-parameters)
  (defvar erc-session-server)
  (let ((network-name (cdr (assoc "NETWORK" erc-server-parameters))))
    (if network-name
	(intern network-name)
      (or
       ;; Loop through `erc-networks-alist' looking for a match.
       (let ((server (or erc-server-announced-name erc-session-server)))
	 (cl-loop for (name matcher) in erc-networks-alist
		  when (and matcher
			    (string-match (concat matcher "\\'") server))
		  do (cl-return name)))
       'Unknown))))