-
Notifications
You must be signed in to change notification settings - Fork 0
/
emacs-erc.el
84 lines (68 loc) · 2.22 KB
/
emacs-erc.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
(require 'erc)
(require 'erc-join)
(require 'cl)
(require 'pjb-cl)
(require 'tls)
(defparameter *pjb-autojoin-channels-alist*
'(("libera.chat"
"#lisp"
"#clschool"
"#abcl" "#ccl" "#ecl" "#sicl"
"#clim" "#slime" "#nyxt"
"#cl-naive"
"#clergo"
"#emacs" "#org-mode" "#erc"
"#hn" "#space" "#tesla" "#teslamotors"
)))
(setf erc-autojoin-channels-alist *pjb-autojoin-channels-alist*)
(defun pjb-join-channels ()
(interactive)
;; (when (buffer-named "irc.freenode.org:6667")
;; (with-current-buffer "irc.freenode.org:6667"
;; (mapcar 'erc-join-channel
;; (cdr (assoc "freenode.org" *pjb-autojoin-channels-alist*)))))
(let ((irc (or (buffer-named "irc.libera.chat:6697")
(buffer-named "libera"))))
(when irc
(with-current-buffer irc
(mapcar 'erc-join-channel
(cdr (assoc "libera.chat" *pjb-autojoin-channels-alist*)))))))
(defvar *erc-cmd-BR-line* (make-string 72 ?=))
(defun erc-cmd-BR (&optional filler)
"Inserts a line."
(let ((inhibit-read-only t)
(line (cond
((characterp filler) (make-string 72 filler))
((stringp filler) (with-output-to-string
(loop repeat (ceiling 72 (length filler))
do (write-string filler))))
(t *erc-cmd-BR-line*))))
(erc-display-line (erc-make-notice line) 'active))
t)
(put 'erc-cmd-BR 'process-not-needed t)
(defun pjb-erc-clear-all-buffers ()
(interactive)
(dolist (buf (erc-buffer-list))
(with-current-buffer buf
(erc-cmd-CLEAR)
(bury-buffer))))
(defun start-irc ()
"Connect to IRC."
(interactive)
(erc-tls :server "irc.libera.chat" :port 6697
:nick "pjb" :full-name "Pascal J. Bourguignon"))
(defun start-irc-ogamita ()
"Connect to IRC."
(interactive)
(erc-tls :server "irc.libera.chat" :port 6697
:nick "ogamita" :full-name "Pascal J. Bourguignon"))
(defun br-all ()
(interactive)
(dolist (buffer (erc-buffer-list))
(with-current-buffer buffer
(erc-set-active-buffer buffer)
(erc-cmd-BR))))
;; Local Variables:
;; coding: utf-8
;; eval: (flycheck-mode -1)
;; End: