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., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, 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
134 "Add-ons insinuated into Riece."
135 :type '(repeat symbol)
136 :group 'riece-options)
138 (defgroup riece-server nil
143 (defgroup riece-channel nil
148 (define-widget 'riece-service-spec 'radio
149 "Edit service spec entries"
150 :convert-widget 'riece-service-spec-convert)
152 (defun riece-service-spec-convert (widget)
153 (widget-put widget :args '((integer :tag "Port Number")
154 (string :tag "Name")))
157 (define-widget 'riece-server-spec 'repeat
158 "Edit server spec entries"
159 :match (lambda (widget value)
160 (eval `(and ,@(mapcar
162 (or (stringp (cdr entry))
163 (listp (cdr entry))))
165 :convert-widget 'riece-server-spec-convert)
167 (defun riece-server-spec-convert (widget)
168 (let* ((host '(const :format "" :value :host))
169 (service '(const :format "" :value :service))
171 `(group :inline t ,host (string :tag "Host")))
173 `(group :inline t ,service riece-service-spec))
175 `(cons (string :tag "Name")
176 (radio (string :tag "Host")
177 (list ,host ,service))))
179 (widget-put widget :args args)
182 (defcustom riece-server-alist nil
183 "An alist mapping server names to plist."
184 :type 'riece-server-spec
185 :group 'riece-server)
187 (defcustom riece-server (getenv "IRCSERVER")
188 "IRC server host we are connecting to."
190 :group 'riece-server)
192 (defcustom riece-protocol 'irc
195 :group 'riece-server)
197 (defcustom riece-max-send-size 512
198 "Maximum size of messages to be sent at a time."
200 :group 'riece-server)
202 (defcustom riece-send-delay 2
203 "Duration of multiple send."
205 :group 'riece-server)
207 (defcustom riece-default-password (getenv "IRCPASSWORD")
209 :type '(radio (string :tag "Password")
210 (const :tag "No" nil))
211 :group 'riece-server)
213 (defcustom riece-username nil
216 :group 'riece-server)
218 (defcustom riece-nickname (or (getenv "IRCNICK")
219 (user-real-login-name))
222 :group 'riece-server)
224 (defcustom riece-startup-channel-list nil
225 "A list of channels to join automatically at startup."
226 :type '(repeat (choice (string :tag "Channel")
227 (list (string :tag "Channel") (string :tag "Key"))))
228 :group 'riece-channel)
230 (defcustom riece-startup-server-list nil
231 "A list of servers to connect automatically at startup."
232 :type '(repeat (string :tag "Server"))
233 :group 'riece-server)
235 (defcustom riece-retry-with-new-nickname nil
236 "When nickname has already been in use, grow-tail automatically."
238 :group 'riece-server)
240 (defcustom riece-quit-timeout 1
241 "Quit timeout when there is no response from server."
242 :type '(radio (integer :tag "Seconds")
244 :group 'riece-server)
246 (defcustom riece-default-open-connection-function #'open-network-stream
247 "Default function used for connecting to an IRC server."
249 :group 'riece-server)
251 (defcustom riece-channel-buffer-mode t
252 "When non-nil, Riece will display a channel buffer."
256 (defcustom riece-others-buffer-mode t
257 "When non-nil, Riece will display an \"*Others*\" buffer."
261 (defcustom riece-user-list-buffer-mode t
262 "When non-nil, Riece will display a nick list buffer."
266 (defcustom riece-channel-list-buffer-mode t
267 "When non-nil, Riece will display a channel list buffer."
271 (defcustom riece-default-freeze nil
272 "Channel buffer local freeze flag is on at starting."
276 (defcustom riece-default-channel-binding nil
277 "The channel list to bind the channel number when joining."
278 :type '(repeat (radio (string :tag "Bound Channel")
280 :group 'riece-channel)
282 (defcustom riece-blink-parens nil
283 "Should we blink matching parenthesis in the command buffer?"
285 :group 'riece-options)
287 (defcustom riece-quit-message (riece-extended-version)
288 "Default quit message."
289 :type '(string :tag "Quit message")
290 :group 'riece-options)
292 (defcustom riece-part-message nil
293 "Default part message."
294 :type '(choice (const :tag "No message" nil)
295 (string :tag "Part message"))
296 :group 'riece-options)
298 (defcustom riece-away-message "Gone"
299 "Default away message."
300 :type '(string :tag "Away message")
301 :group 'riece-options)
303 (defcustom riece-gather-channel-modes nil
304 "If non-nil, gather channel modes when we join a channel."
306 :group 'riece-options)
308 (defcustom riece-buffer-dispose-function #'kill-buffer
309 "Function called after the buffer was disposed."
311 :group 'riece-options)
313 (defcustom riece-shrink-buffer-idle-time-delay 5
314 "Number of idle seconds to wait before shrinking channel buffers."
316 :group 'riece-options)
318 (defcustom riece-max-buffer-size nil
319 "Maximum size of channel buffers."
320 :type '(radio (integer :tag "Number of characters")
322 :group 'riece-options)
324 (defcustom riece-shrink-buffer-remove-chars (/ riece-max-send-size 2)
325 "Number of chars removed when shrinking channel buffers."
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