vars.el.in 52.9 KB
Newer Older
Linus Tolke's avatar
Linus Tolke committed
1
;;;;; -*- emacs-lisp -*-
Linus Tolke's avatar
Linus Tolke committed
2
;;;;; $Id$
3
;;;;; Copyright (C) 1991, 1996  Lysator Academic Computer Association.
Linus Tolke's avatar
Linus Tolke committed
4
5
6
7
8
;;;;;
;;;;; This file is part of the LysKOM server.
;;;;; 
;;;;; LysKOM is free software; you can redistribute it and/or modify it
;;;;; under the terms of the GNU General Public License as published by 
9
;;;;; the Free Software Foundation; either version 2, or (at your option) 
Linus Tolke's avatar
Linus Tolke committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
;;;;; any later version.
;;;;; 
;;;;; LysKOM is distributed in the hope that it will be useful, but WITHOUT
;;;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
;;;;; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
;;;;; for more details.
;;;;; 
;;;;; You should have received a copy of the GNU General Public License
;;;;; along with LysKOM; see the file COPYING.  If not, write to
;;;;; Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
;;;;; or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
;;;;; MA 02139, USA.
;;;;;
;;;;; Please mail bug reports to bug-lyskom@lysator.liu.se. 
;;;;;
Per Cederqvist's avatar
.    
Per Cederqvist committed
25
26
27
28
29
30
31
32
33
;;;; ================================================================
;;;; ================================================================
;;;;
;;;; File: vars.el
;;;;
;;;; This file contains almost all the variables used in lyskom.
;;;;


34
35
36
(defconst lyskom-clientversion-long 
  "$Id$\n"
  "Version for every file in the client.")
37
38


Per Cederqvist's avatar
.    
Per Cederqvist committed
39
40
41
42

