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 (defvar b
/erc-detach-on-kill t
28 "Whether killing a channel should send a DETACH command (for ZNC).")
30 (with-eval-after-load 'erc
31 (make-directory (b/var
"erc/dcc/") t
)
34 erc-autojoin-domain-only nil
35 erc-dcc-get-default-directory
(b/var
"erc/dcc/")
36 erc-format-nick-function
'erc-format-
@nick
38 erc-log-channels-directory
(b/var
"erc/log-channels/")
39 erc-lurker-hide-list
'("JOIN" "PART" "QUIT")
42 erc-prompt-for-password nil
44 erc-server-reconnect-attempts
5
45 erc-server-reconnect-timeout
3)
47 (declare-function erc-message
"erc-backend"
48 (message-command line
&optional force
))
49 (declare-function erc-default-target
"erc")
50 (declare-function erc-current-nick
"erc")
51 (defun erc-cmd-OPME ()
52 "Request chanserv to op me."
53 (erc-message "PRIVMSG"
54 (format "chanserv op %s %s"
58 (declare-function erc-cmd-DEOP
"erc" (&rest people
))
59 (defun erc-cmd-DEOPME ()
60 "Deop myself from current channel."
61 (erc-cmd-DEOP (format "%s" (erc-current-nick))))
62 (add-to-list 'erc-modules
'keep-place
)
63 (when (display-graphic-p)
64 (add-to-list 'erc-modules
'notifications
))
65 (add-to-list 'erc-modules
'smiley
)
66 (add-to-list 'erc-modules
'spelling
)
67 (declare-function erc-update-modules
"erc")
71 'erc-nick-default-face nil
73 ;; :background "#f2f2f2"
74 ;; :foreground "#222222"
77 :foreground
"#6a6a6a")
79 ;; (set-face-attribute
80 ;; 'erc-notice-face nil
81 ;; ;; :background "#fffadf"
82 ;; ;; :background "#f9f9f9"
83 ;; :background 'unspecified
84 ;; ;; :foreground "#809de5"
85 ;; :foreground "steel blue")
90 ;; erc-fill-function 'erc-fill-variable
91 ;; erc-fill-static-center 18)
97 erc-pal-highlight-type
'nick
99 '("aindilis" "blackbeard" "bremner" "~brettgilio?@*" "civodul"
100 "dto" "ggoes" "iank" "jrasata" "mplsCorwin" "quidam" "rwp"
101 "sachac" "sudoman" "technomancy"))
102 (with-eval-after-load 'erc-match
105 :foreground
'unspecified
107 :inherit
'erc-nick-default-face
108 :background
(face-attribute 'font-lock-string-face
:background
)))
111 (csetq erc-pcomplete-nick-postfix
",")
114 (csetq erc-timestamp-only-if-changed-flag nil
115 erc-timestamp-format
"%T "
116 erc-insert-timestamp-function
'erc-insert-timestamp-left
)
117 (with-eval-after-load 'erc-match
119 'erc-timestamp-face nil
120 :foreground
"#aaaaaa"
122 :background
'unspecified
))
126 erc-track-enable-keybindings nil
127 erc-track-exclude-types
'("JOIN" "MODE" "NICK" "PART" "QUIT"
128 "324" "329" "332" "333" "353" "477")
129 erc-track-position-in-mode-line t
130 erc-track-priority-faces-only
'all
131 erc-track-shorten-function nil
132 erc-track-showcount t
)
135 (global-set-key (kbd "C-c w e") #'erc-switch-to-buffer-other-window
)
136 (define-key erc-mode-map
(kbd "M-a") #'erc-track-switch-buffer
)
139 (defun b/erc-detach-or-kill-channel
()
140 (if b
/erc-detach-on-kill
141 (when (erc-server-process-alive)
142 (let ((tgt (erc-default-target)))
143 (erc-server-send (format "DETACH %s" tgt
) nil tgt
)))
145 (add-hook 'erc-kill-channel-hook
#'b
/erc-detach-or-kill-channel
)
146 (remove-hook 'erc-kill-channel-hook
#'erc-kill-channel
))
148 ;; global key bindings
153 (let* ((auth (auth-source-search :host
"znca"))
155 (error "Couldn't find znca's authinfo")
156 (funcall (plist-get (car auth
) :secret
)))))
157 (erc-tls :server
"znc.emacsconf.org" :port
6697
158 :password
(concat "bandali/freenode:" p
)))))
163 (let* ((auth (auth-source-search :host
"znca"))
165 (error "Couldn't find znca's authinfo")
166 (funcall (plist-get (car auth
) :secret
)))))
167 (erc-tls :server
"znc.emacsconf.org" :port
6697
168 :password
(concat "bandali/oftc:" p
)))))
173 (let* ((auth (auth-source-search :host
"znca"))
175 (error "Couldn't find znca's authinfo")
176 (funcall (plist-get (car auth
) :secret
)))))
177 (erc-tls :server
"znc.emacsconf.org" :port
6697
178 :password
(concat "bandali/tildechat:" p
)))))
180 (provide 'bandali-erc
)
181 ;;; bandali-erc.el ends here