;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/erc/erc-connect.el (require 'cl-lib) (require 'erc) (require 'erc-incal) (require 'erc-kill) (require 'erc-scroll) (require 'string) (defun bit-connect () (interactive) (erc-tls :server "irc.bitreich.org" :port 6697)) (defun libera-connect () (interactive) (erc-tls :server "irc.libera.chat" :port 6697 :password (auth-source-pick-first-password :host "libera.chat"))) (defun erc-connect-to-server (&optional srv passwd) (interactive "sserver: \nspassword: ") (let ((srv-data (erc-get-connect-servers))) (if (string-data-p srv) (erc-tls :server srv :passwd passwd) (cl-loop for (server pass _) in srv-data do (erc-tls :server server :password pass) )))) (defun erc-goto-irc (&optional connect) (interactive "P") (let ((irc-buffer (car (erc-buffer-list)))) (if (not irc-buffer) (if connect (erc-connect-to-server) (message "%s %s to connect" (substitute-command-keys "\\[universal-argument]") (substitute-command-keys (format "\\[%s]" this-command)) )) (switch-to-erc-buffer irc-buffer) ))) (provide 'erc-connect)