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 data 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-variables-file
90 (expand-file-name "init" riece-directory)
91 "Where to look for variables."
93 :group 'riece-options)
95 (defcustom riece-saved-variables-file
96 (expand-file-name "save" riece-directory)
97 "Where to look for variables.
98 This file was saved the last session."
100 :group 'riece-options)
102 (defcustom riece-variables-files
103 (list riece-saved-variables-file riece-variables-file)
104 "Where to look for variables. Helps to remove clutter from your .emacs.
105 This feature is most likely to dissappear in near future. The preferred
106 way is to put Riece variables on .emacs or file loaded from there."
107 :type '(repeat (file :tag "Initialization File"))
108 :group 'riece-options)
110 (defcustom riece-addons '(riece-highlight
125 "Add-ons insinuated into Riece."
126 :type '(repeat symbol)
127 :group 'riece-options)
129 (defgroup riece-server nil
134 (defgroup riece-channel nil
139 (define-widget 'riece-service-spec 'radio
140 "Edit service spec entries"
141 :convert-widget 'riece-service-spec-convert)
143 (defun riece-service-spec-convert (widget)
144 (widget-put widget :args '((integer :tag "Port Number")
145 (string :tag "Name")))
148 (define-widget 'riece-server-spec 'repeat
149 "Edit server spec entries"
150 :match (lambda (widget value)
151 (eval `(and ,@(mapcar
153 (or (stringp (cdr entry))
154 (listp (cdr entry))))
156 :convert-widget 'riece-server-spec-convert)
158 (defun riece-server-spec-convert (widget)
159 (let* ((host '(const :format "" :value :host))
160 (service '(const :format "" :value :service))
162 `(group :inline t ,host (string :tag "Host")))
164 `(group :inline t ,service riece-service-spec))
166 `(cons (string :tag "Name")
167 (radio (string :tag "Host")
168 (list ,host ,service))))
170 (widget-put widget :args args)
173 (defcustom riece-server-alist nil
174 "An alist mapping server names to plist."
175 :type 'riece-server-spec
176 :group 'riece-server)
178 (defcustom riece-server (getenv "IRCSERVER")
179 "IRC server host we are connecting to."
181 :group 'riece-server)
183 (defcustom riece-protocol 'irc
186 :group 'riece-server)
188 (defcustom riece-max-send-size 512
189 "Maximum size of messages to be sent at a time."
191 :group 'riece-server)
193 (defcustom riece-send-delay 2
194 "Duration of multiple send."
196 :group 'riece-server)
198 (defcustom riece-default-password (getenv "IRCPASSWORD")
200 :type '(radio (string :tag "Password")
201 (const :tag "No" nil))
202 :group 'riece-server)
204 (defcustom riece-username nil
207 :group 'riece-server)
209 (defcustom riece-nickname (or (getenv "IRCNICK")
210 (user-real-login-name))
213 :group 'riece-server)
215 (defcustom riece-startup-channel-list nil
216 "A list of channels to join automatically at startup."
217 :type '(repeat (choice (string :tag "Channel")
218 (list (string :tag "Channel") (string :tag "Key"))))
219 :group 'riece-channel)
221 (defcustom riece-startup-server-list nil
222 "A list of servers to connect automatically at startup."
223 :type '(repeat (string :tag "Server"))
224 :group 'riece-server)
226 (defcustom riece-retry-with-new-nickname nil
227 "When nickname has already been in use, grow-tail automatically."
229 :group 'riece-server)
231 (defcustom riece-quit-timeout 10
232 "Quit timeout when there is no response from server."
233 :type '(radio (integer :tag "Seconds")
235 :group 'riece-server)
237 (defcustom riece-default-open-connection-function #'open-network-stream
238 "Default function used for connecting to an IRC server."
240 :group 'riece-server)
242 (defcustom riece-channel-buffer-mode t
243 "When non-nil, Riece will display a channel buffer."
247 (defcustom riece-others-buffer-mode t
248 "When non-nil, Riece will display an \"*Others*\" buffer."
252 (defcustom riece-user-list-buffer-mode t
253 "When non-nil, Riece will display a nick list buffer."
257 (defcustom riece-channel-list-buffer-mode t
258 "When non-nil, Riece will display a channel list buffer."
262 (defcustom riece-default-freeze nil
263 "Channel buffer local freeze flag is on at starting."
267 (defcustom riece-default-channel-binding nil
268 "The channel list to bind the channel number when joining."
269 :type '(repeat (radio (string :tag "Bound Channel")
271 :group 'riece-channel)
273 (defcustom riece-blink-parens nil
274 "Should we blink matching parenthesis in the command buffer?"
276 :group 'riece-options)
278 (defcustom riece-quit-message (riece-extended-version)
279 "Default quit message."
280 :type '(string :tag "Quit message")
281 :group 'riece-options)
283 (defcustom riece-part-message nil
284 "Default part message."
285 :type '(choice (const :tag "No message" nil)
286 (string :tag "Part message"))
287 :group 'riece-options)
289 (defcustom riece-away-message "Gone"
290 "Default away message."
291 :type '(string :tag "Away message")
292 :group 'riece-options)
294 (defcustom riece-gather-channel-modes nil
295 "If non-nil, gather channel modes when we join a channel."
297 :group 'riece-options)
299 (defcustom riece-buffer-dispose-function #'kill-buffer
300 "Function called after the buffer was disposed."
302 :group 'riece-options)
304 (defcustom riece-shrink-buffer-idle-time-delay 5
305 "Number of idle seconds to wait before shrinking channel buffers."
307 :group 'riece-options)
309 (defcustom riece-max-buffer-size nil
310 "Maximum size of channel buffers."
311 :type '(radio (integer :tag "Number of characters")
313 :group 'riece-options)
315 (defcustom riece-shrink-buffer-remove-chars (/ riece-max-send-size 2)
316 "Number of chars removed when shrinking channel buffers."
318 :group 'riece-options)
320 (defcustom riece-format-time-function #'current-time-string
321 "Function to convert the specified time to the human readable form."
323 :group 'riece-options)
325 (provide 'riece-options)
327 ;;; riece-options.el ends here