Fix typo.
[riece] / lisp / riece-options.el
1 ;;; riece-options.el --- customization
2 ;; Copyright (C) 1998-2003 Daiki Ueno
3
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
5 ;; Created: 1998-09-28
6 ;; Keywords: IRC, riece
7
8 ;; This file is part of Riece.
9
10 ;; This program is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; This program is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
24
25 ;;; Code:
26
27 (require 'riece-version)
28 (require 'riece-globals)
29
30 ;; User modifiable variables.
31 (defgroup riece nil
32   "Riece specific customize group."
33   :prefix "riece-"
34   :group 'applications)
35
36 (defgroup riece-options nil
37   "Riece user customizable variables."
38   :prefix "riece-"
39   :group 'riece)
40
41 (defcustom riece-saved-forms
42   '(riece-server-alist
43     riece-channel-buffer-mode
44     riece-others-buffer-mode
45     riece-user-list-buffer-mode
46     riece-channel-list-buffer-mode
47     riece-layout
48     riece-addons)
49   "Variables saved after each session is completed."
50   :type 'string
51   :group 'riece-options)
52
53 (defcustom riece-debug nil
54   "If non-nil, random debug spews."
55   :type 'boolean
56   :group 'riece-options)
57
58 (defcustom riece-command-prefix "\C-c"
59   "Key sequence to be used as prefix for command mode key bindings."
60   :type 'string
61   :group 'riece-options)
62
63 (defgroup riece-looks nil
64   "Look and feel."
65   :prefix "riece-"
66   :group 'riece)
67
68 (defcustom riece-window-center-line -2
69   "Line number of center point in window when scrolling.
70 If nil, erases the entire frame and then redraws with point in the
71 center of the window.  Negative means relative to bottom of window.
72 See the document of the function `recenter'."
73   :type 'integer
74   :group 'riece-looks)
75
76 (defcustom riece-directory (expand-file-name "~/.riece")
77   "Where to look for startup files."
78   :type 'directory
79   :group 'riece-options)
80
81 (defcustom riece-addon-directory
82   (expand-file-name "addons" riece-directory)
83   "Where to look for add-on files."
84   :type 'directory
85   :group 'riece-options)
86
87 (defcustom riece-data-directory
88   (if (fboundp 'locate-data-directory)
89       (locate-data-directory "riece")
90     (file-name-directory load-file-name))
91   "Where to look for data files."
92   :type 'directory
93   :group 'riece-options)
94
95 (defcustom riece-variables-file
96   (expand-file-name "init" riece-directory)
97   "Where to look for variables."
98   :type 'file
99   :group 'riece-options)
100
101 (defcustom riece-saved-variables-file
102   (expand-file-name "save" riece-directory)
103   "Where to look for variables.
104 This file was saved the last session."
105   :type 'file
106   :group 'riece-options)
107
108 (defcustom riece-variables-files
109   (list riece-saved-variables-file riece-variables-file)
110   "Where to look for variables.  Helps to remove clutter from your .emacs.
111 This feature is most likely to dissappear in near future.  The preferred
112 way is to put Riece variables on .emacs or file loaded from there."
113   :type '(repeat (file :tag "Initialization File"))
114   :group 'riece-options)
115
116 (defcustom riece-addons '(riece-highlight
117                           riece-ctcp
118                           riece-guess
119                           riece-unread
120                           riece-history
121                           riece-url
122                           riece-button
123                           riece-menu
124                           riece-icon
125                           riece-ignore
126                           riece-log
127                           riece-toolbar
128                           riece-alias
129                           riece-ctlseq
130                           riece-keyword
131                           riece-shrink-buffer
132                           riece-mcat)
133   "Add-ons insinuated into Riece."
134   :type '(repeat symbol)
135   :group 'riece-options)
136
137 (defgroup riece-server nil
138   "Server settings."
139   :prefix "riece-"
140   :group 'riece)
141
142 (defgroup riece-channel nil
143   "Channel settings."
144   :prefix "riece-"
145   :group 'riece)
146
147 (defgroup riece-coding nil
148   "Coding system."
149   :tag "Coding"
150   :prefix "riece-"
151   :group 'riece)
152
153 (defcustom riece-default-coding-system
154   (if (featurep 'mule)
155       (cons 'ctext 'iso-2022-jp-2))
156   "Coding system for process I/O.
157 The value is a coding system, or a cons cell (DECODING . ENCODING)
158 specifying the coding systems for decoding and encoding respectively."
159   :type '(choice (symbol :tag "Coding system")
160                  (cons (symbol :tag "Input coding system")
161                        (symbol :tag "Output coding system"))
162                  (const nil :tag "No conversion"))
163   :group 'riece-coding)
164
165 (defcustom riece-server-alist nil
166   "An alist mapping server names to plist."
167   :type '(repeat
168           (group
169            (string :tag "Server")
170            (list :inline t :tag "Host"
171                  :format "%{%t%}: %v"
172                  (const :tag "" :value :host)
173                  string)
174            (repeat :inline t :tag "Options"
175                    (choice :inline t :value nil
176                            (list :inline t :tag "Port"
177                                  :format "%{%t%}: %v"
178                                  (const :tag "" :value :service)
179                                  (choice (const :tag "Default" 6667)
180                                          integer
181                                          string))
182                            (list :inline t :tag "Nickname"
183                                  :format "%{%t%}: %v"
184                                  (const :tag "" :value :nickname)
185                                  (choice (const :tag "Default" riece-nickname)
186                                          string))
187                            (list :inline t :tag "Realname"
188                                  :format "%{%t%}: %v"
189                                  (const :tag "" :value :realname)
190                                  (choice (const :tag "Default" riece-realname)
191                                          string))
192                            (list :inline t :tag "Username"
193                                  :format "%{%t%}: %v"
194                                  (const :tag "" :value :username)
195                                  (choice (const :tag "Default" riece-username)
196                                          string))
197                            (list :inline t :tag "Password"
198                                  :format "%{%t%}: %v"
199                                  (const :tag "" :value :password)
200                                  string)
201                            (list :inline t :tag "Function"
202                                  :format "%{%t%}: %v"
203                                  (const :tag "" :value :function)
204                                  (choice
205                                   (const :tag "Default"
206                                          riece-default-open-connection-function)
207                                   function))
208                            (list :inline t :tag "Coding system"
209                                  :format "%{%t%}: %v"
210                                  (const :tag "" :value :coding)
211                                  (choice
212                                   (const :tag "Default"
213                                          riece-default-coding-system)
214                                   (choice
215                                    (symbol :tag "Coding system")
216                                    (cons (symbol :tag "Input coding system")
217                                          (symbol :tag "Output coding system"))
218                                    (const nil :tag "No conversion"))))))))
219   :group 'riece-server)
220
221 (defcustom riece-server (getenv "IRCSERVER")
222   "IRC server host we are connecting to."
223   :type 'string
224   :group 'riece-server)
225
226 (defcustom riece-protocol 'irc
227   "Protocol support."
228   :type 'symbol
229   :group 'riece-server)
230
231 (defcustom riece-max-send-size 512
232   "Maximum size of messages to be sent at a time."
233   :type 'integer
234   :group 'riece-server)
235
236 (defcustom riece-send-delay 2
237   "Duration of multiple send."
238   :type 'integer
239   :group 'riece-server)
240   
241 (defcustom riece-default-password (getenv "IRCPASSWORD")
242   "Your password."
243   :type '(radio (string :tag "Password")
244                 (const :tag "No" nil))
245   :group 'riece-server)
246
247 (defcustom riece-username nil
248   "Your login name."
249   :type 'string
250   :group 'riece-server)
251
252 (defcustom riece-realname nil
253   "Your user name."
254   :type 'string
255   :group 'riece-server)
256
257 (defcustom riece-nickname (or (getenv "IRCNICK")
258                               (user-real-login-name))
259   "Your nickname."
260   :type 'string
261   :group 'riece-server)
262
263 (defcustom riece-startup-channel-list nil
264   "A list of channels to join automatically at startup."
265   :type '(repeat (choice (string :tag "Channel")
266                          (list (string :tag "Channel") (string :tag "Key"))))
267   :group 'riece-channel)
268
269 (defcustom riece-startup-server-list nil
270   "A list of servers to connect automatically at startup."
271   :type '(repeat (string :tag "Server"))
272   :group 'riece-server)
273
274 (defcustom riece-retry-with-new-nickname nil
275   "When nickname has already been in use, grow-tail automatically."
276   :type 'boolean
277   :group 'riece-server)
278
279 (defcustom riece-quit-timeout 1
280   "Quit timeout when there is no response from server."
281   :type '(radio (integer :tag "Seconds")
282                 (const nil))
283   :group 'riece-server)
284
285 (defcustom riece-default-open-connection-function #'open-network-stream
286   "Default function used for connecting to an IRC server."
287   :type 'function
288   :group 'riece-server)
289
290 (defcustom riece-user-cache-max-size 512
291   "Maximum size of cache of user names."
292   :type 'integer
293   :group 'riece-server)
294
295 (defcustom riece-channel-cache-max-size 512
296   "Maximum size of cache of channel names."
297   :type 'integer
298   :group 'riece-server)
299
300 (defcustom riece-channel-buffer-mode t
301   "When non-nil, Riece will display a channel buffer."
302   :type 'boolean
303   :group 'riece-looks)
304
305 (defcustom riece-others-buffer-mode t
306   "When non-nil, Riece will display an \"*Others*\" buffer."
307   :type 'boolean
308   :group 'riece-looks)
309
310 (defcustom riece-user-list-buffer-mode t
311   "When non-nil, Riece will display a nick list buffer."
312   :type 'boolean
313   :group 'riece-looks)
314
315 (defcustom riece-channel-list-buffer-mode t
316   "When non-nil, Riece will display a channel list buffer."
317   :type 'boolean
318   :group 'riece-looks)
319
320 (defcustom riece-default-freeze nil
321   "Channel buffer local freeze flag is on at starting."
322   :type 'boolean
323   :group 'riece-looks)
324
325 (defcustom riece-default-channel-binding nil
326   "The channel list to bind the channel number when joining."
327   :type '(repeat (radio (string :tag "Bound Channel")
328                         (const nil)))
329   :group 'riece-channel)
330
331 (defcustom riece-blink-parens nil
332   "Should we blink matching parenthesis in the command buffer?"
333   :type 'boolean
334   :group 'riece-options)
335
336 (defcustom riece-quit-message (riece-extended-version)
337   "Default quit message."
338   :type '(string :tag "Quit message")
339   :group 'riece-options)
340
341 (defcustom riece-part-message nil
342   "Default part message."
343   :type '(choice (const :tag "No message" nil)
344                  (string :tag "Part message"))
345   :group 'riece-options)
346
347 (defcustom riece-away-message "Gone"
348   "Default away message."
349   :type '(string :tag "Away message")
350   :group 'riece-options)
351
352 (defcustom riece-gather-channel-modes nil
353   "If non-nil, gather channel modes when we join a channel."
354   :type 'boolean
355   :group 'riece-options)
356
357 (defcustom riece-buffer-dispose-function #'kill-buffer
358   "Function called after the buffer was disposed."
359   :type 'function
360   :group 'riece-options)
361
362 (defcustom riece-format-time-function #'current-time-string
363   "Function to convert the specified time to the human readable form."
364   :type 'function
365   :group 'riece-options)
366
367 (provide 'riece-options)
368
369 ;;; riece-options.el ends here