A few small accumulated changes
[~bandali/configs] / lisp / bandali-erc.el
CommitLineData
4c05c418
AB
1;;; bandali-erc.el --- bandali's ERC setup -*- lexical-binding: t; -*-
2
3;; Copyright (C) 2018-2020 Amin Bandali
4
5;; Author: Amin Bandali <bandali@gnu.org>
6;; Keywords: tools
7
8;; This program is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation, either version 3 of the License, or
11;; (at your option) any later version.
12
13;; This program is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details.
17
18;; You should have received a copy of the GNU General Public License
19;; along with this program. If not, see <https://www.gnu.org/licenses/>.
20
21;;; Commentary:
22
23;; My ERC setup for IRC. It uses my fork of ZNC.el.
24
25;;; Code:
26
39c1c073 27(use-package erc
5361eed6 28 :bind ("C-c w e" . erc-switch-to-buffer-other-window)
39c1c073 29 :custom
b0e197de 30 (erc-auto-query 'bury)
e3e01ce1
AB
31 (erc-autojoin-domain-only nil)
32 (erc-format-nick-function 'erc-format-@nick)
39c1c073
AB
33 (erc-join-buffer 'bury)
34 (erc-lurker-hide-list '("JOIN" "PART" "QUIT"))
35 (erc-nick "bandali")
36 (erc-prompt "erc>")
37 (erc-rename-buffers t)
38 (erc-server-reconnect-attempts 5)
39 (erc-server-reconnect-timeout 3)
40 :config
5361eed6
AB
41 (declare-function erc-message "erc-backend"
42 (message-command line &optional force))
43 (declare-function erc-default-target "erc")
44 (declare-function erc-current-nick "erc")
39c1c073
AB
45 (defun erc-cmd-OPME ()
46 "Request chanserv to op me."
47 (erc-message "PRIVMSG"
48 (format "chanserv op %s %s"
49 (erc-default-target)
50 (erc-current-nick)) nil))
5361eed6 51 (declare-function erc-cmd-DEOP "erc" (&rest people))
39c1c073
AB
52 (defun erc-cmd-DEOPME ()
53 "Deop myself from current channel."
54 (erc-cmd-DEOP (format "%s" (erc-current-nick))))
55 (add-to-list 'erc-modules 'keep-place)
56 (add-to-list 'erc-modules 'notifications)
57 (add-to-list 'erc-modules 'smiley)
58 (add-to-list 'erc-modules 'spelling)
5361eed6 59 (declare-function erc-update-modules "erc")
39c1c073
AB
60 (erc-update-modules))
61
62(use-package erc-fill
63 :after erc
64 :custom
65 (erc-fill-column 77)
66 (erc-fill-function 'erc-fill-static)
67 (erc-fill-static-center 18))
68
e3e01ce1 69(use-package erc-match
7c558c9b 70 :disabled
e3e01ce1 71 :after erc
b0e197de
AB
72 :config
73 (set-face-attribute
74 'erc-pal-face nil
75 :foreground 'unspecified
76 :weight 'unspecified
77 ;; :inherit 'font-lock-string-face
78 ;; :background (face-attribute 'font-lock-string-face :background)
79 :background "#ffffed")
e3e01ce1 80 :custom
b0e197de 81 (erc-pal-highlight-type 'message)
e3e01ce1
AB
82 (erc-pals
83 '("aindilis" "blackbeard" "bremner" "brettgilio" "civodul" "dto"
84 "ggoes" "jrasata" "jxself" "mplsCorwin" "quiliro" "rindolf" "rwp"
85 "sachac" "technomancy")))
86
39c1c073
AB
87(use-package erc-pcomplete
88 :after erc
89 :custom
90 (erc-pcomplete-nick-postfix ", "))
91
92(use-package erc-track
93 :after erc
94 :bind (("C-c a e t d" . erc-track-disable)
5361eed6
AB
95 ("C-c a e t e" . erc-track-enable)
96 ("C-c a e M-a" . erc-track-switch-buffer-other-window)
97 :map erc-mode-map
98 ("M-a" . erc-track-switch-buffer))
39c1c073
AB
99 :custom
100 (erc-track-enable-keybindings nil)
101 (erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT"
102 "324" "329" "332" "333" "353" "477"))
103 (erc-track-position-in-mode-line t)
104 (erc-track-priority-faces-only 'all)
e3e01ce1
AB
105 (erc-track-shorten-function nil)
106 (erc-track-showcount t))
39c1c073
AB
107
108(use-package erc-hl-nicks
109 :after erc)
110
39c1c073
AB
111(use-package znc
112 :bind (("C-c a e e" . znc-erc)
113 ("C-c a e a" . znc-all))
114 :config
115 (let ((pwd (let ((auth (auth-source-search :host "znca")))
116 (cond
117 ((null auth) (error "Couldn't find znca's authinfo"))
118 (t (funcall (plist-get (car auth) :secret)))))))
119 (setq znc-servers
6b09fc8a
AB
120 `(("znc.emacsconf.org" 6697 t
121 ((freenode "bandali/freenode" ,pwd)))
122 ("znc.emacsconf.org" 6697 t
b0e197de
AB
123 ((oftc "bandali/oftc" ,pwd)))
124 ("znc.emacsconf.org" 6697 t
125 ((tildechat "bandali/tildechat" ,pwd)))))))
39c1c073
AB
126
127(provide 'bandali-erc)
4c05c418 128;;; bandali-erc.el ends here