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