/
riece-options.el
380 lines (322 loc) · 10.5 KB
/
riece-options.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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
;;; riece-options.el --- customization -*- lexical-binding: t -*-
;; Copyright (C) 1998-2003 Daiki Ueno
;; Author: Daiki Ueno <ueno@unixuser.org>
;; Created: 1998-09-28
;; Keywords: IRC, riece
;; This file is part of Riece.
;; 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 GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
(require 'riece-version)
(require 'riece-globals)
;; User modifiable variables.
(defgroup riece nil
"Riece specific customize group."
:prefix "riece-"
:group 'applications)
(defgroup riece-options nil
"Riece user customizable variables."
:prefix "riece-"
:group 'riece)
(defcustom riece-saved-forms
'(riece-server-alist
riece-channel-buffer-mode
riece-others-buffer-mode
riece-user-list-buffer-mode
riece-channel-list-buffer-mode
riece-layout
riece-addons)
"Variables saved after each session is completed."
:type 'string
:group 'riece-options)
(defcustom riece-debug nil
"If non-nil, random debug spews."
:type 'boolean
:group 'riece-options)
(defcustom riece-command-prefix "\C-c"
"Key sequence to be used as prefix for command mode key bindings."
:type 'string
:group 'riece-options)
(defgroup riece-looks nil
"Look and feel."
:prefix "riece-"
:group 'riece)
(defcustom riece-window-center-line -2
"Line number of center point in window when scrolling.
If nil, erases the entire frame and then redraws with point in the
center of the window. Negative means relative to bottom of window.
See the document of the function `recenter'."
:type 'integer
:group 'riece-looks)
(defcustom riece-directory (expand-file-name "~/.riece")
"Where to look for startup files."
:type 'directory
:group 'riece-options)
(defcustom riece-addon-directory
(expand-file-name "addons" riece-directory)
"Where to look for add-on files."
:type 'directory
:group 'riece-options)
(defcustom riece-data-directory
(if (fboundp 'locate-data-directory)
(locate-data-directory "riece")
(file-name-directory load-file-name))
"Where to look for data files."
:type 'directory
:group 'riece-options)
(defcustom riece-variables-file
(expand-file-name "init" riece-directory)
"Where to look for variables."
:type 'file
:group 'riece-options)
(defcustom riece-saved-variables-file
(expand-file-name "save" riece-directory)
"Where to look for variables.
This file was saved the last session."
:type 'file
:group 'riece-options)
(defcustom riece-variables-files
(list riece-saved-variables-file riece-variables-file)
"Where to look for variables. Helps to remove clutter from your .emacs.
This feature is most likely to dissappear in near future. The preferred
way is to put Riece variables on .emacs or file loaded from there."
:type '(repeat (file :tag "Initialization File"))
:group 'riece-options)
(defcustom riece-addons '(riece-highlight
riece-ctcp
riece-guess
riece-unread
riece-history
riece-url
riece-button
riece-menu
riece-icon
riece-ignore
riece-log
riece-toolbar
riece-alias
riece-ctlseq
riece-keyword
riece-shrink-buffer
riece-mcat)
"Add-ons insinuated into Riece."
:type '(repeat symbol)
:group 'riece-options)
(defgroup riece-server nil
"Server settings."
:prefix "riece-"
:group 'riece)
(defgroup riece-channel nil
"Channel settings."
:prefix "riece-"
:group 'riece)
(defgroup riece-coding nil
"Coding system."
:tag "Coding"
:prefix "riece-"
:group 'riece)
(defcustom riece-default-coding-system
(if (featurep 'mule)
(cons 'ctext 'iso-2022-jp-2))
"Coding system for process I/O.
The value is a coding system, or a cons cell (DECODING . ENCODING)
specifying the coding systems for decoding and encoding respectively."
:type '(choice (symbol :tag "Coding system")
(cons (symbol :tag "Input coding system")
(symbol :tag "Output coding system"))
(const nil :tag "No conversion"))
:group 'riece-coding)
(defcustom riece-server-alist nil
"An alist mapping server names to plist."
:type '(repeat
(group
(string :tag "Server")
(list :inline t :tag "Host"
:format "%{%t%}: %v"
(const :tag "" :value :host)
string)
(repeat :inline t :tag "Options"
(choice :inline t :value nil
(list :inline t :tag "Port"
:format "%{%t%}: %v"
(const :tag "" :value :service)
(choice (const :tag "Default" 6667)
integer
string))
(list :inline t :tag "Nickname"
:format "%{%t%}: %v"
(const :tag "" :value :nickname)
(choice (const :tag "Default" riece-nickname)
string))
(list :inline t :tag "Realname"
:format "%{%t%}: %v"
(const :tag "" :value :realname)
(choice (const :tag "Default" riece-realname)
string))
(list :inline t :tag "Username"
:format "%{%t%}: %v"
(const :tag "" :value :username)
(choice (const :tag "Default" riece-username)
string))
(list :inline t :tag "Password"
:format "%{%t%}: %v"
(const :tag "" :value :password)
string)
(list :inline t :tag "Function"
:format "%{%t%}: %v"
(const :tag "" :value :function)
(choice
(const :tag "Default"
riece-default-open-connection-function)
function))
(list :inline t :tag "Coding system"
:format "%{%t%}: %v"
(const :tag "" :value :coding)
(choice
(const :tag "Default"
riece-default-coding-system)
(choice
(symbol :tag "Coding system")
(cons (symbol :tag "Input coding system")
(symbol :tag "Output coding system"))
(const nil :tag "No conversion"))))))))
:group 'riece-server)
(defcustom riece-server (getenv "IRCSERVER")
"IRC server host we are connecting to."
:type 'string
:group 'riece-server)
(defcustom riece-protocol 'irc
"Protocol support."
:type 'symbol
:group 'riece-server)
(defcustom riece-max-send-size 512
"Maximum size of messages to be sent at a time."
:type 'integer
:group 'riece-server)
(defcustom riece-send-delay 2
"Duration of multiple send."
:type 'integer
:group 'riece-server)
(defcustom riece-default-password (getenv "IRCPASSWORD")
"Your password."
:type '(radio (string :tag "Password")
(const :tag "No" nil))
:group 'riece-server)
(defcustom riece-username nil
"Your login name."
:type 'string
:group 'riece-server)
(defcustom riece-realname nil
"Your user name."
:type 'string
:group 'riece-server)
(defcustom riece-nickname (or (getenv "IRCNICK")
(user-real-login-name))
"Your nickname."
:type 'string
:group 'riece-server)
(defcustom riece-startup-channel-list nil
"A list of channels to join automatically at startup."
:type '(repeat (choice (string :tag "Channel")
(list (string :tag "Channel") (string :tag "Key"))))
:group 'riece-channel)
(defcustom riece-startup-server-list nil
"A list of servers to connect automatically at startup."
:type '(repeat (string :tag "Server"))
:group 'riece-server)
(defcustom riece-retry-with-new-nickname nil
"When nickname has already been in use, grow-tail automatically."
:type 'boolean
:group 'riece-server)
(defcustom riece-quit-timeout 1
"Quit timeout when there is no response from server."
:type '(radio (integer :tag "Seconds")
(const nil))
:group 'riece-server)
(defcustom riece-default-open-connection-function #'open-network-stream
"Default function used for connecting to an IRC server."
:type 'function
:group 'riece-server)
(defcustom riece-user-cache-max-size 512
"Maximum size of cache of user names."
:type 'integer
:group 'riece-server)
(defcustom riece-channel-cache-max-size 512
"Maximum size of cache of channel names."
:type 'integer
:group 'riece-server)
(defcustom riece-channel-buffer-mode t
"When non-nil, Riece will display a channel buffer."
:type 'boolean
:group 'riece-looks)
(defcustom riece-others-buffer-mode t
"When non-nil, Riece will display an \"*Others*\" buffer."
:type 'boolean
:group 'riece-looks)
(defcustom riece-user-list-buffer-mode t
"When non-nil, Riece will display a nick list buffer."
:type 'boolean
:group 'riece-looks)
(defcustom riece-channel-list-buffer-mode t
"When non-nil, Riece will display a channel list buffer."
:type 'boolean
:group 'riece-looks)
(defcustom riece-default-freeze nil
"Channel buffer local freeze flag is on at starting."
:type 'boolean
:group 'riece-looks)
(defcustom riece-default-channel-binding nil
"The channel list to bind the channel number when joining."
:type '(repeat (radio (string :tag "Bound Channel")
(const nil)))
:group 'riece-channel)
(defcustom riece-blink-parens nil
"Should we blink matching parenthesis in the command buffer?"
:type 'boolean
:group 'riece-options)
(defcustom riece-quit-message (riece-extended-version)
"Default quit message."
:type '(string :tag "Quit message")
:group 'riece-options)
(defcustom riece-part-message nil
"Default part message."
:type '(choice (const :tag "No message" nil)
(string :tag "Part message"))
:group 'riece-options)
(defcustom riece-away-message "Gone"
"Default away message."
:type '(string :tag "Away message")
:group 'riece-options)
(defcustom riece-gather-channel-modes nil
"If non-nil, gather channel modes when we join a channel."
:type 'boolean
:group 'riece-options)
(defcustom riece-buffer-dispose-function #'kill-buffer
"Function called after the buffer was disposed."
:type 'function
:group 'riece-options)
(defcustom riece-format-time-function #'current-time-string
"Function to convert the specified time to the human readable form."
:type 'function
:group 'riece-options)
(defcustom riece-hide-list '()
"Whether to hide certain server messages.
Currently supported are join, part, and quit messages.
This is a list of up to 3 symbols, namely: `joins', `parts',
`quits'."
:type '(set (symbol :tag "Hide Joins" joins)
(symbol :tag "Hide Parts" parts)
(symbol :tag "Hide Quits" quits))
:group 'riece-options)
(provide 'riece-options)
;;; riece-options.el ends here