1 ;;; bandali-erc.el --- bandali's ERC setup -*- lexical-binding: t; -*-
3 ;; Copyright (C) 2018-2020 Amin Bandali
5 ;; Author: Amin Bandali <bandali@gnu.org>
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.
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.
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/>.
23 ;; My ERC setup for IRC. It uses my fork of ZNC.el.
27 (with-eval-after-load 'erc
30 erc-autojoin-domain-only nil
31 erc-format-nick-function
'erc-format-
@nick
33 erc-lurker-hide-list
'("JOIN" "PART" "QUIT")
37 erc-server-reconnect-attempts
5
38 erc-server-reconnect-timeout
3)
40 (declare-function erc-message
"erc-backend"
41 (message-command line
&optional force
))
42 (declare-function erc-default-target
"erc")
43 (declare-function erc-current-nick
"erc")
44 (defun erc-cmd-OPME ()
45 "Request chanserv to op me."
46 (erc-message "PRIVMSG"
47 (format "chanserv op %s %s"
49 (erc-current-nick)) nil
))
50 (declare-function erc-cmd-DEOP
"erc" (&rest people
))
51 (defun erc-cmd-DEOPME ()
52 "Deop myself from current channel."
53 (erc-cmd-DEOP (format "%s" (erc-current-nick))))
54 (add-to-list 'erc-modules
'keep-place
)
55 (add-to-list 'erc-modules
'notifications
)
56 (add-to-list 'erc-modules
'smiley
)
57 (add-to-list 'erc-modules
'spelling
)
58 (declare-function erc-update-modules
"erc")
64 erc-fill-function
'erc-fill-static
65 erc-fill-static-center
18)
69 ;; erc-pal-highlight-type 'message
71 ;; '("aindilis" "blackbeard" "bremner" "brettgilio" "civodul" "dto"
72 ;; "ggoes" "jrasata" "jxself" "mplsCorwin" "quiliro" "rindolf" "rwp"
73 ;; "sachac" "technomancy"))
74 ;; (with-eval-after-load 'erc-match
75 ;; (set-face-attribute
77 ;; :foreground 'unspecified
78 ;; :weight 'unspecified
79 ;; ;; :inherit 'font-lock-string-face
80 ;; ;; :background (face-attribute 'font-lock-string-face :background)
81 ;; :background "#ffffed"))
84 (csetq erc-pcomplete-nick-postfix
", ")
88 erc-track-enable-keybindings nil
89 erc-track-exclude-types
'("JOIN" "MODE" "NICK" "PART" "QUIT"
90 "324" "329" "332" "333" "353" "477")
91 erc-track-position-in-mode-line t
92 erc-track-priority-faces-only
'all
93 erc-track-shorten-function nil
94 erc-track-showcount t
)
97 (global-set-key (kbd "C-c w e") #'erc-switch-to-buffer-other-window
)
98 (define-key erc-mode-map
(kbd "M-a") #'erc-track-switch-buffer
))
100 (with-eval-after-load 'znc
101 (let ((pwd (let ((auth (auth-source-search :host
"znca")))
103 ((null auth
) (error "Couldn't find znca's authinfo"))
104 (t (funcall (plist-get (car auth
) :secret
)))))))
106 `(("znc.emacsconf.org" 6697 t
107 ((freenode "bandali/freenode" ,pwd
)))
108 ("znc.emacsconf.org" 6697 t
109 ((oftc "bandali/oftc" ,pwd
)))
110 ("znc.emacsconf.org" 6697 t
111 ((tildechat "bandali/tildechat" ,pwd
)))))))
112 ;; global key bindings
113 (global-set-key (kbd "C-c a e e") #'znc-erc
)
114 (global-set-key (kbd "C-c a e a") #'znc-all
)
116 (provide 'bandali-erc
)
117 ;;; bandali-erc.el ends here