-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zenirc.el
277 lines (221 loc) · 10.4 KB
/
.zenirc.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
;;;
;;;
;;; zenirc-example.el --- Example customizations for zenirc.el
;;; Copyright (C) 1993, 1994 Ben A. Mesander
;;; Copyright (C) 1993, 1994, 1996, 1997, 1998 Per Persson
;;; Author: Ben A. Mesander <[email protected]>
;;; Per Persson <[email protected]>
;;; Maintainer: Per Persson <[email protected]>
;;; Keywords: extensions
;;; Created: 1993/06/03
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2, or (at your option)
;;; any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, you can either send email to this
;;; program's maintainer or write to: The Free Software Foundation,
;;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
;;; Commentary:
;; A good way to use this is to add something like
;; (autoload 'zenirc "/home/pp/.zenirc-example" "Major mode to waste time" t)
;; to your ~/.emacs file. Then edit and copy this file there. If you do that
;; you also need to uncomment the last line of this file.
;; if the autoload says ".zenirc-example", the file needs to be named
;; ".zenirc-example.el", this is probably the best way for you to name
;; it. (sure, go ahead and rename it, don't blame me).
;; Also take a look on all the different scripts not mentioned in this file,
;; they might give you something you'll love.
;;; Code:
;; this is a list of IRC servers you use
;; it consists of servername, portnumber, password, nickname, username
(setq zenirc-server-alist
'(("irc.tc.umn.edu")
("cs-pub.bu.edu" 6666)
("irc.stealth.net" 6667 nil "ben" "oedipus rpc.rexd")))
;; this is what you reply to CTCP USERINFO
(setq zenirc-userinfo "Oink.")
;; this is a list of annoying things to ignore. This list ignores
;; messages from nickserv, anything with the word "fnord" in it,
;; messages from the major dweeb craig and everything with more then
;; four CTCPs in it.
(setq zenirc-ignore-list
'("^:[email protected]" "fnord"
"\C-a[^\C-a]*\C-a[^\C-a]*\C-a[^\C-a]*\C-a[^\C-a]*\C-a[^\C-a]*\C-a[^\C-a]*\C-a[^\C-a]*\C-a[^\C-a]*\C-a"))
;; zenirc can beep when it notices something,
;; nil -> never beep
;; t -> beep when message not seen
;; 'always -> beep on all signals
(setq zenirc-beep-on-signal nil)
;; with zenirc-beep-on-signal turned on,
;; this will make zenirc beep when it sees a ^G ala ircII and when you recieve
;; a private PRIVMSG
;(setq zenirc-signal-list '(""
; "^\\([^ ]\\)* PRIVMSG [^#&+]\\([^ ]\\)* :"))
;; this is how you want ZenIRC to send confirmations
;; "nil" is no confirmation
;; "t" is confirmation in buffer
;; "'message" is confirmation in echo area
(setq zenirc-send-confirmation t)
;; if you want timestamps on PRIVMSG/NOTICE or not
;; with default prefix and suffix it looks like
;; *ben[13:31]* lets have some fun
;; <ben#twilight_zone[13:32]> SLUGS AND KNIGHTS! SLUGS AND KNIGTS!
(setq zenirc-timestamp nil
zenirc-timestamp-prefix "["
zenirc-timestamp-suffix "]")
;; in ircII, the channelname isn't shown in PRIVMSGs if you're currently
;; talking to the channel, setting zenirc-always-show-channelname to nil
;; gives you the same effect.
(setq zenirc-always-show-channelname nil)
;; if WHOIS returns no-such-nick, setting this variable to t will make
;; the client automaticall issue an WHOWAS command
(setq zenirc-whowas-on-401 nil)
;; setting this variable to t will make ZenIRC remove preceding whitespaces
;; before a command, that is;
;; /whois omnion
;; will turn in to;
;; /whois omnion
;; but;
;; oink!
;; will turn in to;
;; oink!
;; yeah, there's no difference there.
(setq zenirc-delete-preceding-whitespaces nil)
;; if you want ZenIRC to send out ERRMSG on bogus CTCP queries
(setq zenirc-send-ctcp-errmsg-on-unknown t)
;; if you awnt ZenIRC to send out ERRMSG on unbalanced CTCP queries
(setq zenirc-send-ctcp-errmsg-on-unbalanced t)
;; if you want ZenIRC to tell you when send out CTCP replies
(setq zenirc-verbose-ctcp t)
;; what ZenIRC replies on CTCP FINGER
(setq zenirc-fingerdata
(format "%s <%s@%s>" (user-full-name) (user-real-login-name)
(system-name)))
;; commandkey in ZenIRC
(setq zenirc-command-char ?/)
;;; use the following to surpress AWAY info if seen more then once
;(load-library "zenirc-away")
;;; use the following to make ZenIRC queue commands for you, to get around
;;; stupid flood controls
;(load-library "zenirc-command-queue")
;;; use the following to have tab-completion in ZenIRC
;(load-library "zenirc-complete")
;;; use the following to be able to act upon DCC CHAT and DCC SEND requests
;(load-library "zenirc-dcc")
;;; use the following to make ZenIRC fill incoming messages for you
;; if ZenIRC should fill incoming lines
(setq zenirc-fill-mode t)
;; if ZenIRC should fill outgoing lines
(setq zenirc-fill-outgoing-mode t)
;; how ZenIRC should fill things
;; (zenirc-wrap-region) adds zenirc-fill-prefix on each line
;(setq zenirc-fill-region-function 'zenirc-wrap-region)
;(setq zenirc-fill-prefix " ")
;; (zenirc-wrap-region-dynamic) adds spaces at beginning of line,
;; depending on length of first word
;(setq zenirc-fill-region-function 'zenric-wrap-region-dynamic)
;; (zenirc-wrap-region-static) adds spaces uses zenirc-fill-static
;; columns to the left to display <nick#channel> and the rest to
;; actual messages.
;(setq zenirc-fill-region-function 'zenirc-wrap-region-static)
;(setq zenirc-fill-static 26)
;(load-library "zenirc-fill")
;;; use the following to make ZenIRC format things like no-other-client
;;; is able to. the first time a nick is seen, it's shown as
;;; `nick!user@host'... after the first time it's just shown as `nick'
;;; until the `user@host' part changes.
(load-library "zenirc-format")
;;; use the following to get history functions on C-cC-p and C-cC-n
;(load-library "zenirc-history")
;;; use the following to get an ircII like /ignore command
;(load-library "zenirc-ignore")
;;; use the following to make ZenIRC output netsplits/netjoins nicer
(load-library "zenirc-netsplit")
;;; use the following to get an ircII like /notify command
;; a list of notificated people
;(setq zenirc-notify-list
; '("oddy" "piker" "flashman"))
;(load-library "zenirc-notify")
;;; use the following to make ZenIRC popup buffers when things happen
;(load-library "zenirc-popup")
;;; use the following if you want ZenIRC to act automatically when it
;;; sees a certain string in a PRIVMSG. if this sounds interesting, read
;;; the comments in zenirc-trigger.el and take a look at zenirc-yow.el,
;;; zenirc-oink.el, zenirc-meditate.el, zenirc-8ball.el, zenirc-shop.el
;;; and zenirc-fortran.el
;(load-library "zenirc-trigger")
;; the following is an example of how to do something during initializing a
;; server connection. 001 is the first thing the server sends to a client
;; after the client sends USER and NICK.
;;
;; :pfawww.pp.se 001 Omnion :Welcome to the Internet Relay Network Omnion
;;
;; current code from Eric Prestemon <[email protected]>
(defvar zenirc-startup-channels-alist '(("debian" . "#debian")
("uoknor.edu" . nil)
(".*" . "#ta")
(".*" . "#perl"))
"*Pairs of server and channels.
server is a regexp
channels is a comma separated string of channels to join during
startup where nil means none")
(defun zenirc-startup-join (proc parsedmsg)
(let ((channelpairs (copy-alist zenirc-startup-channels-alist)))
(while channelpairs
(if (string-match (car (car channelpairs)) zenirc-server)
(progn
(if (cdr (car channelpairs))
(process-send-string proc
(concat "JOIN "
(cdr (car channelpairs))
"\n")))
(setq channelpairs nil))
(setq channelpairs (cdr channelpairs))))))
(zenirc-add-hook 'zenirc-server-001-hook 'zenirc-startup-join)
;;
;; the following is an example of adding a new ctcp reply type to zenirc.
;; in this case, it is "BOZOS", which returns a list of people who have
;; been bozotic with me
;;
;; create a hook to be called and assign it a default value
(defvar zenirc-ctcp-query-BOZOS-hook '(zenirc-ctcp-query-BOZOS))
(setq zenirc-clientinfo-list
'((ACTION . "ACTION contains action descriptions for atmosphere")
;; this is the addition to the default list
(BOZOS . "BOZOS returns a list of people who have been bozotic with me")
(CLIENTINFO . "CLIENTINFO gives information about available CTCP commands")
(ERRMSG . "ERRMSG returns error messages")
(PING . "PING returns the arguments it receives")
(FINGER . "FINGER shows real name, and login name of user (idle time is not yet implemented in ZenIRC)")
;; sojge sure is a wordy bastard.
(SOURCE . "takes 0 arguments and returns a description of where to find the source code of the client. The description is made up out of zero or more lines followed by an end marker. Every line is a CTCP reply with the SOURCE keyword, a space, the name of a FTP-server, a colon, a directory name, a colon, and 0 or more file names. If no file names are given, all the files in the named directory are needed. The end marker contains just the keyword.")
(TIME . "TIME tells you the time on the user's host")
(USERINFO . "USERINFO returns user settable information")
(VERSION . "VERSION shows client type, version, and environment")))
;; note addition of BOZOS--------------*****
(setq zenirc-clientinfo-string "ACTION BOZOS CLIENTINFO ERRMSG FINGER PING SOURCE TIME USERINFO VERSION :Use CLIENTINFO <COMMAND> to get more specific information")
;;
;; this is the handler for a CTCP BOZOS query
;;
(defun zenirc-ctcp-query-BOZOS (proc parsedctcp from to)
;; if verbose ctcp is on, tell the user we got the query
(if zenirc-verbose-ctcp
(zenirc-message
proc
(format "[info] responding to BOZOS query from %s to %s\n"
(zenirc-run-hook 'zenirc-format-nickuserhost-hook from) to)))
;; send a reply to the BOZOS query
(process-send-string
proc
(concat "NOTICE " (zenirc-extract-nick from)
" :\C-aBOZOS phone poxav veep noah rmtodd dmarcher lila neil notused laura w jason belladona mycroft amazin CHRISTIAN omnion fn vuori nap\C-a\n")))
;; this is the second last line of the file, the next line is the last one
(require 'zenirc)