summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-09-02 17:07:25 -0500
committerCase Duckworth2021-09-02 17:07:25 -0500
commitc5bba76bf872c9c249c9ec3652a9fd872975ca38 (patch)
tree6a87775292f5fb4e36e77942de4c6a3a59e32aa2 /lisp
parentComment out buggy eww-browse-url advice (diff)
downloademacs-c5bba76bf872c9c249c9ec3652a9fd872975ca38.tar.gz
emacs-c5bba76bf872c9c249c9ec3652a9fd872975ca38.zip
Refactor Circe config
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-irc.el23
1 files changed, 23 insertions, 0 deletions
diff --git a/lisp/acdw-irc.el b/lisp/acdw-irc.el index 193275c..0891f31 100644 --- a/lisp/acdw-irc.el +++ b/lisp/acdw-irc.el
@@ -79,6 +79,29 @@ and right on t."
79 (if alignment "" (repeat-string left-over " ")) 79 (if alignment "" (repeat-string left-over " "))
80 after))) 80 after)))
81 81
82(defun irc ()
83 "Connect to all IRC networks in `circe-network-options'."
84 (interactive)
85 (dolist (network (mapcar #'car circe-network-options))
86 (circe-maybe-connect network)))
87
88(defun circe-network-connected-p (network)
89 "Return non-nil if there's any Circe server-buffer whose
90`circe-server-netwok' is NETWORK."
91 (catch 'return
92 (dolist (buffer (circe-server-buffers))
93 (with-current-buffer buffer
94 (if (string= network circe-server-network)
95 (throw 'return t))))))
96
97(defun circe-maybe-connect (network)
98 "Connect to NETWORK, but ask user for confirmation if it's
99already been connected to."
100 (interactive "sNetwork: ")
101 (if (or (not (circe-network-connected-p network))
102 (y-or-n-p (format "Already connected to %s, reconnect?" network)))
103 (circe network)))
104
82 105
83(provide 'acdw-irc) 106(provide 'acdw-irc)
84;;; acdw-irc.el ends here 107;;; acdw-irc.el ends here