* liece.el (liece-open-server-internal): Simplify.
[elisp/liece.git] / lisp / liece-vars.el
1 ;;; liece-vars.el --- Customization.
2 ;; Copyright (C) 1998-2000 Daiki Ueno
3
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
5 ;; Created: 1998-09-28
6 ;; Revised: 1998-11-25
7 ;; Keywords: IRC, liece
8
9 ;; This file is part of Liece.
10
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26
27 ;;; Commentary:
28 ;; 
29
30 ;;; Code:
31
32 (eval-when-compile
33   (require 'liece-compat)
34   (require 'liece-globals))
35
36 ;; User modifiable variables.
37 (defgroup liece nil
38   "liece specific customize group")
39
40 (defgroup liece-vars nil
41   "liece user customizable variables"
42   :tag "Variables"
43   :prefix "liece-"
44   :group 'liece)
45
46 (defcustom liece-saved-forms
47   (purecopy
48    '(liece-kill-nickname
49      liece-server-alist
50      liece-channel-buffer-mode
51      liece-nick-buffer-mode
52      liece-friends))
53   "Variables whose values are saved via command liece-command-save-vars."
54   :type 'string
55   :group 'liece-vars)
56
57 (defgroup liece-look nil
58   "Look & Feels"
59   :tag "Look"
60   :prefix "liece-"
61   :group 'liece)
62
63 (defcustom liece-command-window-height 4
64   "How large should command window be on startup."
65   :type 'integer
66   :group 'liece-look)
67
68 (defcustom liece-truncate-partial-width-windows t
69   "If non-nil, truncate lines in splitting windows such as others buffer."
70   :type 'boolean
71   :group 'liece-look)
72
73 (defcustom liece-use-full-window t
74   "If non-nil, IRCHAT will use whole Emacs window."
75   :type 'boolean
76   :group 'liece-look)
77
78 (defcustom liece-display-frame-title t
79   "If non-nil, IRCHAT displays channel information on frame title."
80   :type 'boolean
81   :group 'liece-look)
82
83 (defcustom liece-display-unread-mark nil
84   "If non-nil, display unread mark as XEmacs glyphs or character to channel
85 list buffer."
86   :type 'boolean
87   :group 'liece-look)
88
89 (defcustom liece-channel-unread-character "!"
90   "Channel unread character."
91   :type 'character
92   :group 'liece-look)
93
94 (defcustom liece-tab-stop-list '(2 4 6 8 10 12 14 16)
95   "List of tab stop positions in dialogue buffer."
96   :type '(repeat integer)
97   :group 'liece-look)
98
99 (defcustom liece-icon-directory nil
100   "Normal position of liece icons."
101   :type 'directory
102   :group 'liece-look)
103
104 (defcustom liece-nick-image-alist
105   '((?@ . "ball.red.xpm")
106     (?  . "ball.blank.xpm")
107     (?+ . "ball.gray.xpm"))
108   "Normal and deformed faces for operators and voices."
109   :type '(repeat (list (character :tag "Mark")
110                        (string :tag "Image")))
111   :group 'liece-look)
112
113 (defcustom liece-inhibit-startup-message nil
114   "If non-nil, the startup message will not be displayed.
115 This variable is used before `.liece/init.el' is loaded, so it should
116 be set in `.emacs' instead."
117   :group 'liece-look
118   :type 'boolean)
119
120 (defcustom liece-want-traditional nil
121   "Do we want /commands."
122   :type 'boolean
123   :group 'liece-vars)
124
125 (defcustom liece-command-window-on-top nil
126   "If non-nil, the command window will be put at the top of the screen."
127   :type 'boolean
128   :group 'liece-look)
129
130 (defcustom liece-one-buffer-mode nil
131   "When non-nil, liece will put up only a dialogue buffer.
132 Useful for those (perverts) who use 24 line terminals."
133   :type 'boolean
134   :group 'liece-look)
135
136 (defcustom liece-display-status-on-channel-indicator nil
137   "When non-nil, liece will display channel topic on modeline."
138   :type 'boolean
139   :group 'liece-look)
140
141 (defcustom liece-directory "~/.liece"
142   "Where to look for data files."
143   :type 'directory
144   :group 'liece-vars)
145   
146 (defcustom liece-variables-file (expand-file-name "init.el" liece-directory)
147   "Where to look for variables.  Helps to remove clutter from your .emacs.
148 This feature is most likely to dissappear in near future.  The preferred
149 way is to put liece variables on .emacs or file loaded from there."
150   :type 'file
151   :group 'liece-vars)
152
153 (defcustom liece-variables-files
154   (list liece-variables-file)
155   "Where to look for variables.  Helps to remove clutter from your .emacs.
156 This feature is most likely to dissappear in near future.  The preferred
157 way is to put liece variables on .emacs or file loaded from there."
158   :type '(repeat (file :tag "Initialization File"))
159   :group 'liece-vars)
160
161 ;; Where to connect.
162 (defgroup liece-server nil
163   "Server Settings"
164   :tag "Server"
165   :prefix "liece-"
166   :group 'liece)
167
168 (defgroup liece-channel nil
169   "Channel Settings"
170   :tag "Channel"
171   :prefix "liece-"
172   :group 'liece)
173
174 (define-widget 'liece-service-spec 'radio
175   "Edit service spec entries"
176   :convert-widget 'liece-service-spec-convert)
177
178 (defun liece-service-spec-convert (widget)
179   (widget-put widget :args '((integer :tag "Port Number")
180                              (string :tag "Name")))
181   widget)
182
183 (define-widget 'liece-server-spec 'repeat
184   "Edit server spec entries"
185   :match (lambda (widget value)
186            (eval
187             (` (and
188                 (,@ (mapcar
189                      (lambda (entry)
190                        (or (stringp (cdr entry))
191                            (listp (cdr entry))))
192                      value))))))
193   :convert-widget 'liece-server-spec-convert)
194
195 (defun liece-server-spec-convert (widget)
196   (let* ((host '(const :format "" :value :host))
197          (service '(const :format "" :value :service))
198          (host
199           (` (group :inline t (, host) (string :tag "Host"))))
200          (service
201           (` (group :inline t (, service) liece-service-spec)))
202          (spec
203           (` (cons
204               (string :tag "Name")
205               (radio (string :tag "Host")
206                      (list (, host) (, service))))))
207          (args (` ((, spec)))))
208     (widget-put widget :args args)
209     widget))
210   
211 (defcustom liece-server-alist
212   '(("WIDE Project Kyoto NOC, Japan" . "irc.kyoto.wide.ad.jp")
213     ("WIDE Project Tokyo NOC, Japan" . "irc.tokyo.wide.ad.jp")
214     ("TDI RCAC / 6660" :host "irc.rcac.tdi.co.jp" :service 6660)
215     ("TDI RCAC / 6661" :host "irc.rcac.tdi.co.jp" :service 6661)
216     ("TDI RCAC / 6662" :host "irc.rcac.tdi.co.jp" :service 6662)
217     ("TDI RCAC / 6663" :host "irc.rcac.tdi.co.jp" :service 6663)
218     ("TDI RCAC / 6664" :host "irc.rcac.tdi.co.jp" :service 6664)
219     ("TDI RCAC / 6665" :host "irc.rcac.tdi.co.jp" :service 6665)
220     ("TDI RCAC / 6666" :host "irc.rcac.tdi.co.jp" :service 6666)
221     ("TDI RCAC" . "irc.rcac.tdi.co.jp")
222     ("TDI RCAC, 6Bone" . "irc6.rcac.tdi.co.jp")
223     ("RACE, University of Tokyo" . "irc.race.u-tokyo.ac.jp")
224     ("Hokkaido University, Sapporo, Japan" . "irc.huie.hokudai.ac.jp")
225     ("KARRN Hakozaki NOC" . "irc.karrn.ad.jp")
226     ("Tohoku University, Japan" . "irc.tohoku.ac.jp")
227     ("DTI, Akasaka Tokyo, Japan" . "irc.dti.ne.jp"))
228   "IRC server assoc-list which is used for input IRC server."
229   :type 'liece-server-spec
230   :group 'liece-server)
231
232 (defcustom liece-server (or (getenv "IRCSERVER") nil)
233   "Name of the host running the IRC server.
234 Value initialized from the IRCSERVER environment variable if one is set"
235   :type 'string
236   :group 'liece-server)
237
238 (defcustom liece-service
239   (let ((ircport-env (getenv "IRCPORT")))
240     (if ircport-env
241         (if (> (string-to-int ircport-env) 0)
242             (string-to-int ircport-env)
243           ircport-env)
244       6667))
245   "IRC service name or (port) number."
246   :type 'liece-service-spec
247   :group 'liece-server)
248
249 (defcustom liece-my-userhost nil
250   "You can explicitly indicate own hostname here."
251   :type '(radio (string :tag "Hostname")
252                 (const :tag "Autodetect" nil))
253   :group 'liece-server)
254
255 (defcustom liece-password (or (getenv "IRCPASSWORD") nil)
256   "Your password when connecting to server."
257   :type '(radio (string :tag "Password")
258                 (const :tag "No" nil))
259   :group 'liece-server)
260
261 (defcustom liece-name (or (getenv "IRCNAME") (user-real-login-name))
262   "The nickname you want to use in IRC.
263 Default is the environment variable IRCNICK, or your login name."
264   :type 'string
265   :group 'liece-server)
266
267 (defcustom liece-nickname (or (getenv "IRCNICK") (user-real-login-name))
268   "The nickname you want to use in IRC.
269 Default is the environment variable IRCNICK, or your login name."
270   :type 'string
271   :group 'liece-server)
272
273 (defcustom liece-nick-max-length 9
274   "Maximum length of the nickname."
275   :type 'integer
276   :group 'liece-server)
277
278 (defvar liece-real-nickname nil)
279
280 (defcustom liece-startup-channel nil
281   "The channel to join automatically at startup.
282 If nil, do not join any channel."
283   :type '(radio (string :tag "Channels")
284                 (const nil))
285   :group 'liece-channel)
286
287 (defcustom liece-startup-channel-list nil
288   "The channel list to join automatically at startup.
289 If nil, do not join any channel."
290   :type '(repeat (string :tag "Startup Channel"))
291   :group 'liece-channel)
292
293 (defcustom liece-auto-join-partner t
294   "Whether join automatically at arriving private message."
295   :type 'boolean
296   :group 'liece-channel)
297
298 (defcustom liece-reconnect-automagic nil
299   "Automatic reconnection, default is disabled."
300   :type 'boolean
301   :group 'liece-server)
302
303 (defcustom liece-ask-for-nickname nil
304   "Ask for nickname if liece was entered with \\[universal-argument]."
305   :type 'boolean
306   :group 'liece-server)
307
308 (defcustom liece-ask-for-password nil
309   "Ask for password when connecting to server."
310   :type 'boolean
311   :group 'liece-server)
312
313 (defcustom liece-ask-for-channel-password nil
314   "Ask for channel password when joining channel with password."
315   :type 'boolean
316   :group 'liece-server)
317
318 (defcustom liece-reconnect-with-password nil
319   "Auto recconect to server with password after incorrect password."
320   :type 'boolean
321   :group 'liece-server)
322
323 (defcustom liece-grow-tail "_"
324   "Add liece-grow-tail to nick when reconnecting.
325 Otherwise you might get killed again if automagic reconnect is too fast."
326   :type 'string
327   :group 'liece-server)
328
329 (defcustom liece-auto-iterate-nick nil
330   "When nickname has already been in use, grow-tail automagically."
331   :type 'boolean
332   :group 'liece-server)
333
334 (defvar liece-after-registration nil
335   "After my registration.")
336
337 (defvar liece-status-message-string nil)
338
339 (defvar liece-channel-unread-list nil)
340
341 ;; Hooks.
342 (defgroup liece-hook nil
343   "Hooks"
344   :tag "Hooks"
345   :prefix "liece-"
346   :group 'liece)
347   
348 (defcustom liece-command-mode-hook nil
349   "A hook for IRCHAT command mode."
350   :type 'hook
351   :group 'liece-hook)
352
353 (defcustom liece-dialogue-mode-hook nil
354   "A hook for IRCHAT dialogue mode."
355   :type 'hook
356   :group 'liece-hook)
357
358 (defcustom liece-others-mode-hook nil
359   "A hook for IRCHAT others mode."
360   :type 'hook
361   :group 'liece-hook)
362
363 (defcustom liece-channel-mode-hook nil
364   "A hook for IRCHAT Channel mode."
365   :type 'hook
366   :group 'liece-hook)
367
368 (defcustom liece-nick-mode-hook nil
369   "A hook for IRCHAT nick mode."
370   :type 'hook
371   :group 'liece-hook)
372
373 (defcustom liece-exit-hook nil
374   "A hook executed when signing off IRC."
375   :type 'hook
376   :group 'liece-hook)
377
378 (defcustom liece-before-kill-emacs-hook nil
379   "A hook executed when exitting Emacs."
380   :type 'hook
381   :group 'liece-hook)
382
383 ;; Channel buffers.
384 (defcustom liece-channel-buffer-mode nil
385   "When non-nil, liece will display a channel buffer."
386   :type 'boolean
387   :group 'liece-look)
388
389 (defcustom liece-channel-window-height-percent 63
390   "How large percent should Current channel window be on startup."
391   :type 'integer
392   :group 'liece-look)
393
394 (defcustom liece-default-beep nil
395   "If non nil, channel buffer local beep flag is on at starting."
396   :type 'boolean
397   :group 'liece-look)
398
399 (defcustom liece-default-freeze nil
400   "If non nil, channel buffer local freeze flag is on at starting."
401   :type 'boolean
402   :group 'liece-look)
403
404 (defcustom liece-default-own-freeze nil
405   "If non nil, channel buffer local own freeze flag is on at starting."
406   :type 'boolean
407   :group 'liece-look)
408
409 (defcustom liece-default-channel-binding nil
410   "The channel list to bind the channel number when joining."
411   :type '(repeat (radio (string :tag "Bound Channel")
412                         (const nil)))
413   :group 'liece-channel)
414
415 (defcustom liece-default-partner-binding nil
416   "The chat partner list to bind the partner's number."
417   :type '(repeat (radio (string :tag "Bound Partner")
418                         (const nil)))
419   :group 'liece-partner)
420
421 ;; Nick buffers.
422 (defcustom liece-nick-buffer-mode nil
423   "When non-nil, liece will display a nick list buffer."
424   :type 'boolean
425   :group 'liece-look)
426
427 (defcustom liece-nick-window-width-percent 18
428   "How large percent should Current nick list window be on startup."
429   :type 'integer
430   :group 'liece-look)
431
432 (defcustom liece-nick-window-auto-hide t
433   "Hide nick window in priv buffer automatically."
434   :type 'boolean
435   :group 'liece-look)
436
437 ;; Channel list buffer.
438 (defcustom liece-channel-list-buffer-mode nil
439   "When non-nil, liece will display a channel list buffer."
440   :type 'boolean
441   :group 'liece-look)
442
443 (defcustom liece-channel-list-window-width-percent 18
444   "How large percent should Current channel list window be on startup."
445   :type 'integer
446   :group 'liece-look)
447   
448 ;; Highlight.
449 (defcustom liece-highlight-mode t
450   "If non nil, IRC buffer is highlighted by specific rule."
451   :type 'boolean
452   :group 'liece-highlight)
453
454 (defcustom liece-highlight-pattern "$^"
455   "If non nil, this pattern used for user defined highlight rule."
456   :type '(regexp :tag "Highlighting Pattern")
457   :group 'liece-highlight)
458
459 ;; DCC
460 (defgroup liece-dcc nil
461   "DCC Settings"
462   :tag "DCC"
463   :prefix "liece-"
464   :group 'liece)
465
466 (defcustom liece-dcc-program "ldcc"
467   "Name of the external dcc-program.
468 Current version takes the one which is earlier in path \(if many\)."
469   :type '(file :tag "DCC program path")
470   :group 'liece-dcc)
471
472 (defcustom liece-dcc-directory "~/tmp"
473   "Directory where liece-dcc puts its files."
474   :type 'directory
475   :group 'liece-dcc)
476
477 (defcustom liece-dcc-port 0
478   "Default port for DCC operations."
479   :type 'integer
480   :group 'liece-dcc)
481
482 (defcustom liece-dcc-resolve-server nil
483   "Resolve IRC server FQDN with external DCC command."
484   :type 'boolean
485   :group 'liece-dcc)
486
487 ;; Prefix strings for various messages.
488 (defgroup liece-prefix nil
489   "Various message prefix"
490   :tag "Prefix"
491   :prefix "liece-"
492   :group 'liece)
493
494 (defgroup liece-prefix-string nil
495   "Various prefix string"
496   :tag "Prefix string"
497   :prefix "liece-"
498   :group 'liece-prefix)
499
500 (defcustom liece-change-prefix "*** Change: "
501   "String to add before changing messages."
502   :type 'string
503   :group 'liece-prefix-string)
504
505 (defcustom liece-notice-prefix "*** Notice: "
506   "String to add before any notice message."
507   :type 'string
508   :group 'liece-prefix-string)
509
510 (defcustom liece-broadcast-prefix "*** Broadcast: "
511   "String to add before any Broadcast message."
512   :type 'string
513   :group 'liece-prefix-string)
514
515 (defcustom liece-wallops-prefix "*** Notice: "
516   "String to add before any WALLOPS message."
517   :type 'string
518   :group 'liece-prefix-string)
519
520 (defcustom liece-error-prefix "*** Error: "
521   "String to add before any ERROR message."
522   :type 'string
523   :group 'liece-prefix-string)
524
525 (defcustom liece-info-prefix "*** Info: "
526   "String to add before any informational message."
527   :type 'string
528   :group 'liece-prefix-string)
529
530 (defcustom liece-timestamp-prefix "*** Time: "
531   "String to add before any timestamp message."
532   :type 'string
533   :group 'liece-prefix-string)
534
535 (defcustom liece-client-prefix "*** Client: "
536   "String to add before any CTCP message."
537   :type 'string
538   :group 'liece-prefix-string)
539
540 (defcustom liece-dcc-prefix "*** DCC: "
541   "String to add before any DCC message."
542   :type 'string
543   :group 'liece-prefix-string)
544
545 (defcustom liece-time-prefix-regexp "[0-9][0-9]:[0-9][0-9] "
546   "Time prefix regexp."
547   :type 'regexp
548   :group 'liece-prefix)
549
550 (defcustom liece-display-time t
551   "If non-nil, print time prefix on each line in channel buffer."
552   :type 'boolean
553   :group 'liece-prefix)
554
555 (defcustom liece-display-prefix-tag nil
556   "If non-nil, print prefix tag on each line in channel buffer."
557   :type 'boolean
558   :group 'liece-prefix)
559
560 (defcustom liece-generic-prefix-tag-regexp "\\*\\*\\* \\([^:]+: \\)"
561   "Regular expression for generic prefix tag."
562   :type 'regexp
563   :group 'liece-prefix)
564
565 ;; Misc.
566 (defcustom liece-blink-parens nil
567   "Should we blink matching parenthesis in liece command buffer?"
568   :type 'boolean
569   :group 'liece-vars)
570
571 (defcustom liece-show-wallops t
572   "Show wallops messages if usermode +ws."
573   :type 'boolean
574   :group 'liece-vars)
575
576 (defcustom liece-ignore-extra-notices t
577   "Don't show any notice unless they come from the local server."
578   :type 'boolean
579   :group 'liece-vars)
580
581 (defcustom liece-shorten-kills t
582   "Shorten KILL messages to about one line."
583   :type 'boolean
584   :group 'liece-vars)
585
586 (defcustom liece-ignore-changes nil
587   "Ignore changes? Good in topic-wars/link troubles."
588   :type 'boolean
589   :group 'liece-vars)
590
591 (defcustom liece-ignore-fakes nil
592   "If non nil, ignore fake notices if receiving them."
593   :type 'boolean
594   :group 'liece-vars)
595
596 (defcustom liece-signoff-message nil
597   "Default signoff message."
598   :type '(radio (string :tag "Signoff message"))
599   :group 'liece-vars)
600
601 (defcustom liece-away-message ""
602   "Default away message."
603   :type 'string
604   :group 'liece-vars)
605
606 (defcustom liece-beep-on-bells 'always
607   "If non-nil, and the IRC dialogue buffer is not selected in a window,
608 an IRC message arriving containing a bell character, will cause you
609 to be notified.
610 If value is 'always, an arriving bell will always cause a beep (or flash)."
611   :type '(radio (const :tag "Always" always) (const :tag "No" nil))
612   :group 'liece-vars)
613
614 (defcustom liece-beep-function (function ding)
615   "Function to beep."
616   :type 'function
617   :group 'liece-vars)
618
619 (defcustom liece-beep-when-invited nil
620   "If non-nil, beep when invited."
621   :type 'boolean
622   :group 'liece-vars)
623
624 (defcustom liece-beep-when-privmsg nil
625   "If non-nil, beep when received privmsg."
626   :type 'boolean
627   :group 'liece-vars)
628
629 (defcustom liece-beep-words-list nil
630   "This list used for user defined beep rules."
631   :type '(repeat (string :tag "Beep Rules List"))
632   :group 'liece-vars)
633
634 (defcustom liece-system-fqdname (system-name)
635   "The fully qualified domain name of the system.
636 Default is what (system-name) returns."
637   :type 'string
638   :group 'liece-vars)
639
640 (defcustom liece-gather-channel-modes t
641   "Gather channel modes when joining channels."
642   :type 'boolean
643   :group 'liece-vars)
644
645 (defcustom liece-use-x-face nil
646   "Display X-Face in dialogue buffer."
647   :type 'boolean
648   :group 'liece-look)
649
650 ;; Send/Receive files.
651 (defcustom liece-file-accept nil
652   "Do we accept files."
653   :type 'boolean
654   :group 'liece-ctcp)
655
656 (defcustom liece-file-confirm-save nil
657   "Do we want confirmation on saving files."
658   :type 'boolean
659   :group 'liece-ctcp)
660
661 ;; Userinfos.
662 (defgroup liece-ctcp nil
663   "CTCP Settings"
664   :tag "CTCP"
665   :prefix "liece-"
666   :group 'liece)
667
668 (defcustom liece-ctcp-userinfo "No user information given."
669   "Userinfo message given to anyone asking."
670   :type 'string
671   :group 'liece-ctcp)
672
673 (defcustom liece-ctcp-x-face ""
674   "X-Face message given to anyone asking.  Proper form is \"X-Face: ....\"."
675   :type 'string
676   :group 'liece-ctcp)
677
678 (static-when (featurep 'xemacs)
679   (define-obsolete-variable-alias 'liece-client-userinfo
680     'liece-ctcp-userinfo)
681   (define-obsolete-variable-alias 'liece-client-x-face
682     'liece-ctcp-x-face))
683
684 (defcustom liece-timers
685   '((liece-command-poll-names liece-poll-names-interval)
686     (liece-command-keepalive liece-keepalive-interval)
687     (liece-command-poll-friends liece-poll-friends-interval))
688   "Symbol name to store timer, timer-function and timer-interval."
689   :type 'list
690   :group 'liece-server)
691
692 (defcustom liece-friends nil
693   "Friends to be checked consequently."
694   :type '(repeat (string :tag "Nick"))
695   :group 'liece-vars)
696
697 (defcustom liece-display-friends-function 'liece-303-display-friends
698   "Function to display friends status."
699   :type 'function
700   :group 'liece-vars)
701
702 (defcustom liece-poll-friends-interval 30
703   "Interval on seconds the existence of friends."
704   :type '(repeat
705           (integer :tag "Polling Interval in Seconds")
706           (const :tag "No" nil))
707   :group 'liece-server)
708
709 (defcustom liece-keepalive-interval nil
710   "Interval on seconds the existence of server connection is checked."
711   :type '(radio
712           (integer :tag "Seconds"
713                    :doc "Connection Interval in Seconds")
714           (const :tag "No" nil))
715   :group 'liece-server)
716
717 (defcustom liece-poll-names-interval nil
718   "Interval the names are polled from server."
719   :type '(radio
720           (integer :tag "Seconds"
721                    :doc "NAMES Polling Interval in Seconds")
722           (const :tag "No" nil))
723   :group 'liece-server)
724
725 (defcustom liece-timestamp-interval (* 60 10)
726   "Interval in seconds between timestamps in dialogue-buffer, nil for none."
727   :type '(radio
728           (integer :tag "Seconds"
729                    :doc "Timestamp Interval in Seconds")
730           (const "No" nil))
731   :group 'liece-server)
732
733 (defcustom liece-connection-timeout 60
734   "Default timeout interval."
735   :type 'integer
736   :group 'liece-server)
737   
738 (defcustom liece-timestamp-format (concat liece-timestamp-prefix "%s")
739   "Format-string for timestamp."
740   :type 'string
741   :group 'liece-format-string)
742
743 ;; Conversions: Not used.
744 (defcustom liece-send-convert-list nil
745   "Convert characters before sending to server."
746   :type '(repeat (character :tag "Character"
747                             :doc "Convert Character"))
748   :group 'liece-vars)
749
750 (defcustom liece-receive-convert-list nil
751   "Convert characters after receiving from server."
752   :type '(repeat (character :tag "Character"
753                             :doc "Convert Character"))
754   :group 'liece-vars)
755
756 ;; Ignores
757 (defgroup liece-ignore nil
758   "Ignore Settings"
759   :tag "Ignore"
760   :prefix "liece-"
761   :group 'liece-vars)
762
763 (defcustom liece-kill-nickname nil
764   "List of nicknames to be ignored.
765 Messages from these people won't be displayed."
766   :type '(repeat (string :tag "Nick" :doc "Ignore Nick"))
767   :group 'liece-ignore)
768
769 (defcustom liece-kill-realname nil
770   "List of real names to be ignored.
771 Messages from them won't be displayed."
772   :type '(repeat (string :tag "Realname" :doc "Ignore Realname"))
773   :group 'liece-ignore)
774
775 (defcustom liece-kill-logon nil
776   "List of logon names (user@host.dom.ain) to be ignored.
777 Messages from them won't be displayed."
778   :type '(repeat (string :tag "Logon" :doc "Ignore Logon Name"))
779   :group 'liece-ignore)
780
781 ;; New style ignore.
782 (defcustom liece-no-ignore-buffers nil
783   "A list of buffers that don't adhere to ignore-list."
784   :type '(repeat (string :tag "Buffer" :doc "Don't Ignore Buffer Names"))
785   :group 'liece-ignore)
786
787 (define-widget 'liece-ignore-spec 'repeat
788   "Edit server spec entries"
789   :convert-widget 'liece-ignore-spec-convert)
790
791 (defun liece-ignore-spec-convert (widget)
792   (let* ((type
793           '(radio
794             (string :tag "Type" :doc "Match for messagetype")
795             (const nil)))
796          (match
797           '(radio
798             (string :tag "Match" :doc "Match for string-in-message")
799             (const nil)))
800          (info-func
801           '(function :doc "Function whose return value is ignore info"))
802          (user-func
803           '(function :doc "Function whose return value is ignore user list"))
804          (name
805           '(repeat :tag "Name" (string :doc "Ignore user name")))
806          (spec
807           (` (list :value (nil nil)
808                    (choice :tag "Message"
809                     (cons (, type) (, match)) (const nil) (, info-func))
810                    (choice :tag "User" (const nil) (, user-func) (, name)))))
811          (args (` ((, spec)))))
812     (widget-put widget :args args)
813     widget))
814
815 (defcustom liece-ignore-list nil
816   "A list of buffers that don't adhere to ignore-list."
817   :type 'liece-ignore-spec
818   :group 'liece-ignore)
819
820 (defcustom liece-compress-changes t
821   "Set to t if we want instant compressed messages in the old format."
822   :type 'boolean
823   :group 'liece-vars)
824
825 (defcustom liece-compress-treshold 1
826   "Number of lines to search back for a previous matching join/part/quit/mode."
827   :type 'integer
828   :group 'liece-vars)
829
830 (defcustom liece-compress-mode-length 3
831   "Number of mode compression length."
832   :type 'integer
833   :group 'liece-vars)
834
835 (defcustom liece-buffer-max-size 4242424
836   "Maximum size (in bytes) of any liece buffer."
837   :type 'integer
838   :group 'liece-vars)
839
840 (defcustom liece-buffer-default-size 4042424
841   "Size to shrink buffer if it grows too big."
842   :type 'integer
843   :group 'liece-vars)
844
845 (defcustom liece-buffer-check-interval (* 60 10)
846   "Interval between `buffer-size' checks."
847   :type 'integer
848   :group 'liece-vars)
849
850 (static-when (featurep 'xemacs)
851   (define-obsolete-variable-alias 'liece-buffer-maxsize
852     'liece-buffer-max-size)
853   (define-obsolete-variable-alias 'liece-buffer-defsize
854     'liece-buffer-default-size)
855   (define-obsolete-variable-alias 'liece-checkbuffer-interval
856     'liece-buffer-check-interval))
857
858 (defcustom liece-buffer-dispose-function (function bury-buffer)
859   "Function called after the buffer was disposed of."
860   :type 'function
861   :group 'liece-vars)
862
863 (defcustom liece-private-window-height 4
864   "How tall is the window for private messages when shown."
865   :type 'integer
866   :group 'liece-vars)
867
868 (defcustom liece-format-time-function
869   'liece-compose-time-string
870   "Function to convert `current-time-string' to the human readable form.
871 If you like to have the short format, set this to nil or to a
872 funtion (defun my-format (s) s)."
873   :type 'function
874   :group 'liece-vars)
875
876 (defcustom liece-keep-buffers t
877   "When (re)starting IRC, erase contents of old buffers."
878   :type 'boolean
879   :group 'liece-vars)
880
881 (defcustom liece-scroll-step nil
882   "The number of lines to try scrolling a window by when point moves out."
883   :type '(radio (integer :tag "Scroll Step")
884                 (const nil))
885   :group 'liece-look)
886
887 (defcustom liece-swap-private nil
888   "When showing private is it between under dialogue or not."
889   :type 'boolean
890   :group 'liece-vars)
891
892 (defcustom liece-buffer-preferences
893   (list
894    (cons ".*" liece-D-buffer))
895   "List of lists that contain regexp to match and `buffer-list' to insert.
896 Setting this as
897 (list
898  (cons \"#report\" (list \"*report-buffer*\"))
899  (cons \".*\" liece-D-buffer))
900 would cause messages from and to channel #report to be displayed on
901 buffer named *report-buffer* and all other messages are displayed on
902 dialogue-buffer."
903   :type '(repeat (cons (string :tag "Channel Name")
904                        (list (variable :tag "Buffe or Name"))))
905   :group 'liece-vars)
906
907 (defcustom liece-channel-conversion-map nil
908   "The map of channel conversion."
909   :type '(repeat (cons (string :tag "Channel Name")
910                        (string :tag "Channel Name (After Conversion)")))
911   :group 'liece-vars)
912
913 (defcustom liece-channel-conversion-default-mask "*.jp"
914   "The default mask of channel conversion."
915   :type 'string
916   :group 'liece-vars)
917
918 (defcustom liece-channel-id-length 5
919   "Length of channel ID for ! channels."
920   :type 'integer
921   :group 'liece-vars)
922
923 (defcustom liece-insert-environment-version nil
924   "If non-nil, display version description of current environment."
925   :type 'boolean
926   :group 'liece-vars)
927   
928 (provide 'liece-vars)
929
930 ;;; liece-vars.el ends here