+(defun erc-format-network ()
+ "Return the name of the network we are currently on."
+ (let ((network (and (fboundp 'erc-network-name) (erc-network-name))))
+ (if (and network (symbolp network))
+ (symbol-name network)
+ "")))
+
+(defun erc-format-target-and/or-network ()
+ "Return the network or the current target and network combined.
+If the name of the network is not available, then use the
+shortened server name instead."
+ (let ((network-name (or (and (fboundp 'erc-network-name) (erc-network-name))
+ (erc-shorten-server-name
+ (or erc-server-announced-name
+ erc-session-server)))))
+ (when (and network-name (symbolp network-name))
+ (setq network-name (symbol-name network-name)))
+ (cond ((erc-default-target)
+ (concat (erc-string-no-properties (erc-default-target))
+ "@" network-name))
+ (network-name network-name)
+ (t (buffer-name (current-buffer))))))
+