summaryrefslogtreecommitdiff
path: root/jakob.org
diff options
context:
space:
mode:
authorJakob L. Kreuze2019-01-06 19:55:21 -0500
committerJakob L. Kreuze2019-01-06 19:55:21 -0500
commit8fd25b1d1fb7cdc4beedd4d8b61f491c7ebcc48e (patch)
tree9e76c48b6191e62a96087bad1945bec6dd796a3f /jakob.org
parent8144985f4f9617a9ca70de419c9c56e89d5ba9b3 (diff)
Fix Bitlbee functionality for ERC
Diffstat (limited to 'jakob.org')
-rw-r--r--jakob.org30
1 files changed, 29 insertions, 1 deletions
diff --git a/jakob.org b/jakob.org
index 52a7705..4b5f09f 100644
--- a/jakob.org
+++ b/jakob.org
@@ -255,6 +255,27 @@ Convenience functions for connecting to and authenticating with my IRC bouncer.
(rename-buffer server)))))
#+END_SRC
+Convenience functions for connecting to and authenticating with an instance of
+Bitlbee.
+
+#+BEGIN_SRC elisp
+(defun bitlbee-connect ()
+ "Start bitlbee as an inferior process and connect to it."
+ (bitlbee-start)
+ (erc :server "localhost" :port 6667)
+ (erc-with-buffer ((get-buffer "localhost:6667")
+ (rename-buffer "bitlbee"))))
+
+(defun bitlbee-identify ()
+ "If we're on the bitlbee server, send the identify command to the
+ &bitlbee channel."
+ (when (and (string= "localhost" erc-session-server)
+ (string= "&bitlbee" (buffer-name)))
+ (erc-message "PRIVMSG" (format "%s identify %s"
+ (erc-default-target)
+ (read-bouncer-password)))))
+#+END_SRC
+
Interactive function for automatically connecting to a local Bitlbee instance
and all of the networks I have my bouncer connected to.
@@ -267,7 +288,7 @@ and all of the networks I have my bouncer connected to.
(interactive)
(dolist (network irc-autoconnect-networks)
(if (string= network "bitlbee")
- (bitlbee-start)
+ (bitlbee-connect)
(connect-bouncer network))))
(defun irc-quit ()
@@ -1292,6 +1313,13 @@ Let =erc-fill= handle filling.
(erc-mode . (lambda () (auto-fill-mode 0)))
#+END_SRC
+Hook for automatically identifying with [[IRC][Bitlbee]].
+
+#+BEGIN_SRC elisp
+ :hook
+ (erc-join . bitlbee-identify)
+#+END_SRC
+
Sadly =:bind= is limited when it comes to defining keystrokes with prefixes, so
I've done it manually here. These are the more frequently used of the functions
in [[IRC]].

© 2015 - 2026 Jakob L. Kreuze