[emacs] skeleton for irc setup with ERC and ZNC
[~bandali/configs] / init.org
index 97ad67d..83ae614 100644 (file)
--- a/init.org
+++ b/init.org
@@ -805,6 +805,9 @@ Some bindings for functions from built-in GNU Emacs packages:
 
  ("s-p"     . beginning-of-buffer)
  ("s-n"     . end-of-buffer))
 
  ("s-p"     . beginning-of-buffer)
  ("s-n"     . end-of-buffer))
+
+(when (display-graphic-p)
+  (unbind-key "C-z" global-map))
 #+end_src
 
 While at it, let's bind a few for some =straight-*= functions too:
 #+end_src
 
 While at it, let's bind a few for some =straight-*= functions too:
@@ -1216,7 +1219,8 @@ There's no way I could top that, so I won't attempt to.
       ("emacs"
        (or
         (name . "^\\*scratch\\*$")
       ("emacs"
        (or
         (name . "^\\*scratch\\*$")
-        (name . "^\\*Messages\\*$"))))))
+        (name . "^\\*Messages\\*$")))
+      ("erc" (mode . erc-mode)))))
   (ibuffer-formats
    '((mark modified read-only locked " "
            (name 18 18 :left :elide)
   (ibuffer-formats
    '((mark modified read-only locked " "
            (name 18 18 :left :elide)
@@ -1900,6 +1904,7 @@ Emacs package that displays available keybindings in popup
     "C-x v"   "version control"
     ;; prefixes for my personal bindings
     "C-c a"   "applications"
     "C-x v"   "version control"
     ;; prefixes for my personal bindings
     "C-c a"   "applications"
+    "C-c a e" "erc"
     "C-c a s" "shells"
     "C-c p"   "package-management"
     "C-c p e" "package-management/epkg"
     "C-c a s" "shells"
     "C-c p"   "package-management"
     "C-c p e" "package-management/epkg"
@@ -2386,7 +2391,8 @@ Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]].
            (gcc "nnimap+csclub:Sent")))))
 
 (use-feature gnus-topic
            (gcc "nnimap+csclub:Sent")))))
 
 (use-feature gnus-topic
-  :hook (gnus-group-mode . gnus-topic-mode))
+  :hook (gnus-group-mode . gnus-topic-mode)
+  :config (setq gnus-topic-line-format "%i[ %A: %(%{%n%}%) ]%v\n"))
 
 (use-feature gnus-agent
   :config
 
 (use-feature gnus-agent
   :config
@@ -2559,6 +2565,30 @@ Convenient footnotes in =message-mode=.
     (gnus-harvest-install)))
 #+end_src
 
     (gnus-harvest-install)))
 #+end_src
 
+* IRC
+:PROPERTIES:
+:CUSTOM_ID: irc
+:END:
+
+Now with ERC!
+
+#+begin_src emacs-lisp
+(use-package znc
+  :straight (:host nil :repo "https://git.bndl.org/amin/znc.el")
+  :bind (("C-c a e e" . znc-erc)
+         ("C-c a e a" . znc-all))
+  :config
+  (let ((pwd (let ((auth (auth-source-search :host "znca")))
+               (cond
+                ((null auth) (error "Couldn't find znca's authinfo"))
+                (t (funcall (plist-get (car auth) :secret)))))))
+    (setq znc-servers
+          `(("znc.bndl.org" 1337 t
+             ((freenode "amin/freenode" ,pwd)))
+            ("znc.bndl.org" 1337 t
+             ((moznet "amin/moznet" ,pwd)))))))
+#+end_src
+
 * Blogging
 :PROPERTIES:
 :CUSTOM_ID: blogging
 * Blogging
 :PROPERTIES:
 :CUSTOM_ID: blogging