(provide 'lyskom)


43
44
45
46
47
48
49
50
;;;;;; ================================================================
;;;;;;                    Emacs dependant variables
;;
;;(defvar kom-emacs-knows-iso-8859-1 t
;;  "*If non-nil then dont convert texts and other things to swascii.
;;This variable is not saved. It should be set in your .emacs
;;
;;This variable is not saved in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
51
52
53
54
55
56
57
58


;;;; ================================================================
;;;;                     Variables and constants.


;;; User flags

59
60
61
62
63
64
65
66
(defvar kom-allow-incompleteness nil
  "*If nil, commands like kom-list-news will wait for the prefetch.

If this flag is set to t, some commands may give incomplete answers,
but it might give them faster, especially during the login phase.

This variable is not stored in the LysKOM server, but it should be.")

67
68
69
70
71
72
73
74
(defvar kom-bury-buffers t
  "*Controls the behaviour of kom-next-kom and its cousins.
If this variable is non-nil the current buffer is sent to the back
of the buffer list when one of the commands `kom-next-kom',
`kom-previous-kom' or `kom-next-unread-kom' is invoked.

This variable is stored in the LysKOM server.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
75
(defvar kom-write-texts-in-window nil
David Byers's avatar
David Byers committed
76
77
78
79
80
81
82
83
84
  "*Where to edit texts. One of nil, other, new-frame, other-frame, a string
or a buffer.

nil means edit texts in the same window as the LysKOM buffer.
other means edit in another window, creating it if necessary.
other-frame means edit in another frame, if there is one.
new-frame means create a new frame for editing. The frame will be removed 
          when editing is finished.
a string or buffer means edit in the indicated buffer.
David Byers's avatar
David Byers committed
85
86

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
87

David Byers's avatar
David Byers committed
88
89
90
91
92
93
94
(defvar kom-prompt-format "%s"
  "*Basic format for LysKOM prompts. Needs to be a valid format
string. The only format specifier should be a single \"%s\", which
will be replaced by the real prompt.

This variable is stored in the LysKOM server")

95
96
97
98
99
(defvar kom-cite-string ">"
  "*String to insert before each line of a commented text.

This variable is stored in the LysKOM server.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
100
(defvar kom-created-texts-are-read t
David Byers's avatar
David Byers committed
101
102
103
  "*Non-nil means automatically mark texts that you create as read.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
104

David Byers's avatar
David Byers committed
105
106
107
108
109
110
111
112
113
114
115
116
117
118
(defvar kom-customize-in-window nil
  "*Where to customize LysKOM. See kom-write-texts-in-window")

(defvar kom-prioritize-in-window nil
  "*Where to prioritize conferences. See kom-write-texts-in-window")

(defvar kom-dont-restore-after-customize nil
  "*If non-nil then don't restore the window configuration after customizing
LysKOM.")

(defvar kom-dont-restore-after-prioritize nil
  "*If non-nil then don't restore the window configuration after prioritizing
conferences.")

119
(defvar kom-dont-restore-window-after-editing nil
David Byers's avatar
David Byers committed
120
121
122
  "*If non-nil then don't restore the window configuration after sending a text.

This variable is not saved in the LysKOM server.")
123

Per Cederqvist's avatar
.    
Per Cederqvist committed
124
(defvar kom-default-mark 100
David Byers's avatar
David Byers committed
125
126
127
  "*If non-nil (must be an integer) then the user is not asked for type of mark.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
128
129

(defvar kom-reading-puts-comments-in-pointers-last t
David Byers's avatar
David Byers committed
130
131
132
  "*If Non-nil the texts are shown with comments references at the end.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
133
134

(defvar kom-dashed-lines t
David Byers's avatar
David Byers committed
135
136
137
  "*If Non-nil then all texts will be surrounded by lines of dashes.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
138
139
140

(defvar kom-print-number-of-unread-on-entrance t
  "*If Non-nil then print automatically the number of unread articles when
David Byers's avatar
David Byers committed
141
142
143
entering a conference.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
144
145
146
147

(defvar kom-presence-messages t
  "*If non-nil, lyskom prints continuous info about what other people are doing.
Info is printed on the message line and never in the buffer. If minibuffer is
Linus Tolke's avatar
Linus Tolke committed
148
149
150
used then no message is printed.

If you want the messages in the buffer you could set the variable 
David Byers's avatar
David Byers committed
151
152
153
kom-presence-messages-in-buffer.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
154
155
156
157
158

(defvar kom-presence-messages-in-buffer nil
  "*If t, lyskom prints information about what other people are doing in buffer.
All printing is done just before the prompt.
If nil no messages are printed.
159
If 'presence then messages about people logging in, out and people 
David Byers's avatar
David Byers committed
160
161
162
changing name is printed.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
163
164
165

(defvar kom-show-where-and-what t
  "*Non-nil means kom-who-is-on shows from which machine the user is running
David Byers's avatar
David Byers committed
166
167
168
and what he is doing.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
169

170
171
172
173
174
175
(defvar kom-idle-hide 30
  "*The number of minutes of idle-time before a user is excluded from the list
of users. This can be overridden by a prefix argument to `kom-who-is-on'.

This variable is not stored in the LysKOM server.")

176
(defvar kom-show-footnotes-immediately t
David Byers's avatar
David Byers committed
177
178
179
  "*Non-nil means show footnotes immediately following the text.

This variable is stored in the LysKOM server.")
180

181
182
183
184
185
186
187
188
(defvar kom-follow-comments-outside-membership nil
  "*Show comments in conferences you are not a member of.

If this variable is nil, texts with no recipient you are a member of
will not be shown.

This variable is stored in the LysKOM server.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
189
190
(defvar kom-who-buffer-size-when-displaying 10
  "*Size of window to display the who-buffer.
David Byers's avatar
David Byers committed
191
192
193
This is used when executing the kom-display-who-buffer command.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
194
195

(defvar kom-read-depth-first t
David Byers's avatar
David Byers committed
196
197
198
  "*Non-nil means read comments and footnotes to a text before other texts.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
199

200
201
(defvar kom-continuous-scrolling t
  "*Non-nil means scroll LysKOM window as text is inserted. The last viewed
202
position (generally the most recent prompt) will always be visible.
203
204
205

This variable is stored in the LysKOM server.")

206
;; Should this be set to nil if baud-rate is low?
David Kågedal's avatar
David Kågedal committed
207
(defvar kom-deferred-printing t
208
209
210
211
212
  "*Non-nil means delay printing of some information not in the cache.
You might want to turn this off to have the old, linear behaviour.

This variable is not stored in the LysKOM server.")

213
214
(defvar lyskom-defer-indicator "[...]")

Per Cederqvist's avatar
.    
Per Cederqvist committed
215
216
217
218
(defvar kom-higher-priority-breaks nil
  "*Non-nil means allow texts from conferences with highter priority to break in.
If the value is 'express then texts are allowed to break in the middle of a
comment chain.  Otherwise we dont let them in until the end of the comment
David Byers's avatar
David Byers committed
219
220
221
tree.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
222

223
224
225
226
227
228
229
(defvar lyskom-view-text-hook nil
  "*Hook that is called before a text is shown. When the hooks is
called, text is bound to the text mass of the text and text-stat to
the text-stat of the text to be shown.

This variable is not stored in the LysKOM server.")

David Byers's avatar
David Byers committed
230
231
232
233
234
235
236
237
238
239
(defvar lyskom-send-message-hook '(lyskom-send-message-trim-newlines)
  "*Hook that is called before a personal, group or common message is sent. 

When called, lyskom-message-string is bound to the message that will be sent
and lyskom-message-recipient to the conf-stat of the recipient or nil if
the recipient does not exist or if the message is a common message.

If lyskom-message-string is set to nil by a hook, the message will not
be sent.")

240
241
242
243
244
245
246
247
(defvar lyskom-send-message-setup-hook nil
  "*Hook that is called when the minibuffer is entered to read a message.")

(defvar lyskom-send-message-exit-hook nil
  "*Hook that is called when the minibuffer is exited after reading a message.")

(defvar lyskom-after-load-hook nil
  "*Hook to run once after lyskom is loaded.
David Byers's avatar
David Byers committed
248
249

This variable is not saved in the LysKOM server.")
David Kågedal's avatar
David Kågedal committed
250

251
(defvar lyskom-login-hook nil
252
  "*What to do when logged in.
253
254
255
256
257
258
This hook is called after we have logged in but before and command is
accepted from the keyboard. It is called immediately before
kom-login-hook.

This variable is not stored in the LysKOM server.")

David Kågedal's avatar
David Kågedal committed
259
(defvar kom-login-hook nil
Per Cederqvist's avatar
.    
Per Cederqvist committed
260
261
  "*What to do when logged in.
This is a list of commands that are executed after we have logged in but before
262
any command is accepted from the keyboard. See also lyskom-login-hook.
David Byers's avatar
David Byers committed
263
264

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
265

Linus Tolke's avatar
Linus Tolke committed
266
(defvar kom-do-when-done '(kom-review-all-marked-texts kom-display-time)
Per Cederqvist's avatar
.    
Per Cederqvist committed
267
268
269
270
271
272
273
274
275
  "*What to do when all texts are read.
This is a list of commands and lists of commands that are prompted for
and executed when there are no more new texts.  The last element in
the list is the one that will never be removed from the list.
A command can be one of:
type			prompt
lyskom-function		from the lyskom-command-name function.
command			\"Kommandot:\" name of function or definition of
			lambda expression
David Byers's avatar
David Byers committed
276
277
278
keyboard macro		\"Kommandot:\" keyboard macro definition.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
279

280
281
(defvar kom-page-before-command nil
  "*This is a list of all commands before which the screen is cleared.
David Byers's avatar
David Byers committed
282
283
284
If it isn't a list and isn't nil the screen is cleared before all commands.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
285

David Byers's avatar
David Byers committed
286
(defvar kom-permissive-completion t
287
288
289
290
291
292
  "*If t, completion on logged-in persons will usually also include
persons who are not logged in. Values other than t or nil are reserved
for future use.

This variable is stored in the LysKOM server.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
293
294
295
296
297
(defvar kom-membership-default-priority 100
  "*Default priority when joining a new conference.
If a valid priority then new conferences are read with this priority. 
Otherwise ask the user for a priority.

David Byers's avatar
David Byers committed
298
299
300
Valid priorities are only the range 0-255.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
301
302
303
304
305
306
307

(defvar kom-membership-default-placement 'last
  "*Tells the system where to put new conferences.
The value can be one of the following:
'first => before all other conferences.
'last => after all other conferences.
a number => at that position
David Byers's avatar
David Byers committed
308
309
310
otherwise => the new conf is entered after all conferences.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
311
312

(defvar lyskom-prompt-text " - "
David Byers's avatar
David Byers committed
313
314
315
  "*Text to end the prompt.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
316
317

(defvar lyskom-prompt-executing-default-command-text ". "
David Byers's avatar
David Byers committed
318
319
320
  "*Text to end the prompt while the default-commands is executing.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
321

322
323
324
325
(defvar lyskom-current-prompt nil
  "The current prompt or nil.
This is either nil, indicating that there is currently no prompt, or
one a symbol indcating which prompt is shown in the LysKOM buffer.
David Byers's avatar
David Byers committed
326
327

This variable is not saved in the LysKOM server.")
Linus Tolke's avatar
Linus Tolke committed
328

329
330
331
332
333
(defvar kom-show-personal-messages-in-buffer t
  "*Buffer to show personal messages in.
If nil, discard them.
If t, insert them in the *kom* buffert.
If non-nil and non-t this should be a buffer or a name of a (possibly
David Byers's avatar
David Byers committed
334
335
336
nonexistent) buffer in which the message is inserted.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
337

338
339
(defvar kom-pop-personal-messages nil
  "*Non-nil means pop up a buffer with personal messages as they arrive.
David Byers's avatar
David Byers committed
340
341
342
kom-show-personal-messages-in-buffer decides which buffer to pop.

This variable is stored in the LysKOM server.")
343

344
345
346
(defvar kom-ding-on-priority-break 1
  "*Non-nil means ding if a higher priority text or conference breaks in.
A number means the number of times to ding. A string is an argument for the
David Byers's avatar
David Byers committed
347
348
349
program named by kom-audio-player.

This variable is stored in the LysKOM server.")
350

351
352
353
354
355
356
357
358
(defvar kom-ding-on-wait-done 1
  "*Non-nil means ding when busy-waiting finishes.
A number means the number of times to ding. A string is an argument
for the program named by kom-audio-player. A symbol is interpreted as a 
function to call.

This variable is stored in the LysKOM server.")

359
(defvar kom-ding-on-common-messages 0
360
  "*Non-nil means ding as common messages arrive. 
361
A number means the number of times to ding. A string is an argument for the
362
363
program named by kom-audio-player. A symbol is interpreted as a function to
call.
David Byers's avatar
David Byers committed
364
365

This variable is stored in the LysKOM server.")
366
367

(defvar kom-ding-on-group-messages 1
368
  "*Non-nil means ding as group messages arrive.
369
A number means the number of times to ding. A string is an argument for the
370
371
program named by kom-audio-player. A symbol is interpreted as a function
to call.
David Byers's avatar
David Byers committed
372
373

This variable is stored in the LysKOM server.")
374
375

(defvar kom-ding-on-personal-messages 2
376
  "*Non-nil means ding as personal messages arrive.
377
A number means the number of times to ding. A string is an argument for the
378
379
program named by kom-audio-player. A symbol is interpreted as a function 
to call.
David Byers's avatar
David Byers committed
380
381
382
383

This variable is stored in the LysKOM server")

(defvar lyskom-ding-on-no-subject 2
384
  "*How to ding if the user has not entered a subject line.
385
386
387
A number means the number of times to ding. A string is an argument for the
program named by kom-audio-player. A symbol is interpreted as a function 
to call.
David Byers's avatar
David Byers committed
388
389

This variable is not saved in the LysKOM server.")
390
391

(defvar kom-audio-player "audioplay"
David Byers's avatar
David Byers committed
392
393
394
  "*Program to play audio files.

This variable is not saved in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
395

David Byers's avatar
David Byers committed
396
397
398
399
(defvar kom-default-message-recipient 'group
  "*Determines default recipient of personal messages.

everybody means the default recipient is everybody.
David Byers's avatar
David Byers committed
400
401
402
403
404
group     means the default recipient is the group to which the last
          message was sent, if it was a group message. If the last message
          was a personal message or a common message, it means the same as 
          sender. 
sender    means the sender of the last message received.
David Byers's avatar
David Byers committed
405

David Byers's avatar
David Byers committed
406
This variable is stored in the LysKOM server.")
David Byers's avatar
David Byers committed
407

408
409

(defvar lyskom-filter-outgoing-messages t
410
  "*t if outgoing remote-control messages and automatic replies are not
David Byers's avatar
David Byers committed
411
412
413
414
415
416
417
418
to be displayed in the buffer.

This variable is not saved in the LysKOM server.")

(defvar kom-friends nil
  "*List of people whose names should be formatted using kom-friends-face.

This variable is stored in the LysKOM server.")
419

420
(defvar kom-default-face-scheme nil  
David Byers's avatar
David Byers committed
421
422
423
424
  "*Face scheme to use per default for new logins.

This variable is not saved in the LysKOM server.")

425
426
(defvar kom-text-properties t
  "*Non-nil means to insert text properties in the Emacs buffer for
David Byers's avatar
David Byers committed
427
428
429
various LysKOM elements.

This variable is not saved in the LysKOM server.")
430

431
(defvar kom-use-button-hints t
David Byers's avatar
David Byers committed
432
433
434
  "*Non-nil means use button hints for overriding default actions.

This variable is not saved in the LysKOM server.")
435

David Byers's avatar
David Byers committed
436
437
438
439
;;;
;;; lyskom-button-actions has been moved to swedish-strings.el on account
;;; of there being a bunch of language-dependent strings in it.
;;;
440
441
442
443
444


(defvar lyskom-text-buttons
  '(
    ;; Text numbers
445
446
447
448
449
450
    ("\\(\\<[0-9][0-9][0-9][0-9]\\([0-9]\\)?\\([0-9]\\)?\\([0-9]\\)?\\>\\)" 
                                        ; Match
     text                               ; Button type
     0                                  ; Portion that's a button
     1                                  ; Portion that's the arg
     nil                                ; Face or nil (=default)
451
452
453
454
     )

    ;; URLs

455
456
457
    ("\\(file://\\|ftp://\\|gopher://\\|http://\\|https://\\|news:\\|wais://\\|mailto:\\|telnet:\\)[^\t \012
\"<>|\\]*[^\t \012
\"<>|.,!(){}?'`]" 
458
459
460
461
462
463
464
     url 0 nil kom-url-face)

    ;; JySKom enhancements

    ("<(m[|ö]te *\\([0-9]+\\)[^0-9]*)>" conf 0 1 nil)
    ("<(text *\\([0-9]+\\)[^0-9]*)>" text 0 1 nil)
    ("<(person *\\([0-9]+\\)[^0-9]*)>" pers 0 1 nil)
David Kågedal's avatar
David Kågedal committed
465
    )
466
467
468
469
470
471
  "List of buttons to install in the text mass of LysKOM objects. Each element is
a list consisting of REGEXP TYPE BUTTON-MATCH BUTTON-ARG-MATCH FACE.
REGEXP is the regexp to look for in the text.
TYPE is the button type. Valid button types are defined in lyskom-button-actions
BUTTON-MATCH is the number of the parenthesized expression that is the actual button.
BUTTON-ARG-MATCH is the number of the expression to used as the button argument.
David Byers's avatar
David Byers committed
472
473
474
FACE is the text face to apply to the button, or nil to use the default face.

This variable is not saved in the LysKOM server")
475
476
477
478
479


(defvar kom-url-viewer-preferences '("emacs"
				    "netscape"
				    "w3")
David Byers's avatar
David Byers committed
480

481
  "*LysKOM will attempt to use URL viewers in the order specified here.
David Byers's avatar
David Byers committed
482
483
484
485
486
487
488
489
490
491
492
493
494
kom-url-managers is a list of all available viewers. Note that the elements
are all strings.

When you select an URL, this list is used to determine which URL
viewer to use in the following manner: Each element is in turn matched
against the manager regexp for each manager in kom-url-managers, and the
first manager found that matches is used to display the URL.

See kom-url-managers for a list of all available URL viewers. See
kom-netscape-command and kom-mosaic-command for information specific 
to some URL viewers.

This variable is not saved in the LysKOM server.")
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521


(defvar kom-url-managers '(("w3" 
			    "\\(http\\|gopher\\|ftp\\)"
			    "Emacs W3" 
			    lyskom-view-url-w3)
			   ("netscape"
			    ".*"
			    "Netscape Navigator"
			    lyskom-view-url-netscape)
			   ("\\(emacs\\|dired\\)"
			    "\\(ftp\\|file\\)"
			    "dired"
			    lyskom-view-url-dired)
			   ("\\(emacs\\|telnet-mode\\)"
			    "telnet"
			    "emacs telnet"
			    lyskom-view-url-telnet)
			   ("\\(emacs\\|mail-mode\\)"
			    "mailto"
			    "mail-mode"
			    lyskom-view-url-mailmode)
			   ("mosaic"
			    "\\(http\\|gopher\\|ftp\\|mailto\\|news\\|wais\\|file\\|te|net\\)"
			    lyskom-view-url-mosaic))

  "List of URL managers. Each element is a list consisting of
David Byers's avatar
David Byers committed
522
523
524
525
526
(MANAGER-REGEXP PROTOCOLS NAME VIEW-FUNCTION). When LysKOM attempts to
view an URL, kom-url-viewer-preferences is scanned, and the URL
manager whose MANAGER-REGEXP first matches an element in
kom-url-viewer-preferences and whose PROTOCOLS matches the protocol of
the selected URL is used to view the URL by calling its VIEW-FUNCTION
David Byers's avatar
David Byers committed
527
528
529
with the URL and the manager entry as arguments.

This variable is not saved in the LysKOM server.")
530
531

(defvar kom-mosaic-command "/usr/local/bin/mosaic"
David Byers's avatar
David Byers committed
532
  "*Command to run to start Mosaic
533

David Byers's avatar
David Byers committed
534
535
536
537
538
539
540
541
542
543
544
545
546
547
This variable is not saved in the LysKOM server.")

(defvar kom-netscape-command "netscape"

  "*Command to run to start Netscape.

If a string, it should be a command that starts Netscape with no
arguments. If a list, the first element must be a command that starts
Netscape. The remaining elements are used as arguments to Netscape.

For instance, a value of \"netscape\" is valid, but \"netscape -d host:0\"
is not. Instead, the latter should be \(\"netscape\" \"-d\" \"host:0\"\)

This variable is not saved in the LysKOM server.")
548

549
(defvar kom-confirm-multiple-recipients 'after
550
551
  "*Non-nil means ask the user for confirmation about recipients.
When the user writes a comment to a text with more than one recipient
552
553
554
he gets a y-or-n-p question for all recipients. 'before means check
before opening the edit buffer. Anything else means check before
sending the article.
David Byers's avatar
David Byers committed
555
556

This variable is stored in the LysKOM server.")
557

558
559
560
561
562
563
564
(defvar kom-check-commented-author-membership t
  "*Non-nil means check that the authors of the commented texts are
members of at least one of the recipient conferences. If not, offer to
add them as recipients.

This variable is saved in the LysKOM server.")

565
566
567
568
569
570
(defvar kom-inhibit-typeahead nil
  "*If non-nil, discard keyboard input that arrives while a LysKOM command is
executing. 

This variable is saved in the LysKOM server.")

David Kågedal's avatar
David Kågedal committed
571
(defvar kom-max-buffer-size nil
David Byers's avatar
David Byers committed
572
573
574
  "*If non-nil, ensure that buffers won't grow any larger than this

This variable is not saved in the LysKOM server.")
David Kågedal's avatar
David Kågedal committed
575

David Byers's avatar
David Byers committed
576
(defvar lyskom-print-complex-dates (and (>= emacs-minor-version 29)
David Byers's avatar
David Byers committed
577
					(>= emacs-major-version 19))
578
579
580
  "If non-nil, print today and yesterday using a special format. Doesn't
work very well with Emacs 19.28 or older. You may want to set this to nil,
but never set it to non-nil explicitly.
David Byers's avatar
David Byers committed
581
582

This variable is not saved in the LysKOM server.")
583

David Kågedal's avatar
David Kågedal committed
584
(defvar kom-server-aliases
David Kågedal's avatar
David Kågedal committed
585
586
587
  '(("kom.lysator.liu.se" . "LysKOM")
    ("kom.ludd.luth.se" . "LuddKOM")
    ("rydkom.rydnet.lysator.liu.se" . "RydKOM")
David Kågedal's avatar
David Kågedal committed
588
589
590
    ("kom.csd.uu.se" . "CSD-KOM")
    ("striterax.medio.mh.se" . "MedioKOM")
    ("kom.mds.mdh.se" . "MdS-KOM"))
591
  "*An alist mapping server names to shorter identification strings
David Byers's avatar
David Byers committed
592
593

This variable is not saved in the LysKOM server.")
David Kågedal's avatar
David Kågedal committed
594

David Byers's avatar
David Byers committed
595
596
597
598

(defvar kom-ansaphone-on nil
  "t if automatic replies to personal messages are in effect.")

599
600
601
602
603
604
605
606
607
608
(defvar kom-ansaphone-record-messages t
  "*t if messages are recorded while the ansaphone is on.

This variable is stored in the lyskom server.")

(defvar kom-ansaphone-show-messages t
  "*t if messages are to be shown when they are recorded.

This variable is stored in the LysKOM server.")

609
610
611
612
613
614
615
616
(defvar lyskom-ansaphone-messages nil
  "Messages collected by the automatic reply facility.
The most recent message is the first message in the list.")


(defvar lyskom-ansaphone-when-set (current-time-string)
  "Time when the auto-reply facility was enabled.")

David Byers's avatar
David Byers committed
617
618

(defvar kom-remote-control t
David Byers's avatar
David Byers committed
619
620
621
  "*t if LysKOM may be remotely controlled.

This variable is stored in the LysKOM server.")
David Byers's avatar
David Byers committed
622
623
624
625

(defvar kom-remote-controllers nil 
  "*Persons who may control LysKOM using messages.By default you can
always control your own sessions. See kom-self-control for more
David Byers's avatar
David Byers committed
626
627
628
information.

This variable is stored in the LysKOM server.")
David Byers's avatar
David Byers committed
629
630
631

(defvar kom-self-control t
  "*If non-nil, remote control commands are accepted from sessions logged
David Byers's avatar
David Byers committed
632
633
634
in as the same user as the current session.

This variable is stored in the LysKOM server.")
David Byers's avatar
David Byers committed
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655

(defvar kom-ansaphone-replies
  '((group nil nil nil nil)
    (common nil nil nil nil))
  "*List of automatic replies to various messages.

A list of (MESSAGE-TYPE SENDER RECIPIENT TEXT REPLY)
    MESSAGE-TYPE is one of personal, group or common or nil
    SENDER is a list of integers or a single integer or nil
    RECIPIENT is a list of integers or a single integer or nil
    TEXT is a regular expression or nil
    REPLY is a string or nil

When an incoming message arrives and the auto-reply facility is on,
this list is checked for automatic replies. The message type, sender,
recipient and text of the incoming messages is matched against the 
elements of this list. If a match is found, the corresponding reply is
send. A nil in one of the message-type, sender, recipient or text
components in the list is taken to mean a wildcard. A null reply means
don't send a reply.

David Byers's avatar
David Byers committed
656
657
658
If none of the elements match, KOM-ANSAPHONE-DEFAULT-REPLY is sent.

This variable is not saved in the LysKOM server.")
David Byers's avatar
David Byers committed
659

Niels Möller's avatar
Niels Möller committed
660
661
662
663
664
(defvar lyskom-language 'sv
  ;; One might extend this into a list of languages, sorted in
  ;; preference order.
  "*Which language to use.

665
Supported languages are 'sv and 'en")
Niels Möller's avatar
Niels Möller committed
666

David Byers's avatar
David Byers committed
667

David Kågedal's avatar
David Kågedal committed
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
;;; =================================================================
;;;
;;; Language-dependent variables
;;;

(defvar lyskom-edit-mode-map nil
  "Mode map for LysKOM edit.")

(defvar lyskom-edit-prefix nil
  "Mode-map for lyskom edit mode.")

(defvar lyskom-onoff-table nil
  "A completion table for on and off selections.")

(defvar lyskom-filter-predicate-list nil
      "A list of legal filter comparison predicates.")

(defvar lyskom-filter-what nil
      "A list of legal filter conditions and their textual representation.")

(defvar lyskom-filter-actions nil
      "A list of legal filter actions an their textual representation.")

(defvar lyskom-text-start nil
  "Regexp matching beginning of a text in lyskom buffer.
Cf. paragraph-start.")

(defvar lyskom-filter-edit-map nil
  "Keymap for LysKOM filter edit")

(defvar lyskom-prioritize-mode-map nil
  "Keymap used in lyskom-prioritize-mode.")

(defvar lyskom-prioritize-header-lines nil
  "Number of lines in the header of the prioritization buffer")

(defvar lyskom-prioritize-header nil
  "Header for the reprioritization buffer")

(defvar kom-ansaphone-default-reply nil
  "*Default message to send when the ansaphone is on.

This variable is stored in the LysKOM server.")

(defvar lyskom-button-actions nil

"This variable defines valid button types in LysKOM. Each element is a
list consisting of (TYPE LABEL DEFAULT ACTIONS HINTS).
TYPE is the button type the entry defines
LABEL is a textual representation for the button type, used in menu titles. If
      it is a symbol, that symbol will be looked up using lyskom-get-string.
DEFAULT is the default action to take on a click. It must be a function.
ACTIONS are other possible actions. The format of this entry is described 
        below.
HINTS is a list of hints to override the default action. This is described 
      below.

The ACTIONS entry is used to construct a pop-up menu. It is a list consisting 
of lists with the format (STRING . FUNCTION). STRING is the menu label and
FUNCTION is the function to call when the menu item is selected.

The HINTS entry is used to generate hints that the default action should be 
overridden. It is a list containing elements (COMMAND . HINT) where COMMAND is
as interactive LysKOM command and HINT is a function to call. When a button
is generated while the command COMMAND is being executed, HINT is used as a 
hint for a new default action. The user has the option to ignore or used the 
hint.

Also see the function \"lyskom-add-button-action\".

This variable is not saved in the LysKOM server.")

740
741
(put 'lyskom-button-actions 'lyskom-language-force t)

David Kågedal's avatar
David Kågedal committed
742
743
744
745
746
747
748
749
(defvar kom-mercial nil
  "*When the user has seen all texts and has reached the view-time prompt,
this string is used as the argument to lyskom-tell-server.
Users are encouraged to use their best sense of humor.

This variable is stored in the LysKOM server.")


David Byers's avatar
David Byers committed
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
;;; =================================================================
;;;
;;; Inherited variables
;;;

(eval-and-compile
  (defvar lyskom-inherited-variables
    '(
      lyskom-buffer
      lyskom-proc
      lyskom-accept-async-flag
      lyskom-dynamic-session-info-flag
      lyskom-idle-time-flag
      lyskom-long-conf-types-flag
      lyskom-set-last-read-flag
      lyskom-uconf-stats-flag
      lyskom-z-lookup-flag
      lyskom-server-supports
      lyskom-collate-table
769
      lyskom-language
David Byers's avatar
David Byers committed
770
771
772
773
774
775
776
777
778
779
780
781
782
783
      )
    "Variables that all buffers associated with a LysKOM buffer inherit."))


(eval-and-compile
  (defvar lyskom-protected-variables 
    (append '(lyskom-reset-var 
              lyskom-dedicated-frame
              kill-buffer-hook 
              lyskom-original-window-configuration)
            lyskom-inherited-variables)
    "Variables that need to be protected by lyskom-protect-environment."))


Niels Möller's avatar
Niels Möller committed
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
(defconst lyskom-commands
  '(
    describe-mode
    kom-slow-mode
    kom-quick-mode
    kom-send-message
    kom-create-conf
    kom-delete-conf
    kom-delete-text
    kom-display-time
    kom-go-to-conf
    kom-go-to-next-conf
    kom-jump
    kom-list-conferences 
    kom-list-persons
    kom-list-news
    kom-list-re
    kom-membership
    ;; kom-list-marks
    kom-postpone
    kom-set-session-priority
    kom-prioritize
    kom-status-person
    kom-status-conf
    kom-add-self
    kom-list-summary
    kom-sub-self
    kom-quit
    kom-recover 
    kom-start-anew
    kom-view
    kom-find-root-review
    kom-review-comments
    kom-review-tree
    kom-review-clear
    kom-review-last-normally-read
    kom-review-noconversion
    kom-review-next
    kom-find-root
    kom-review-by-to
    kom-review-more
    kom-review-first
    kom-review-all
    kom-view-commented-text
    kom-view-previous-commented-text
    kom-review-stack
    kom-review-presentation
    kom-review-backward
    kom-view-next-text
    kom-who-is-on 
    kom-who-am-i
    ;;   kom-display-who-buffer
    kom-list-clients
    kom-busy-wait
    kom-write-comment
    kom-comment-previous
    kom-write-footnote
    kom-private-answer
    kom-private-answer-previous
    kom-set-unread
    kom-write-text
    kom-send-letter
    kom-change-name
    kom-change-password
    kom-change-supervisor
    kom-change-presentation
    kom-get-appreciation
    kom-get-abuse
    kom-mark-text
    kom-unmark-text
    kom-review-marked-texts
    kom-review-all-marked-texts
    kom-add-recipient
    kom-add-copy
    kom-sub-recipient
    kom-move-text
    kom-add-comment
    kom-sub-comment
    kom-add-member
    kom-sub-member
    kom-change-conf-motd
    kom-set-garb-nice
    kom-set-super-conf
    kom-set-permitted-submitters
    kom-unset-conf-motd
    kom-save-text
    kom-edit-options
    kom-save-options
    kom-shutdown-server
    kom-sync-database
    kom-enable-adm-caps
    kom-disable-adm-caps
    kom-set-motd
    kom-remove-motd
    kom-force-logout
    kom-list-files
    kom-put-file
    kom-get-file
    kom-filter-author
    kom-filter-subject
    kom-filter-text
    kom-super-jump
    kom-filter-edit
    kom-list-filters
    kom-show-user-area
    kom-change-conf-type

    kom-change-auto-reply
    kom-toggle-auto-reply
    kom-list-messages
    kom-erase-messages

    kom-remote-autoreply
    kom-remote-set-message
    kom-remote-list-messages
    kom-remote-erase-messages
    kom-remote-quit

    kom-status-session
    ))

905
(defconst lyskom-elisp-variables
906
907
  '(kom-permissive-completion
    kom-bury-buffers
908
    kom-ding-on-personal-messages
909
910
    kom-ding-on-group-messages
    kom-ding-on-common-messages
David Byers's avatar
David Byers committed
911
    kom-ding-on-priority-break
912
    kom-ding-on-wait-done
David Byers's avatar
David Byers committed
913
914
    kom-show-personal-messages-in-buffer
    kom-pop-personal-messages
David Byers's avatar
David Byers committed
915
    kom-prompt-format
916
917
918
919
920
921
    kom-do-when-done
    kom-higher-priority-breaks
    kom-login-hook
    kom-membership-default-placement
    kom-membership-default-priority
    kom-mercial 
922
    kom-inhibit-typeahead
923
    kom-page-before-command 
924
    kom-continuous-scrolling
925
926
927
928
929
    kom-permanent-filter-list
    kom-presence-messages-in-buffer
    kom-quit-hook
    kom-show-where-and-what
    kom-who-buffer-size-when-displaying
David Byers's avatar
David Byers committed
930
    kom-default-message-recipient
931
    kom-write-texts-in-window
David Byers's avatar
David Byers committed
932
933
    kom-prioritize-in-window
    kom-customize-in-window
934
    kom-cite-string
935
936
    kom-remote-control
    kom-remote-controllers
David Byers's avatar
David Byers committed
937
    kom-self-control
938
    kom-ansaphone-default-reply
David Byers's avatar
David Byers committed
939
    kom-ansaphone-replies
940
941
    kom-ansaphone-record-messages
    kom-ansaphone-show-messages
David Byers's avatar
David Byers committed
942
    kom-show-footnotes-immediately
943
    kom-follow-comments-outside-membership
David Byers's avatar
David Byers committed
944
    kom-friends
945
    kom-check-commented-author-membership
946
947
948
949
950
951
952
    lyskom-fetch-map-nos
    lyskom-new-text-hook
    lyskom-prefetch-conf-tresh 
    lyskom-prefetch-confs
    lyskom-prefetch-texts
    lyskom-prompt-executing-default-command-text
    lyskom-prompt-text
Niels Möller's avatar
Niels Möller committed
953
954
    lyskom-who-info-has-changed-hook
    lyskom-language)
955
  "Tells the client what flags and hooks that are to be saved in the server.
Per Cederqvist's avatar
.    
Per Cederqvist committed
956
957
These are the flags that are saved in the elisp-client part of the server.")

958
(defconst lyskom-global-boolean-variables '(
Per Cederqvist's avatar
.    
Per Cederqvist committed
959
960
961
962
963
964
  kom-created-texts-are-read
  kom-dashed-lines
  kom-presence-messages
  kom-print-number-of-unread-on-entrance
  kom-read-depth-first
  kom-reading-puts-comments-in-pointers-last
965
  kom-confirm-multiple-recipients
Per Cederqvist's avatar
.    
Per Cederqvist committed
966
)
967
968
  "List of flags that are to be saved as booleans in the common block.

Per Cederqvist's avatar
.    
Per Cederqvist committed
969
970
Dont change this. These are defined by the protocol.")
				  
971
972
973
974
975
976
(defconst lyskom-global-non-boolean-variables '(
  kom-default-mark
)
  "List of flags that are to be saved in the common block.
These are the non-boolean ones. See: lyskom-global-boolean-variables.

977
Dont change these. These are defined by the protocol.")
978

Per Cederqvist's avatar
.    
Per Cederqvist committed
979
980
981
982
983

;;; ================================================================
;;;                  Internal variables and constants


984
(defconst lyskom-clientversion "@@CLIENTVERSION@@"
Per Cederqvist's avatar
.    
Per Cederqvist committed
985
986
987
988
989
  "Version of the LysKOM elisp client.")

(defconst lyskom-max-int 8388607
  "The largest int emacs, and thus this LysKOM client, can handle.")

990
(defconst lyskom-server-features
991
992
993
  '(((>= 1 9 0) (lyskom-accept-async-flag
                 lyskom-dynamic-session-info-flag
                 lyskom-idle-time-flag))
994
995
996
997
998
999
1000
    ((>= 1 8 0) (lyskom-long-conf-types-flag 
                 lyskom-set-last-read-flag
                 lyskom-uconf-stats-flag))
    ((>= 1 7 0) (lyskom-z-lookup-flag))
    ((= 1 9 0) ((protocol-version 9)))
    ((= 1 8 0) ((protocol-version 8)))
    ((= 1 7 0) ((protocol-version 7)))
1001
1002
    ((= 1 7 1) ((protocol-version 7)))
    ((< 1 7 0) ((protocol-version 6))))
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
  "List describing which features a certain server version has.
Each element is a list containing the server version and what it
supports:

\(VERSION SUPPORTS\)

VERSION is a list of \(RELATION MAJOR MINOR REVISION\) RELATION is one
of >= \(features apply to server at or above the specified version\)
or = \(features apply to only that server version\). MAJOR, MINOR and
REVISION are integers that are compared to the actual server version.

SUPPORTS is a list of cons pairs and symbols. Cons pairs are placed in
the lyskom-server-supports list, symbols are interpreted as variable
names set to 't'.")


(defvar lyskom-server-version '(0 0 0)
  "The version of the server.  A list of three integers, major
version, minor version and revision.")

(defvar lyskom-server-supports nil
  "Assoc list of features supported by the LysKOM server. See
lyskom-server-features for more information.")

1027
1028
1029
1030
1031
1032
(defvar lyskom-idle-time-flag nil
  "t if idle time calls are supported by the server.")

(defvar lyskom-dynamic-session-info-flag nil
  "t if dynamic session info is supported by the server.")

1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
(defvar lyskom-long-conf-types-flag nil
  "t if extended conf types are supported by the server.")

(defvar lyskom-set-last-read-flag nil
  "t if the set-last-read call is supported by the server.")

(defvar lyskom-uconf-stats-flag nil
  "t if the server supports the get-uconf-stat call.")

(defvar lyskom-z-lookup-flag nil
  "t if the server supports regexp name lookups.")

(defvar lyskom-accept-async-flag nil
  "t if the server supports the accept-async call.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
1048
1049
1050
1051
1052
1053
(defvar lyskom-max-packet-size lyskom-max-int
  "The largest possible packet size that can be transmitted to a
TCP/IP connection. This should be unlimited, but in practise there
are systems that limits this. This variable is automatically adjusted
if any problems are detected.")

Linus Tolke's avatar
Linus Tolke committed
1054
1055
1056
1057
(defvar lyskom-do-when-done nil
  "Internal of kom-do-when-done.")

(defvar lyskom-do-when-starting nil
1058
  "Internal of kom-do-when-starting. Obsolete")
Linus Tolke's avatar
Linus Tolke committed
1059
1060
1061
1062
1063
1064
1065
1066

(defvar lyskom-list-of-edit-buffers nil
  "Keeps track of active edit-buffers.")

(defvar lyskom-sessions-with-unread nil
  "List of lyskom-sessions with unread texts.
This is not buffer-local.")

1067
1068
1069
(defvar lyskom-sessions-with-unread-letters nil
  "List of lyskom-sessions with unread letters.
This is not buffer-local.")
Linus Tolke's avatar
Linus Tolke committed
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082

(defvar lyskom-buffer nil
  "What is the lyskom-buffer we are connected to.")

(defvar output nil
  "Uaark. Just to omit a warning...")

(defvar lyskom-errno nil
  "Errno of last lyskom error.")

(defvar lyskom-parse-pos nil
  "Position of parsing.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
(defvar lyskom-unparsed-buffer nil
  "Buffer containing unparsed information from the server.")

(defvar lyskom-unparsed-marker nil
  "Here are we inserting now.")

(defvar lyskom-to-be-printed-before-prompt nil
  "Contains the strings to be printed out before the next prompt.")

(defvar lyskom-other-clients-user-areas nil
  "Contains the parts of the user areas of unknown klients.
The area is a pair: name . info (both strings).")

(defvar lyskom-pending-calls nil
  "Assoc-list of calls to LysKOM server that have not yet completed.
Each element on the list has the format
	(REF-NO . KOM-QUEUE)
REF-NO	   unique number assigned by lyskom-send-packet.
KOM-QUEUE is a kom-queue. (See lyskom-call-data).")

David Kågedal's avatar
David Kågedal committed
1103
(defvar lyskom-output-queues nil
Per Cederqvist's avatar
.    
Per Cederqvist committed
1104
  "Pending output to the server.
David Kågedal's avatar
David Kågedal committed
1105
1106
1107
This is a vector of ten elements, each of which is a kom-queue. calls from
queues with a higher index (priority) are always sent first.

Per Cederqvist's avatar
.    
Per Cederqvist committed
1108
1109
1110
1111
1112
At most lyskom-max-pending-calls calls are sent at once.")

(defvar lyskom-max-pending-calls 20
  "*Max number of calls that are transmitted to the server at once.
Extra calls are queued in lyskom-output-queue and sent when the replies
David Byers's avatar
David Byers committed
1113
1114
1115
returns.

This variable is not saved in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129

(defvar lyskom-number-of-pending-calls 0
  "Number of pending calls that are transmitted to the server.")

(defvar lyskom-ref-no 0
  "Next ref-no to use. These ref-nos are used to keep track of the
different packets.")

(defvar lyskom-pers-no 0
  "The pers-no of the current user.")

(defvar lyskom-session-no 0
  "Session number in the server for this connection")

David Kågedal's avatar
David Kågedal committed
1130
1131
1132
(defvar lyskom-session-priority 0
  "*This sessions priority.
Only texts in conferences with a priority equal to or higher than this
David Byers's avatar
David Byers committed
1133
1134
1135
will be shown.

This variable is not saved in the LysKOM server.")
David Kågedal's avatar
David Kågedal committed
1136

Per Cederqvist's avatar
.    
Per Cederqvist committed
1137
1138
1139
1140
1141
1142
(defvar lyskom-proc nil
  "The process (network connection) that is associated with this buffer.")

(defvar lyskom-server-info nil
  "Info about the server")

1143
1144
(defvar lyskom-server-name ""
  "The name of the server")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1145

1146
1147
1148
(defvar lyskom-buffer-list nil
  "List of all LysKOM buffers.")

David Byers's avatar
David Byers committed
1149
1150
1151
(defvar lyskom-who-info-cache nil
  "Cache of who info.")

1152
1153
1154
(defvar lyskom-static-session-info-cache nil
  "Cache of session.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
1155
1156
(defvar lyskom-conf-cache nil
  "Cache of conference statuses.")
1157
1158
1159

(defvar lyskom-uconf-cache nil
  "Cache of small conference statuses.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178

(defvar lyskom-pers-cache nil
  "Cache of person statuses.")

(defvar lyskom-text-cache nil
  "Cache of text statuses.")

(defvar lyskom-text-mass-cache nil
  "Cache of texts.")

(defvar lyskom-marked-text-cache nil
  "Cache of marks of all texts the current user has marked. ")

(defvar lyskom-who-info-cache nil
  "Cache of people presently logged in in LysKOM.")

(defvar lyskom-who-info-buffer nil
  "Buffer for the who info presentation.")

Linus Tolke's avatar
Linus Tolke committed
1179
(defvar lyskom-who-info-buffer-is-on t
1180
1181
  "Says wether we are collecting who-information or not.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230

(defvar lyskom-is-parsing t
  "True when parsing a result.
This is used to prevent parallell parsing since the parser is not reentrant.")

(defvar lyskom-string-bytes-missing 0
  "Number of bytes missing in the unparsed buffer when parsing a string.
Set when parsing a string and there were not enough bytes in the buffer
with the unparsed bytes. This variable is used to prevent reparsing before 
the string is complete.
This variable is buffer-local in the unparsed-buffer.")

(defvar lyskom-last-viewed 0
  "Postition of the first char of the last line that the user has had
time to view. This is normally the pos of the first char of the prompt.")

(defvar lyskom-mode-map nil
  "Keymap used in LysKOM mode.")


(defvar lyskom-reading-list nil
  "List of articles to read in the current conference.
Each element is a read-info. Only one of the elements is of the type CONF.
This one is located last in the list (except for the elements of the type 
REVIEW, REVIEW-TREE or REVIEW-MARK).
When reading an article with comments a list of the comments is built
recursively if the flag kom-read-depth-first is non-nil.
This is to keep track of the reading order.
Articles can exist in several of the read-info elements. All unread articles
in the conference are always present in the CONF type entry in this list even
if also in other entries. (COMM-IN, FOOTN-IN)

Some powerful reviewing commands requires to construct a list of articles that
should be read. These use the type REVIEW. When reviewing trees and when
every viewed article is supposed to be followed by all its comments then the
type REVIEW-TREE is used.

The first element is a dummy.")

(defvar lyskom-to-do-list nil
  "List of conferences with unread texts.
Each element is a read-info. All have the type 'CONF and there is one for
every conference with unread articles that have been prefetched already.
The list is sorted in falling priority. 
When going to a conference the first element (the one with the highest
priority) is copied from this list to lyskom-reading-list.

The first element is a dummy.")

David Byers's avatar
David Byers committed
1231
1232
1233
(defvar lyskom-quit-flag nil
  "A flag indicating if the filter was interrupted by C-g.
 It is set to the same value as quit-flag on filter exit.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1234

David Kågedal's avatar
David Kågedal committed
1235
1236
1237
1238
(defvar lyskom-inhibit-minibuffer-messages nil
  "A flag indicating whether asynchronous minibuffer messages are allowed.
If this variable is non-nil, no asynchronous messages will appear.")

David Kågedal's avatar
David Kågedal committed
1239
1240
1241
(defvar lyskom-is-saving nil
  "A flag indicating whether the server is saving at the moment.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
1242
1243
1244
;;; These variables control prefetch of conf-stats, text-stats and texts:

(defvar lyskom-prefetch-texts 3
David Byers's avatar
David Byers committed
1245
1246
  "*Number of texts to prefetch.

1247
1248
This is currently not used.

David Byers's avatar
David Byers committed
1249
This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1250
1251
1252

(defvar lyskom-prefetch-conf-tresh 50
  "*If fewer than lyskom-prefetch-conf-tresh texts are known, ask for more
David Byers's avatar
David Byers committed
1253
1254
conf-stats from server.

1255
1256
This is currently not used.

David Byers's avatar
David Byers committed
1257
This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1258
1259

(defvar lyskom-prefetch-confs 10
David Byers's avatar
David Byers committed
1260
1261
  "*Number of confs to ask about at once when checking for unread texts.

1262
1263
This is currently not used.

David Byers's avatar
David Byers committed
1264
This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1265
1266
1267

(defvar lyskom-fetch-map-nos 50
  "*Number of text-nos lyskom will fetch when fetching maps.
David Byers's avatar
David Byers committed
1268
1269

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1270

1271
1272
1273
1274
1275
1276
(defvar lyskom-fetch-membership-length 6
  "*Number of entries in the membership-list that is fetched at a time.
This should be optimized depending on how often you read lyskom and
the activity in the first groups in you membership list.

Best performance is achieved if you, when logging in, always have an unread
David Byers's avatar
David Byers committed
1277
1278
1279
article in one of the first lyskom-fetch-membership-length conferences.

This variable is not saved in the LysKOM server.")
1280

1281
1282
1283
(defvar lyskom-prefetch-limit 1
  "Number of prefetch requests the client will try to keep going
at a time.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1284
1285


1286
;;;
Per Cederqvist's avatar
.    
Per Cederqvist committed
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303

(defvar lyskom-membership nil
  "Sorted membership-list of the logged in person.")

(defvar lyskom-unread-confs nil
  "List containing all unread confs.")

(defvar lyskom-dont-change-prompt nil
  "Non-nil during the entry of a text.")

(defvar lyskom-command-to-do 'unknown
  "Atom describing what command to do. See the function lyskom-what-to-do.")

(defvar lyskom-is-waiting nil
  "If non-nil then this is the condition for the waiting to be stopped.
If t however just meaning user is waiting for a text with prompt.
It is a form that will be evaluated (using eval) every time the asynchronous
Per Cederqvist's avatar
Per Cederqvist committed
1304
1305
1306
message \"new text\" is received.

This is used by the command kom-busy-wait.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316

(defvar lyskom-current-conf 0
  "Current conference. 0 means user is not reading any conf.")

(defvar lyskom-current-text nil
  "Text-no of current text. nil means no text is current.")

(defvar lyskom-previous-text nil
  "Text-no of previous text.  Nil means no text.")

1317
1318
1319
(defvar lyskom-normally-read-texts nil
  "Stack of texts that are read normally. Used for kom-review-last-normally-read.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
1320
1321
1322
(defvar lyskom-current-subject ""
  "Current subject.")

1323
1324
1325
1326
1327
1328
(defvar lyskom-last-added-rcpt 0
  "The default conference when adding a recipient.")

(defvar lyskom-last-added-ccrcpt 0
  "The default conference when adding a ccrecipient.")

1329
1330
(defvar lyskom-saved-file-name (concat default-directory "kom-text")
  "The default file name when saving a lyskom-text.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1331
1332

(defvar lyskom-mode-hook nil
1333
  "*Hook to run when lyskom-mode is entered.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1334

Linus Tolke's avatar
Linus Tolke committed
1335
(defvar kom-quit-hook nil
1336
  "*Hook to run when the LysKOM session is correctly ended.
David Byers's avatar
David Byers committed
1337
1338

This variable is stored in the LysKOM server.")
Linus Tolke's avatar
Linus Tolke committed
1339

1340
(defvar kom-quit-when-idle t
David Byers's avatar
David Byers committed
1341
  "Non-niil to automatically quit when LysKOM is full and the session is idle")
1342

1343
(defvar kom-permanent-filter-list nil
David Byers's avatar
David Byers committed
1344
1345
1346
  "List of patterns to filter permanently

This variable is stored in the LysKOM server.")
1347
1348
1349
1350

(defvar kom-session-filter-list nil
  "List of patterns to filter during this session")

1351

1352
1353
1354
(defvar lyskom-filter-list nil
  "List of patterns that are filtered.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
1355
1356
1357
1358
1359
1360
(defvar lyskom-new-text-hook nil
  "*Hook to run when a new text is created.
This hook is run after the prompt is removed if it shall be changed but before
the text Text 4711 {r skapad! is printed in the message area. And before the
new prompt is printed.
If the text: Text 4711 {r skapad! should not be printed then the hook should 
David Byers's avatar
David Byers committed
1361
1362
1363
set the local variable no-message non-nil.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1364
1365
1366

(defvar lyskom-who-info-has-changed-hook nil
  "*Hook to run every time the who-info-buffer has changed.
David Byers's avatar
David Byers committed
1367
1368
1369
The hook is run with current-buffer the lyskom buffer, not the who-info-buffer.

This variable is stored in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1370

1371
1372
1373
1374
1375
(defvar lyskom-personal-message-hook nil
  "*Hook to run when a personal message is received.
When the hook is run 'sender' is bound to the pers-stat of the sender
of the message (or possibly nil), 'recipient' is 0 if the message is a
public message and otherwise the pers-no of the user, and 'message' is
David Byers's avatar
David Byers committed
1376
1377
1378
a string that holds the message.

This variable is not saved in the LysKOM server.")
1379
1380


Per Cederqvist's avatar
.    
Per Cederqvist committed
1381
1382
1383
1384
(defvar lyskom-executing-command t
  "Non-nil means the client is executing a command.
Most commands can't be interrupted by another command.")

1385
1386
1387
(defvar lyskom-current-command nil
  "The command currently being executed.")

1388
1389
1390
1391
1392
1393
1394
(defvar lyskom-current-function nil
  "Sometimes set to the current high-level function being executed.")

(defvar lyskom-current-function-phase nil
  "Sometimes set to the phase of the curreht high-level function being
executed.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
1395
1396
1397
(defvar kom-low-priority -1
  "*Priority that the current conference are set to when they are
aborted. nil means don't alter priority. (That means that
David Byers's avatar
David Byers committed
1398
1399
1400
kom-go-to-next-conf might go to the same conference again.)

This variable is not saved in the LysKOM server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411

(defvar lyskom-membership-is-read nil
  "T when the membership has been read.")

(defvar lyskom-is-writing nil
  "t when the user is writing a text.")

(defvar lyskom-debug-communications-to-buffer nil
  "Non-nil means all communications with the server is stored in a buffer.
The name is stored in lyskom-debug-communications-to-buffer-buffer.")
  
1412
1413
1414
(defvar lyskom-debug-what-i-am-doing t
  "Non-nil means asynchronous message 5 will be logged to the debug buffer. ")

1415
(defvar lyskom-debug-communications-to-buffer-buffer "*kom*-debugs"
Per Cederqvist's avatar
.    
Per Cederqvist committed
1416
1417
1418
  "Name of the buffer to insert the communications with the server into if
lyskom-debug-communications-to-buffer is non-nil.")

1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
(defvar lyskom-blocking-process nil
  "The process the where the lyskom-session is.
If blocking-do is called from a buffer that is no well-connected to the 
lyskom-session, i.e. the lyskom-proc variable is not set, then this variable
has to be set for the blocking-do to be able to know what process to send
questions to. This is the case when called from the minibuffer when 
completing.")

(defvar lyskom-doing-default-command nil
  "Non-nil if LysKOM is executing the default command.")

(defvar lyskom-first-time-around nil
  "Non-nil if LysKOM is being entered for the first time.")

David Byers's avatar
David Byers committed
1433
(defvar lyskom-experimental-features nil
1434
  "If non-nil, LysKOM is likely to blow up in your face.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1435

David Byers's avatar
David Byers committed
1436
1437
1438
(defvar lyskom-format-experimental nil
  "If non-nil, LysKOM is likely to make a fool out of you.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
1439
1440
1441
1442
(defvar lyskom-count-var 0
  "This variable is used for counting things in the client, such as
unread texts in list-unread.")

1443
1444
1445
1446
1447
1448
(defvar lyskom-default-conf-string nil
  "The default string to use for an unknown conference.
Set this locally when inserting a conference name using
lyskom-format-insert if you want to replace the usual description of
an unknown conference.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
1449
1450
1451
1452

(defvar lyskom-is-administrator nil
  "This variable is t if the user is in administrator mode and nil otherwise.")

1453
1454
1455
1456
1457
1458
(defvar lyskom-emacs19-p nil
  "This variable is t if LysKOM is running in Emacs 19")

(defvar lyskom-last-personal-message-sender ""
  "Name of sender of last personal message received")

David Kågedal's avatar
David Kågedal committed
1459
1460
1461
(defvar lyskom-last-group-message-recipient ""
  "Name of target for last group message received")

David Kågedal's avatar
David Kågedal committed
1462
1463
1464
(defvar lyskom-is-new-user nil
  "An internal variable used in kom-start-anew")

David Byers's avatar
David Byers committed
1465
(defvar lyskom-apo-timeout-s 1
David Byers's avatar
David Byers committed
1466
  "Seconds timeout for accept-process-output")
David Byers's avatar
David Byers committed
1467

David Byers's avatar
David Byers committed
1468
1469
1470
(defvar lyskom-apo-timeout-ms nil
  "Microseconds timeout for accept-process-output")

1471
1472
1473
(defvar lyskom-collate-table nil
  "Table mapping characters to equivalent characters.")

David Byers's avatar
David Byers committed
1474
1475
1476
(defvar lyskom-dont-read-user-area nil
  "If non-nil the user area will not be read on login.")

1477
1478
1479
1480
1481
(defvar lyskom-show-comments t
  "This should always be set to t.")    ;+++SOJGE

(defvar kom-no-comments-to-motd nil
  "This should always be set to nil unless you are Klaus Zeuge.") ;+++SOJGE
Per Cederqvist's avatar
.    
Per Cederqvist committed
1482

1483
1484
1485
;;;; lyskom-tell-phrases-validation-keyword-list
;;; This is a list of keywords for kom-tell-phrases.
;;; These are the only keywords that are allowed in kom-tell-phrases.
1486

1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
;;; To coders of the elisp-client:
;;; If you add/delete a reference to any of these keywords make sure
;;; you update these changes.

;;; To everyone:
;;; The kom-tell-phrases list is checked against this list when the
;;; client is loaded, i.e. by lyskom-tell-phrases-validate that causes
;;; an error if any keyword is not present or any non-keyword is
;;; present.

(defconst lyskom-tell-phrases-validation-keyword-list
1498
  '(
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
    (kom-tell-silence)
    (kom-tell-send)
    (kom-tell-login)
    (kom-tell-read)
    (kom-tell-1st-pres)
    (kom-tell-write-comment)
    (kom-tell-write-footnote)
    (kom-tell-write-letter)
    (kom-tell-write-reply)
    (kom-tell-write-text)
    (kom-tell-conf-pres)
    (kom-tell-recover)
    (kom-tell-wait)
    (kom-tell-regret)
    (kom-tell-review)
    (kom-tell-change-name)
    (kom-tell-change-supervisor)
    (kom-tell-next-lyskom)
1517
    )
1518
  "Users must not change this constant, but are encouraged to change
1519
1520
the value of  kom-tell-phrases  for fun.")

1521
1522
1523
1524
1525
1526
1527
;;; ================================================================
;;; Commands lists that are removed from extended command depending on
;;; administrator status.

(defconst lyskom-admin-removed-commands
  '(kom-enable-adm-caps))
(defconst lyskom-noadmin-removed-commands
1528
1529
  '(kom-disable-adm-caps kom-remove-motd kom-set-motd kom-shutdown-server
                         kom-sync-database))
1530