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
46 "Variables saved after each session is completed."
48 :group 'riece-options)
50 (defcustom riece-debug nil
51 "If non-nil, random debug spews."
53 :group 'riece-options)
55 (defcustom riece-command-prefix "\C-c"
56 "Key sequence to be used as prefix for command mode key bindings."
58 :group 'riece-options)
60 (defgroup riece-looks nil
61 "Related to look and feel"
65 (defcustom riece-use-full-window t
66 "If non-nil, whole Emacs window is used to display dialogue."
70 (defcustom riece-window-center-line -2
71 "Line number of center point in window when scrolling.
72 If nil, erases the entire frame and then redraws with point in the
73 center of the window. Negative means relative to bottom of window.
74 See the document of the function `recenter'."
78 (defcustom riece-directory (expand-file-name "~/.riece")
79 "Where to look for startup files."
81 :group 'riece-options)
83 (defcustom riece-addon-directory
84 (expand-file-name "addons" riece-directory)
85 "Where to look for add-on files."
87 :group 'riece-options)
89 (defcustom riece-data-directory
90 (cond ((fboundp 'locate-data-directory)
91 (locate-data-directory "riece"))
92 ((symbol-file 'riece-data-directory)
94 (locate-library (symbol-file 'riece-data-directory))))
96 (expand-file-name "riece" data-directory)))
97 "Where to look for data files."
99 :group 'riece-options)
101 (defcustom riece-variables-file
102 (expand-file-name "init" riece-directory)
103 "Where to look for variables."
105 :group 'riece-options)
107 (defcustom riece-saved-variables-file
108 (expand-file-name "save" riece-directory)
109 "Where to look for variables.
110 This file was saved the last session."
112 :group 'riece-options)
114 (defcustom riece-variables-files
115 (list riece-saved-variables-file riece-variables-file)
116 "Where to look for variables. Helps to remove clutter from your .emacs.
117 This feature is most likely to dissappear in near future. The preferred
118 way is to put Riece variables on .emacs or file loaded from there."
119 :type '(repeat (file :tag "Initialization File"))
120 :group 'riece-options)
122 (defcustom riece-addons '(riece-highlight
137 "Add-ons insinuated into Riece."
138 :type '(repeat symbol)
139 :group 'riece-options)
141 (defgroup riece-server nil
146 (defgroup riece-channel nil
151 (define-widget 'riece-service-spec 'radio
152 "Edit service spec entries"
153 :convert-widget 'riece-service-spec-convert)
155 (defun riece-service-spec-convert (widget)
156 (widget-put widget :args '((integer :tag "Port Number")
157 (string :tag "Name")))
160 (define-widget 'riece-server-spec 'repeat
161 "Edit server spec entries"
162 :match (lambda (widget value)
163 (eval `(and ,@(mapcar
165 (or (stringp (cdr entry))
166 (listp (cdr entry))))
168 :convert-widget 'riece-server-spec-convert)
170 (defun riece-server-spec-convert (widget)
171 (let* ((host '(const :format "" :value :host))
172 (service '(const :format "" :value :service))
174 `(group :inline t ,host (string :tag "Host")))
176 `(group :inline t ,service riece-service-spec))
178 `(cons (string :tag "Name")
179 (radio (string :tag "Host")
180 (list ,host ,service))))
182 (widget-put widget :args args)
185 (defcustom riece-server-alist nil
186 "An alist mapping server names to plist."
187 :type 'riece-server-spec
188 :group 'riece-server)
190 (defcustom riece-server (getenv "IRCSERVER")
191 "IRC server host we are connecting to."
193 :group 'riece-server)
195 (defcustom riece-protocol 'irc
198 :group 'riece-server)
200 (defcustom riece-max-send-size 512
201 "Maximum size of messages to be sent at a time."
203 :group 'riece-server)
205 (defcustom riece-send-delay 2
206 "Duration of multiple send."
208 :group 'riece-server)
210 (defcustom riece-default-password (getenv "IRCPASSWORD")
212 :type '(radio (string :tag "Password")
213 (const :tag "No" nil))
214 :group 'riece-server)
216 (defcustom riece-username nil
219 :group 'riece-server)
221 (defcustom riece-nickname (or (getenv "IRCNICK")
222 (user-real-login-name))
225 :group 'riece-server)
227 (defcustom riece-startup-channel-list nil
228 "A list of channels to join automatically at startup."
229 :type '(repeat (choice (string :tag "Channel")
230 (list (string :tag "Channel") (string :tag "Key"))))
231 :group 'riece-channel)
233 (defcustom riece-startup-server-list nil
234 "A list of servers to connect automatically at startup."
235 :type '(repeat (string :tag "Server"))
236 :group 'riece-server)
238 (defcustom riece-retry-with-new-nickname nil
239 "When nickname has already been in use, grow-tail automatically."
241 :group 'riece-server)
243 (defcustom riece-quit-timeout 1
244 "Quit timeout when there is no response from server."
245 :type '(radio (integer :tag "Seconds")
247 :group 'riece-server)
249 (defcustom riece-default-open-connection-function #'open-network-stream
250 "Default function used for connecting to an IRC server."
252 :group 'riece-server)
254 (defcustom riece-channel-buffer-mode t
255 "When non-nil, Riece will display a channel buffer."
259 (defcustom riece-others-buffer-mode t
260 "When non-nil, Riece will display an \"*Others*\" buffer."
264 (defcustom riece-user-list-buffer-mode t
265 "When non-nil, Riece will display a nick list buffer."
269 (defcustom riece-channel-list-buffer-mode t
270 "When non-nil, Riece will display a channel list buffer."
274 (defcustom riece-default-freeze nil
275 "Channel buffer local freeze flag is on at starting."
279 (defcustom riece-default-channel-binding nil
280 "The channel list to bind the channel number when joining."
281 :type '(repeat (radio (string :tag "Bound Channel")
283 :group 'riece-channel)
285 (defcustom riece-blink-parens nil
286 "Should we blink matching parenthesis in the command buffer?"
288 :group 'riece-options)
290 (defcustom riece-quit-message (riece-extended-version)
291 "Default quit message."
292 :type '(string :tag "Quit message")
293 :group 'riece-options)
295 (defcustom riece-part-message nil
296 "Default part message."
297 :type '(choice (const :tag "No message" nil)
298 (string :tag "Part message"))
299 :group 'riece-options)
301 (defcustom riece-away-message "Gone"
302 "Default away message."
303 :type '(string :tag "Away message")
304 :group 'riece-options)
306 (defcustom riece-gather-channel-modes nil
307 "If non-nil, gather channel modes when we join a channel."
309 :group 'riece-options)
311 (defcustom riece-buffer-dispose-function #'kill-buffer
312 "Function called after the buffer was disposed."
314 :group 'riece-options)
316 (defcustom riece-shrink-buffer-idle-time-delay 5
317 "Number of idle seconds to wait before shrinking channel buffers."
319 :group 'riece-options)
321 (defcustom riece-max-buffer-size nil
322 "Maximum size of channel buffers."
323 :type '(radio (integer :tag "Number of characters")
325 :group 'riece-options)
327 (defcustom riece-shrink-buffer-remove-chars (/ riece-max-send-size 2)
328 "Number of chars removed when shrinking channel buffers."
330 :group 'riece-options)
332 (defcustom riece-format-time-function #'current-time-string
333 "Function to convert the specified time to the human readable form."
335 :group 'riece-options)
337 (provide 'riece-options)
339 ;;; riece-options.el ends here