summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-09-01 18:12:24 -0500
committerCase Duckworth2021-09-01 18:12:24 -0500
commit94e355ff102fdb44e6267d5ef43175812eebd1e0 (patch)
treebafe6ba03d1ac7e49274182a6d30e236915d148e
parentReplace ace-link with link-hint (diff)
downloademacs-94e355ff102fdb44e6267d5ef43175812eebd1e0.tar.gz
emacs-94e355ff102fdb44e6267d5ef43175812eebd1e0.zip
Add `irc' command
Might want to consider a different name, since `irc' is an alias to `rcirc'...
-rw-r--r--init.el23
1 files changed, 23 insertions, 0 deletions
diff --git a/init.el b/init.el index 06a2450..2f51ce8 100644 --- a/init.el +++ b/init.el
@@ -1089,6 +1089,29 @@ like a dumbass."
1089 circe-reduce-lurker-spam t 1089 circe-reduce-lurker-spam t
1090 circe-server-auto-join-default-type :after-auth) 1090 circe-server-auto-join-default-type :after-auth)
1091 1091
1092 (defun irc ()
1093 "Connect to IRC."
1094 (interactive)
1095 (dolist (network (mapcar #'car circe-network-options))
1096 (circe-maybe-connect network)))
1097
1098 (defun circe-network-connected-p (network)
1099 "Return non-nil if there's any Circe server-buffer whose
1100`circe-server-netwok' is NETWORK."
1101 (catch 'return
1102 (dolist (buffer (circe-server-buffers))
1103 (with-current-buffer buffer
1104 (if (string= network circe-server-network)
1105 (throw 'return t))))))
1106
1107 (defun circe-maybe-connect (network)
1108 "Connect to NETWORK, but ask user for confirmation if it's
1109already been connected to."
1110 (interactive "sNetwork: ")
1111 (if (or (not (circe-network-connected-p network))
1112 (y-or-n-p (format "Already connected to %s, reconnect?" network)))
1113 (circe network)))
1114
1092 (add-hook 'circe-chat-mode-hook 1115 (add-hook 'circe-chat-mode-hook
1093 (defun circe-chat@setup () 1116 (defun circe-chat@setup ()
1094 (lui-set-prompt 1117 (lui-set-prompt