1 ;;; riece-options.el --- customization
2 ;; Copyright (C) 1998-2003 Daiki Ueno
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
6 ;; Keywords: IRC, riece
8 ;; This file is part of Riece.
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)
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.
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.
27 (require 'riece-version)
28 (require 'riece-globals)
30 ;; User modifiable variables.
32 "Riece specific customize group.")
34 (defgroup riece-options nil
35 "Riece user customizable variables."
39 (defcustom riece-saved-forms
41 riece-channel-buffer-mode
42 riece-others-buffer-mode
43 riece-user-list-buffer-mode
44 riece-channel-list-buffer-mode
47 "Variables saved after each session is completed."
49 :group 'riece-options)
51 (defcustom riece-debug nil
52 "If non-nil, random debug spews."
54 :group 'riece-options)
56 (defcustom riece-command-prefix "\C-c"
57 "Key sequence to be used as prefix for command mode key bindings."
59 :group 'riece-options)
61 (defgroup riece-looks nil
66 (defcustom riece-use-full-window t
67 "If non-nil, whole Emacs window is used to display dialogue."
71 (defcustom riece-window-center-line -2
72 "Line number of center point in window when scrolling.
73 If nil, erases the entire frame and then redraws with point in the
74 center of the window. Negative means relative to bottom of window.
75 See the document of the function `recenter'."
79 (defcustom riece-directory (expand-file-name "~/.riece")
80 "Where to look for startup files."
82 :group 'riece-options)
84 (defcustom riece-addon-directory
85 (expand-file-name "addons" riece-directory)
86 "Where to look for add-on files."
88 :group 'riece-options)
90 (defcustom riece-data-directory
91 (if (fboundp 'locate-data-directory)
92 (locate-data-directory "riece")
93 (file-name-directory load-file-name))
94 "Where to look for data files."
96 :group 'riece-options)
98 (defcustom riece-variables-file
99 (expand-file-name "init" riece-directory)
100 "Where to look for variables."
102 :group 'riece-options)
104 (defcustom riece-saved-variables-file
105 (expand-file-name "save" riece-directory)
106 "Where to look for variables.
107 This file was saved the last session."
109 :group 'riece-options)
111 (defcustom riece-variables-files
112 (list riece-saved-variables-file riece-variables-file)
113 "Where to look for variables. Helps to remove clutter from your .emacs.
114 This feature is most likely to dissappear in near future. The preferred
115 way is to put Riece variables on .emacs or file loaded from there."
116 :type '(repeat (file :tag "Initialization File"))
117 :group 'riece-options)
119 (defcustom riece-addons '(riece-highlight
135 "Add-ons insinuated into Riece."
136 :type '(repeat symbol)
137 :group 'riece-options)
139 (defgroup riece-server nil
144 (defgroup riece-channel nil
149 (define-widget 'riece-service-spec 'radio
150 "Edit service spec entries"
151 :convert-widget 'riece-service-spec-convert)
153 (defun riece-service-spec-convert (widget)
154 (widget-put widget :args '((integer :tag "Port Number")
155 (string :tag "Name")))
158 (define-widget 'riece-server-spec 'repeat
159 "Edit server spec entries"
160 :match (lambda (widget value)
161 (eval `(and ,@(mapcar
163 (or (stringp (cdr entry))
164 (listp (cdr entry))))
166 :convert-widget 'riece-server-spec-convert)
168 (defun riece-server-spec-convert (widget)
169 (let* ((host '(const :format "" :value :host))
170 (service '(const :format "" :value :service))
172 `(group :inline t ,host (string :tag "Host")))
174 `(group :inline t ,service riece-service-spec))
176 `(cons (string :tag "Name")
177 (radio (string :tag "Host")
178 (list ,host ,service))))
180 (widget-put widget :args args)
183 (defcustom riece-server-alist nil
184 "An alist mapping server names to plist."
185 :type 'riece-server-spec
186 :group 'riece-server)
188 (defcustom riece-server (getenv "IRCSERVER")
189 "IRC server host we are connecting to."
191 :group 'riece-server)
193 (defcustom riece-protocol 'irc
196 :group 'riece-server)
198 (defcustom riece-max-send-size 512
199 "Maximum size of messages to be sent at a time."
201 :group 'riece-server)
203 (defcustom riece-send-delay 2
204 "Duration of multiple send."
206 :group 'riece-server)
208 (defcustom riece-default-password (getenv "IRCPASSWORD")
210 :type '(radio (string :tag "Password")
211 (const :tag "No" nil))
212 :group 'riece-server)
214 (defcustom riece-username nil
217 :group 'riece-server)
219 (defcustom riece-realname nil
222 :group 'riece-server)
224 (defcustom riece-nickname (or (getenv "IRCNICK")
225 (user-real-login-name))
228 :group 'riece-server)
230 (defcustom riece-startup-channel-list nil
231 "A list of channels to join automatically at startup."
232 :type '(repeat (choice (string :tag "Channel")
233 (list (string :tag "Channel") (string :tag "Key"))))
234 :group 'riece-channel)
236 (defcustom riece-startup-server-list nil
237 "A list of servers to connect automatically at startup."
238 :type '(repeat (string :tag "Server"))
239 :group 'riece-server)
241 (defcustom riece-retry-with-new-nickname nil
242 "When nickname has already been in use, grow-tail automatically."
244 :group 'riece-server)
246 (defcustom riece-quit-timeout 1
247 "Quit timeout when there is no response from server."
248 :type '(radio (integer :tag "Seconds")
250 :group 'riece-server)
252 (defcustom riece-default-open-connection-function #'open-network-stream
253 "Default function used for connecting to an IRC server."
255 :group 'riece-server)
257 (defcustom riece-user-cache-max-size 512
258 "Maximum size of cache of user names."
260 :group 'riece-server)
262 (defcustom riece-channel-cache-max-size 512
263 "Maximum size of cache of channel names."
265 :group 'riece-server)
267 (defcustom riece-channel-buffer-mode t
268 "When non-nil, Riece will display a channel buffer."
272 (defcustom riece-others-buffer-mode t
273 "When non-nil, Riece will display an \"*Others*\" buffer."
277 (defcustom riece-user-list-buffer-mode t
278 "When non-nil, Riece will display a nick list buffer."
282 (defcustom riece-channel-list-buffer-mode t
283 "When non-nil, Riece will display a channel list buffer."
287 (defcustom riece-default-freeze nil
288 "Channel buffer local freeze flag is on at starting."
292 (defcustom riece-default-channel-binding nil
293 "The channel list to bind the channel number when joining."
294 :type '(repeat (radio (string :tag "Bound Channel")
296 :group 'riece-channel)
298 (defcustom riece-blink-parens nil
299 "Should we blink matching parenthesis in the command buffer?"
301 :group 'riece-options)
303 (defcustom riece-quit-message (riece-extended-version)
304 "Default quit message."
305 :type '(string :tag "Quit message")
306 :group 'riece-options)
308 (defcustom riece-part-message nil
309 "Default part message."
310 :type '(choice (const :tag "No message" nil)
311 (string :tag "Part message"))
312 :group 'riece-options)
314 (defcustom riece-away-message "Gone"
315 "Default away message."
316 :type '(string :tag "Away message")
317 :group 'riece-options)
319 (defcustom riece-gather-channel-modes nil
320 "If non-nil, gather channel modes when we join a channel."
322 :group 'riece-options)
324 (defcustom riece-buffer-dispose-function #'kill-buffer
325 "Function called after the buffer was disposed."
327 :group 'riece-options)
329 (defcustom riece-format-time-function #'current-time-string
330 "Function to convert the specified time to the human readable form."
332 :group 'riece-options)
334 (provide 'riece-options)
336 ;;; riece-options.el ends here