* liece-vars.el (liece-channel-unread-list): New variable.
[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-defected-message-prefix ""
483   "Prefix to attach before the defected crypt message."
484   :type 'string
485   :group 'liece-prefix-string)
486
487 (defcustom liece-suspicious-message-prefix ""
488   "Prefix to attach before the suspicious crypt message."
489   :type 'string
490   :group 'liece-prefix-string)
491
492 (defcustom liece-change-prefix "*** Change: "
493   "String to add before changing messages."
494   :type 'string
495   :group 'liece-prefix-string)
496
497 (defcustom liece-notice-prefix "*** Notice: "
498   "String to add before any notice message."
499   :type 'string
500   :group 'liece-prefix-string)
501
502 (defcustom liece-broadcast-prefix "*** Broadcast: "
503   "String to add before any Broadcast message."
504   :type 'string
505   :group 'liece-prefix-string)
506
507 (defcustom liece-wallops-prefix "*** Notice: "
508   "String to add before any WALLOPS message."
509   :type 'string
510   :group 'liece-prefix-string)
511
512 (defcustom liece-error-prefix "*** Error: "
513   "String to add before any ERROR message."
514   :type 'string
515   :group 'liece-prefix-string)
516
517 (defcustom liece-info-prefix "*** Info: "
518   "String to add before any informational message."
519   :type 'string
520   :group 'liece-prefix-string)
521
522 (defcustom liece-timestamp-prefix "*** Time: "
523   "String to add before any timestamp message."
524   :type 'string
525   :group 'liece-prefix-string)
526
527 (defcustom liece-client-prefix "*** Client: "
528   "String to add before any CTCP message."
529   :type 'string
530   :group 'liece-prefix-string)
531
532 (defcustom liece-dcc-prefix "*** DCC: "
533   "String to add before any DCC message."
534   :type 'string
535   :group 'liece-prefix-string)
536
537 (defcustom liece-time-prefix-regexp "[0-9][0-9]:[0-9][0-9] "
538   "Time prefix regexp."
539   :type 'regexp
540   :group 'liece-prefix)
541
542 (defcustom liece-display-time t
543   "If non-nil, print time prefix on each line in channel buffer."
544   :type 'boolean
545   :group 'liece-prefix)
546
547 (defcustom liece-display-prefix-tag nil
548   "If non-nil, print prefix tag on each line in channel buffer."
549   :type 'boolean
550   :group 'liece-prefix)
551
552 (defcustom liece-generic-prefix-tag-regexp "\\*\\*\\* \\([^:]+: \\)"
553   "Regular expression for generic prefix tag."
554   :type 'regexp
555   :group 'liece-prefix)
556
557 ;; Misc.
558 (defcustom liece-blink-parens nil
559   "Should we blink matching parenthesis in liece command buffer?"
560   :type 'boolean
561   :group 'liece-vars)
562
563 (defcustom liece-show-wallops t
564   "Show wallops messages if usermode +ws."
565   :type 'boolean
566   :group 'liece-vars)
567
568 (defcustom liece-ignore-extra-notices t
569   "Don't show any notice unless they come from the local server."
570   :type 'boolean
571   :group 'liece-vars)
572
573 (defcustom liece-shorten-kills t
574   "Shorten KILL messages to about one line."
575   :type 'boolean
576   :group 'liece-vars)
577
578 (defcustom liece-ignore-changes nil
579   "Ignore changes? Good in topic-wars/link troubles."
580   :type 'boolean
581   :group 'liece-vars)
582
583 (defcustom liece-ignore-fakes nil
584   "If non nil, ignore fake notices if receiving them."
585   :type 'boolean
586   :group 'liece-vars)
587
588 (defcustom liece-signoff-message nil
589   "Default signoff message."
590   :type '(radio (string :tag "Signoff message"))
591   :group 'liece-vars)
592
593 (defcustom liece-away-message ""
594   "Default away message."
595   :type 'string
596   :group 'liece-vars)
597
598 (defcustom liece-beep-on-bells 'always
599   "If non-nil, and the IRC dialogue buffer is not selected in a window,
600 an IRC message arriving containing a bell character, will cause you
601 to be notified.
602 If value is 'always, an arriving bell will always cause a beep (or flash)."
603   :type '(radio (const :tag "Always" always) (const :tag "No" nil))
604   :group 'liece-vars)
605
606 (defcustom liece-beep-when-invited nil
607   "If non-nil, beep when invited."
608   :type 'boolean
609   :group 'liece-vars)
610
611 (defcustom liece-beep-when-privmsg nil
612   "If non-nil, beep when received privmsg."
613   :type 'boolean
614   :group 'liece-vars)
615
616 (defcustom liece-beep-words-list nil
617   "This list used for user defined beep rules."
618   :type '(repeat (string :tag "Beep Rules List"))
619   :group 'liece-vars)
620
621 (defcustom liece-system-fqdname (system-name)
622   "The fully qualified domain name of the system.
623 Default is what (system-name) returns."
624   :type 'string
625   :group 'liece-vars)
626
627 (defcustom liece-gather-channel-modes t
628   "Gather channel modes when joining channels."
629   :type 'boolean
630   :group 'liece-vars)
631
632 (defcustom liece-use-x-face nil
633   "Display X-Face in dialogue buffer."
634   :type 'boolean
635   :group 'liece-look)
636
637 ;; Send/Receive files.
638 (defcustom liece-file-accept nil
639   "Do we accept files."
640   :type 'boolean
641   :group 'liece-ctcp)
642
643 (defcustom liece-file-confirm-save nil
644   "Do we want confirmation on saving files."
645   :type 'boolean
646   :group 'liece-ctcp)
647
648 ;; Userinfos.
649 (defgroup liece-ctcp nil
650   "CTCP Settings"
651   :tag "CTCP"
652   :prefix "liece-"
653   :group 'liece)
654
655 (defcustom liece-ctcp-userinfo "No user information given."
656   "Userinfo message given to anyone asking."
657   :type 'string
658   :group 'liece-ctcp)
659
660 (defcustom liece-ctcp-x-face ""
661   "X-Face message given to anyone asking.  Proper form is \"X-Face: ....\"."
662   :type 'string
663   :group 'liece-ctcp)
664
665 (static-when (featurep 'xemacs)
666   (define-obsolete-variable-alias 'liece-client-userinfo
667     'liece-ctcp-userinfo)
668   (define-obsolete-variable-alias 'liece-client-x-face
669     'liece-ctcp-x-face))
670
671 (defcustom liece-timers
672   '((liece-command-poll-names liece-poll-names-interval)
673     (liece-command-keepalive liece-keepalive-interval)
674     (liece-command-poll-friends liece-poll-friends-interval))
675   "Symbol name to store timer, timer-function and timer-interval."
676   :type 'list
677   :group 'liece-server)
678
679 (defcustom liece-friends nil
680   "Friends to be checked consequently."
681   :type '(repeat (string :tag "Nick"))
682   :group 'liece-vars)
683
684 (defcustom liece-display-friends-function 'liece-303-display-friends
685   "Function to display friends status."
686   :type 'function
687   :group 'liece-vars)
688
689 (defcustom liece-poll-friends-interval 30
690   "Interval on seconds the existence of friends."
691   :type '(repeat
692           (integer :tag "Polling Interval in Seconds")
693           (const :tag "No" nil))
694   :group 'liece-server)
695
696 (defcustom liece-keepalive-interval nil
697   "Interval on seconds the existence of server connection is checked."
698   :type '(radio
699           (integer :tag "Seconds"
700                    :doc "Connection Interval in Seconds")
701           (const :tag "No" nil))
702   :group 'liece-server)
703
704 (defcustom liece-poll-names-interval nil
705   "Interval the names are polled from server."
706   :type '(radio
707           (integer :tag "Seconds"
708                    :doc "NAMES Polling Interval in Seconds")
709           (const :tag "No" nil))
710   :group 'liece-server)
711
712 (defcustom liece-timestamp-interval (* 60 10)
713   "Interval in seconds between timestamps in dialogue-buffer, nil for none."
714   :type '(radio
715           (integer :tag "Seconds"
716                    :doc "Timestamp Interval in Seconds")
717           (const "No" nil))
718   :group 'liece-server)
719
720 (defcustom liece-connection-timeout 60
721   "Default timeout interval."
722   :type 'integer
723   :group 'liece-server)
724   
725 (defcustom liece-timestamp-format (concat liece-timestamp-prefix "%s")
726   "Format-string for timestamp."
727   :type 'string
728   :group 'liece-format-string)
729
730 ;; Conversions: Not used.
731 (defcustom liece-send-convert-list nil
732   "Convert characters before sending to server."
733   :type '(repeat (character :tag "Character"
734                             :doc "Convert Character"))
735   :group 'liece-vars)
736
737 (defcustom liece-receive-convert-list nil
738   "Convert characters after receiving from server."
739   :type '(repeat (character :tag "Character"
740                             :doc "Convert Character"))
741   :group 'liece-vars)
742
743 ;; Ignores
744 (defgroup liece-ignore nil
745   "Ignore Settings"
746   :tag "Ignore"
747   :prefix "liece-"
748   :group 'liece-vars)
749
750 (defcustom liece-kill-nickname nil
751   "List of nicknames to be ignored.
752 Messages from these people won't be displayed."
753   :type '(repeat (string :tag "Nick" :doc "Ignore Nick"))
754   :group 'liece-ignore)
755
756 (defcustom liece-kill-realname nil
757   "List of real names to be ignored.
758 Messages from them won't be displayed."
759   :type '(repeat (string :tag "Realname" :doc "Ignore Realname"))
760   :group 'liece-ignore)
761
762 (defcustom liece-kill-logon nil
763   "List of logon names (user@host.dom.ain) to be ignored.
764 Messages from them won't be displayed."
765   :type '(repeat (string :tag "Logon" :doc "Ignore Logon Name"))
766   :group 'liece-ignore)
767
768 ;; New style ignore.
769 (defcustom liece-no-ignore-buffers nil
770   "A list of buffers that don't adhere to ignore-list."
771   :type '(repeat (string :tag "Buffer" :doc "Don't Ignore Buffer Names"))
772   :group 'liece-ignore)
773
774 (define-widget 'liece-ignore-spec 'repeat
775   "Edit server spec entries"
776   :convert-widget 'liece-ignore-spec-convert)
777
778 (defun liece-ignore-spec-convert (widget)
779   (let* ((type
780           '(radio
781             (string :tag "Type" :doc "Match for messagetype")
782             (const nil)))
783          (match
784           '(radio
785             (string :tag "Match" :doc "Match for string-in-message")
786             (const nil)))
787          (info-func
788           '(function :doc "Function whose return value is ignore info"))
789          (user-func
790           '(function :doc "Function whose return value is ignore user list"))
791          (name
792           '(repeat :tag "Name" (string :doc "Ignore user name")))
793          (spec
794           (` (list :value (nil nil)
795                    (choice :tag "Message"
796                     (cons (, type) (, match)) (const nil) (, info-func))
797                    (choice :tag "User" (const nil) (, user-func) (, name)))))
798          (args (` ((, spec)))))
799     (widget-put widget :args args)
800     widget))
801
802 (defcustom liece-ignore-list nil
803   "A list of buffers that don't adhere to ignore-list."
804   :type 'liece-ignore-spec
805   :group 'liece-ignore)
806
807 (defcustom liece-compress-changes t
808   "Set to t if we want instant compressed messages in the old format."
809   :type 'boolean
810   :group 'liece-vars)
811
812 (defcustom liece-compress-treshold 1
813   "Number of lines to search back for a previous matching join/part/quit/mode."
814   :type 'integer
815   :group 'liece-vars)
816
817 (defcustom liece-compress-mode-length 3
818   "Number of mode compression length."
819   :type 'integer
820   :group 'liece-vars)
821
822 (defcustom liece-buffer-max-size 4242424
823   "Maximum size (in bytes) of any liece buffer."
824   :type 'integer
825   :group 'liece-vars)
826
827 (defcustom liece-buffer-default-size 4042424
828   "Size to shrink buffer if it grows too big."
829   :type 'integer
830   :group 'liece-vars)
831
832 (defcustom liece-buffer-check-interval (* 60 10)
833   "Interval between `buffer-size' checks."
834   :type 'integer
835   :group 'liece-vars)
836
837 (static-when (featurep 'xemacs)
838   (define-obsolete-variable-alias 'liece-buffer-maxsize
839     'liece-buffer-max-size)
840   (define-obsolete-variable-alias 'liece-buffer-defsize
841     'liece-buffer-default-size)
842   (define-obsolete-variable-alias 'liece-checkbuffer-interval
843     'liece-buffer-check-interval))
844
845 (defcustom liece-private-window-height 4
846   "How tall is the window for private messages when shown."
847   :type 'integer
848   :group 'liece-vars)
849
850 (defcustom liece-format-time-function
851   'liece-compose-time-string
852   "Function to convert `current-time-string' to the human readable form.
853 If you like to have the short format, set this to nil or to a
854 funtion (defun my-format (s) s)."
855   :type 'function
856   :group 'liece-vars)
857
858 (defcustom liece-keep-buffers t
859   "When (re)starting IRC, erase contents of old buffers."
860   :type 'boolean
861   :group 'liece-vars)
862
863 (defcustom liece-scroll-step nil
864   "The number of lines to try scrolling a window by when point moves out."
865   :type '(radio (integer :tag "Scroll Step")
866                 (const nil))
867   :group 'liece-look)
868
869 (defcustom liece-swap-private nil
870   "When showing private is it between under dialogue or not."
871   :type 'boolean
872   :group 'liece-vars)
873
874 (defcustom liece-buffer-preferences
875   (list
876    (cons ".*" liece-D-buffer))
877   "List of lists that contain regexp to match and `buffer-list' to insert.
878 Setting this as
879 (list
880  (cons \"#report\" (list \"*report-buffer*\"))
881  (cons \".*\" liece-D-buffer))
882 would cause messages from and to channel #report to be displayed on
883 buffer named *report-buffer* and all other messages are displayed on
884 dialogue-buffer."
885   :type '(repeat (cons (string :tag "Channel Name")
886                        (list (variable :tag "Buffe or Name"))))
887   :group 'liece-vars)
888
889 (defcustom liece-channel-conversion-map nil
890   "The map of channel conversion."
891   :type '(repeat (cons (string :tag "Channel Name")
892                        (string :tag "Channel Name (After Conversion)")))
893   :group 'liece-vars)
894
895 (defcustom liece-channel-conversion-default-mask "*.jp"
896   "The default mask of channel conversion."
897   :type 'string
898   :group 'liece-vars)
899
900 (defcustom liece-channel-id-length 5
901   "Length of channel ID for ! channels."
902   :type 'integer
903   :group 'liece-vars)
904
905 (defcustom liece-insert-environment-version nil
906   "If non-nil, display version description of current environment."
907   :type 'boolean
908   :group 'liece-vars)
909   
910 (provide 'liece-vars)
911
912 ;;; liece-vars.el ends here