Function: erc-networks--update-server-identity

erc-networks--update-server-identity is a byte-compiled function defined in erc-networks.el.gz.

Signature

(erc-networks--update-server-identity)

Documentation

Maybe grow or replace the current network identity.

If a dupe is found, adopt its identity by overwriting ours. Otherwise, take steps to ensure it can effectively be compared to ours, now and into the future. Note that target buffers are considered as well because server buffers are often killed.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-networks.el.gz
;; This stands alone for testing purposes

(defun erc-networks--update-server-identity ()
  "Maybe grow or replace the current network identity.
If a dupe is found, adopt its identity by overwriting ours.
Otherwise, take steps to ensure it can effectively be compared to
ours, now and into the future.  Note that target buffers are
considered as well because server buffers are often killed."
  (let* ((identity erc-networks--id)
         (buffer (current-buffer))
         (f (lambda ()
              (unless (or (not erc-networks--id)
                          (eq (current-buffer) buffer)
                          (eq erc-networks--id identity))
                (if (erc-networks--id-equal-p identity erc-networks--id)
                    (throw 'buffer erc-networks--id)
                  (erc-networks--id-ensure-comparable identity
                                                      erc-networks--id)
                  nil))))
         (found (catch 'buffer (erc-buffer-filter f))))
    (when found
      (setq erc-networks--id found))))