vars.el.in 61.2 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.
;;;;


David Byers's avatar
X    
David Byers committed
34
35
36
(setq lyskom-clientversion-long 
      (concat lyskom-clientversion-long
	      "$Id$\n"))
37

David Byers's avatar
X    
David Byers committed
38
(provide 'lyskom)
39

David Byers's avatar
X    
David Byers committed
40
(require 'lyskom-defvar "defvar")
Per Cederqvist's avatar
.    
Per Cederqvist committed
41

David Byers's avatar
David Byers committed
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
(defconst lyskom-global-boolean-variables '(
  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
  kom-confirm-multiple-recipients
)
  "List of flags that are to be saved as booleans in the common block.

Dont change this. These are defined by the protocol.")
				  
(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.

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


David Byers's avatar
X    
David Byers committed
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

(defun lyskom-protect-variable (sym) 
  (put sym 'permanent-local t)
  (lyskom-local-variable sym)
  (add-to-list 'lyskom-protected-variables sym))

(defun lyskom-local-variable (sym)
  (add-to-list 'lyskom-local-variables sym))

(defun lyskom-inherited-variable (sym)
  (add-to-list 'lyskom-inherited-variable sym)
  (lyskom-protect-variable sym))

(defun lyskom-setup-local-variables ()
  (mapcar 'make-local-variable lyskom-local-variables)
  (mapcar 'make-local-hook lyskom-local-hooks))
Per Cederqvist's avatar
.    
Per Cederqvist committed
80

David Byers's avatar
David Byers committed
81
82
(def-kom-var kom-dont-read-saved-variables '(kom-dont-read-saved-variables
                                             lyskom-login-hook)
David Byers's avatar
David Byers committed
83
84
85
86
  "*Non nil means don't read some variables from the server.
t means don't read any variables. A list means don't read variables that
are in the list.")

Per Cederqvist's avatar
.    
Per Cederqvist committed
87

88
89
90
;;;;;; ================================================================
;;;;;;                    Emacs dependant variables
;;
David Byers's avatar
X    
David Byers committed
91
;;(def-kom-var kom-emacs-knows-iso-8859-1 t
92
93
94
95
;;  "*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
96
97
98
99
100
101
102
103


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


;;; User flags

David Byers's avatar
X    
David Byers committed
104
(def-kom-var kom-allow-incompleteness nil
105
106
  "*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,
David Byers's avatar
X    
David Byers committed
107
108
109
but it might give them faster, especially during the login phase."
  server
)
110

David Byers's avatar
X    
David Byers committed
111
(def-kom-var kom-bury-buffers t
112
113
114
  "*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',
David Byers's avatar
X    
David Byers committed
115
116
`kom-previous-kom' or `kom-next-unread-kom' is invoked."
  server)
117

David Byers's avatar
X    
David Byers committed
118
(def-kom-var kom-write-texts-in-window nil
David Byers's avatar
David Byers committed
119
120
121
122
123
124
125
126
  "*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.
David Byers's avatar
X    
David Byers committed
127
128
a string or buffer means edit in the indicated buffer."
  server)
129

David Byers's avatar
X    
David Byers committed
130
131
132
(def-kom-var kom-view-commented-in-window 'other
  "*Where to view commented texts. See kom-write-texts-in-window for details"
  server)
David Byers's avatar
David Byers committed
133

David Byers's avatar
X    
David Byers committed
134
135
136
137
(def-kom-var kom-edit-filters-in-window nil
  "*Where to edit filters. See kom-write-texts-in-window for
more information."
  server)
David Byers's avatar
David Byers committed
138

David Byers's avatar
X    
David Byers committed
139
140
141
142
(def-kom-var kom-list-membership-in-window 'other
  "*Where to list membership. See kom-write-texts-in-window for
more information."
  server)
143

David Byers's avatar
X    
David Byers committed
144
145
146
(def-kom-var kom-customize-format 'long
  "*Format of the customize buffer. Must be long or short."
  server)
147

David Byers's avatar
X    
David Byers committed
148
149
150
(def-kom-var kom-user-prompt-format "%[%c% %m%] - "
  "*Format of LysKOM prompt when waiting for input."
  server)
David Byers's avatar
David Byers committed
151

Per Cederqvist's avatar
.    
Per Cederqvist committed
152

David Byers's avatar
X    
David Byers committed
153
154
155
(def-kom-var kom-user-prompt-format-executing "%[%c% %m%]."
  "*Format of LysKOM prompt when executing a default command"
  server)
David Byers's avatar
David Byers committed
156
157


David Byers's avatar
X    
David Byers committed
158
159
160
(def-kom-var kom-enabled-prompt-format "%[%c% %m%] # "
  "*Format of LysKOM prompt when in enabled mode."
  server)
David Byers's avatar
David Byers committed
161

162

David Byers's avatar
X    
David Byers committed
163
164
165
166
(def-kom-var kom-enabled-prompt-format-executing "%[%c% %m%]."
  "*Format of LysKOM prompt when executing a default command in 
enabled mode."
  server)
David Byers's avatar
David Byers committed
167

David Byers's avatar
David Byers committed
168

David Byers's avatar
X    
David Byers committed
169
170
171
(def-kom-var kom-cite-string ">"
  "*String to insert before each line of a commented text."
  server)
172

David Byers's avatar
X    
David Byers committed
173
174
175
(def-kom-var kom-created-texts-are-read t
  "*Non-nil means automatically mark texts that you create as read."
  server)
David Byers's avatar
David Byers committed
176

David Byers's avatar
X    
David Byers committed
177
178
179
(def-kom-var kom-customize-in-window nil
  "*Where to customize LysKOM. See kom-write-texts-in-window"
  server)
Per Cederqvist's avatar
.    
Per Cederqvist committed
180

David Byers's avatar
X    
David Byers committed
181
182
183
(def-kom-var kom-prioritize-in-window nil
  "*Where to prioritize conferences. See kom-write-texts-in-window"
  server)
David Byers's avatar
David Byers committed
184

David Byers's avatar
X    
David Byers committed
185
186
187
(def-kom-var kom-default-mark 100
  "*If non-nil (must be an integer) then the user is not asked for type of mark."
  server)
Per Cederqvist's avatar
.    
Per Cederqvist committed
188

David Byers's avatar
X    
David Byers committed
189
190
(def-kom-var kom-reading-puts-comments-in-pointers-last t
  "*If Non-nil the texts are shown with comments references at the end."
David Byers's avatar
David Byers committed
191
192
  server
  inherited)
David Byers's avatar
David Byers committed
193

David Byers's avatar
X    
David Byers committed
194
195
(def-kom-var kom-dashed-lines t
  "*If Non-nil then all texts will be surrounded by lines of dashes."
David Byers's avatar
David Byers committed
196
197
  server
  inherited)
Per Cederqvist's avatar
.    
Per Cederqvist committed
198

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
(def-kom-var kom-text-footer-format nil
  "*If non-nil, this specifies the format of a text footer.

The following format directives are legal:

    %n      The text number.
    %p      The number of the author.
    %P      The name of the author
    %-      A bunch of dashes
    %f      Information about the text in parentheses.

Format letters can be prefixed with a number specifying the minimum
field width. The field width can be prefixed with an equals sign which
means that the field is exactly as wide as specified (contents may be
truncated.) A negative field width means left justify the contents.

The field width of %- is special. It specifies the maximum number of
dashes the print. The actual number will be the maximum minus the
length of the author's name, if it is included anywhere in the format
string.

When set, this variable overrides kom-dashed-lines and
kom-show-author-at-end.

The default format is equivalent to the following strings, depending on 
the settings of kom-dashed-lines and kom-show-author-at-end.

kom-dashed-lines    kom-show-author-at-end      Format
t                   t                           \"(%n) /%P/%42-%f\"
t                   nil                         \"(%n) %42-%f\"
nil                 t                           \"(%n) /%P/ %f\"
nil                 nil                         \"(%n) %f\"
"
  server
  inherited)



David Byers's avatar
David Byers committed
237
238
(def-kom-var kom-show-author-at-end t
  "*If non-nil then the author will be shown at the end of each text."
David Byers's avatar
David Byers committed
239
240
  server
  inherited)
David Byers's avatar
David Byers committed
241

David Byers's avatar
X    
David Byers committed
242
(def-kom-var kom-print-number-of-unread-on-entrance t
Per Cederqvist's avatar
.    
Per Cederqvist committed
243
  "*If Non-nil then print automatically the number of unread articles when
David Byers's avatar
X    
David Byers committed
244
245
entering a conference."
  server)
Per Cederqvist's avatar
.    
Per Cederqvist committed
246

David Byers's avatar
X    
David Byers committed
247
(def-kom-var kom-presence-messages t
Per Cederqvist's avatar
.    
Per Cederqvist committed
248
249
  "*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
250
251
252
used then no message is printed.

If you want the messages in the buffer you could set the variable 
David Byers's avatar
X    
David Byers committed
253
254
kom-presence-messages-in-buffer."
  server)
David Byers's avatar
David Byers committed
255

David Byers's avatar
X    
David Byers committed
256
(def-kom-var kom-presence-messages-in-buffer nil
Per Cederqvist's avatar
.    
Per Cederqvist committed
257
258
259
  "*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.
260
If 'presence then messages about people logging in, out and people 
David Byers's avatar
X    
David Byers committed
261
262
changing name is printed."
  server)
Per Cederqvist's avatar
.    
Per Cederqvist committed
263

David Byers's avatar
X    
David Byers committed
264
(def-kom-var kom-show-where-and-what t
Per Cederqvist's avatar
.    
Per Cederqvist committed
265
  "*Non-nil means kom-who-is-on shows from which machine the user is running
David Byers's avatar
X    
David Byers committed
266
267
and what he is doing."
  server)
David Byers's avatar
David Byers committed
268

Per Cederqvist's avatar
.    
Per Cederqvist committed
269

David Byers's avatar
X    
David Byers committed
270
(def-kom-var kom-idle-hide 30
271
  "*The number of minutes of idle-time before a user is excluded from the list
David Byers's avatar
X    
David Byers committed
272
273
of users. This can be overridden by a prefix argument to `kom-who-is-on'."
  server)
274

David Byers's avatar
X    
David Byers committed
275
276
277
(def-kom-var kom-show-footnotes-immediately t
  "*Non-nil means show footnotes immediately following the text."
  server)
278

David Byers's avatar
X    
David Byers committed
279
(def-kom-var kom-follow-comments-outside-membership nil
280
281
282
  "*Show comments in conferences you are not a member of.

If this variable is nil, texts with no recipient you are a member of
David Byers's avatar
X    
David Byers committed
283
284
will not be shown."
  server)
285

David Byers's avatar
X    
David Byers committed
286
(def-kom-var kom-who-buffer-size-when-displaying 10
Per Cederqvist's avatar
.    
Per Cederqvist committed
287
  "*Size of window to display the who-buffer.
David Byers's avatar
X    
David Byers committed
288
289
This is used when executing the kom-display-who-buffer command."
  server)
Per Cederqvist's avatar
.    
Per Cederqvist committed
290

David Byers's avatar
X    
David Byers committed
291
292
293
(def-kom-var kom-read-depth-first t
  "*Non-nil means read comments and footnotes to a text before other texts."
  server)
David Byers's avatar
David Byers committed
294

Per Cederqvist's avatar
.    
Per Cederqvist committed
295

David Byers's avatar
X    
David Byers committed
296
(def-kom-var kom-continuous-scrolling t
297
  "*Non-nil means scroll LysKOM window as text is inserted. The last viewed
David Byers's avatar
X    
David Byers committed
298
299
position (generally the most recent prompt) will always be visible."
  server)
300
301


302
;; Should this be set to nil if baud-rate is low?
David Byers's avatar
X    
David Byers committed
303
(def-kom-var kom-deferred-printing t
304
  "*Non-nil means delay printing of some information not in the cache.
David Byers's avatar
X    
David Byers committed
305
You might want to turn this off to have the old, linear behaviour.")
306

David Byers's avatar
X    
David Byers committed
307
308
(def-kom-var lyskom-defer-indicator "[...]"
  "String to display while LysKOM is waiting for the real string.")
309

David Byers's avatar
X    
David Byers committed
310
(def-kom-var kom-higher-priority-breaks nil
Per Cederqvist's avatar
.    
Per Cederqvist committed
311
312
313
  "*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
X    
David Byers committed
314
315
tree."
  server)
Per Cederqvist's avatar
.    
Per Cederqvist committed
316

David Byers's avatar
X    
David Byers committed
317
(def-kom-var lyskom-view-text-hook nil
318
319
  "*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
David Byers's avatar
X    
David Byers committed
320
the text-stat of the text to be shown.")
321
322


David Byers's avatar
X    
David Byers committed
323
(def-kom-var lyskom-send-message-hook '(lyskom-send-message-trim-newlines)
David Byers's avatar
David Byers committed
324
325
326
327
328
329
330
331
332
  "*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.")

David Byers's avatar
X    
David Byers committed
333
(def-kom-var lyskom-send-message-setup-hook nil
334
335
  "*Hook that is called when the minibuffer is entered to read a message.")

David Byers's avatar
X    
David Byers committed
336
(def-kom-var lyskom-send-message-exit-hook nil
337
338
  "*Hook that is called when the minibuffer is exited after reading a message.")

David Byers's avatar
David Byers committed
339
340
341
342
(def-kom-var lyskom-send-text-hook nil
  "*Hook that is called before sending a text. Hook functions return t to
signal suggess and nil to prevent the text from being sent.")

David Byers's avatar
X    
David Byers committed
343
344
(def-kom-var lyskom-after-load-hook nil
  "*Hook to run once after lyskom is loaded.")
David Byers's avatar
David Byers committed
345

David Byers's avatar
David Byers committed
346
347
348
349
350
(def-kom-var lyskom-change-conf-hook nil
  "*Hook to run when changing conferences.
The functions in this list are run with two arguments. The first is the 
current conf-no and the second is the conf-no being changed to.")

David Byers's avatar
X    
David Byers committed
351
(def-kom-var lyskom-login-hook nil
352
  "*What to do when logged in.
353
354
This hook is called after we have logged in but before and command is
accepted from the keyboard. It is called immediately before
David Byers's avatar
X    
David Byers committed
355
kom-login-hook.")
356

David Byers's avatar
X    
David Byers committed
357
(def-kom-var kom-login-hook nil
Per Cederqvist's avatar
.    
Per Cederqvist committed
358
359
  "*What to do when logged in.
This is a list of commands that are executed after we have logged in but before
David Byers's avatar
X    
David Byers committed
360
361
any command is accepted from the keyboard. See also lyskom-login-hook."
  server)
David Byers's avatar
David Byers committed
362

Per Cederqvist's avatar
.    
Per Cederqvist committed
363

David Byers's avatar
X    
David Byers committed
364
(def-kom-var kom-do-when-done '(kom-review-all-marked-texts kom-display-time)
Per Cederqvist's avatar
.    
Per Cederqvist committed
365
366
367
368
369
370
371
372
373
  "*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
X    
David Byers committed
374
375
keyboard macro		\"Kommandot:\" keyboard macro definition."
  server)
David Byers's avatar
David Byers committed
376

David Byers's avatar
X    
David Byers committed
377
(def-kom-var kom-page-before-command nil
378
  "*This is a list of all commands before which the screen is cleared.
David Byers's avatar
X    
David Byers committed
379
380
If it isn't a list and isn't nil the screen is cleared before all commands."
  server)
Per Cederqvist's avatar
.    
Per Cederqvist committed
381

David Byers's avatar
X    
David Byers committed
382
(def-kom-var kom-permissive-completion t
383
384
  "*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
David Byers's avatar
X    
David Byers committed
385
386
for future use."
  server)
387
388


David Byers's avatar
X    
David Byers committed
389
(def-kom-var kom-membership-default-priority 100
Per Cederqvist's avatar
.    
Per Cederqvist committed
390
391
392
393
  "*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
X    
David Byers committed
394
395
Valid priorities are only the range 0-255."
  server)
David Byers's avatar
David Byers committed
396

David Byers's avatar
X    
David Byers committed
397
(def-kom-var kom-membership-default-placement 'last
Per Cederqvist's avatar
.    
Per Cederqvist committed
398
399
400
401
402
  "*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
X    
David Byers committed
403
404
otherwise => the new conf is entered after all conferences."
  server)
David Byers's avatar
David Byers committed
405

David Byers's avatar
X    
David Byers committed
406
(def-kom-var lyskom-current-prompt nil
407
408
  "The current prompt or nil.
This is either nil, indicating that there is currently no prompt, or
David Byers's avatar
X    
David Byers committed
409
410
one a symbol indcating which command is prompted in the LysKOM buffer."
  local)
David Byers's avatar
David Byers committed
411

Linus Tolke's avatar
Linus Tolke committed
412

David Byers's avatar
X    
David Byers committed
413
414
415
416
417
418
419
(def-kom-var lyskom-current-prompt-text nil
  "The current prompt text or nil.
This is either nil, indicating that there is currently no prompt, or
a string indicating the prompt shown in the LysKOM buffer."
  local)

(def-kom-var kom-show-personal-messages-in-buffer t
420
421
422
423
  "*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
X    
David Byers committed
424
425
nonexistent) buffer in which the message is inserted."
  server)
David Byers's avatar
David Byers committed
426

David Byers's avatar
X    
David Byers committed
427
(def-kom-var kom-pop-personal-messages nil
428
  "*Non-nil means pop up a buffer with personal messages as they arrive.
David Byers's avatar
X    
David Byers committed
429
430
kom-show-personal-messages-in-buffer decides which buffer to pop."
  server)
431

432
433
434
(def-kom-var kom-ding-pause-amount 0.1
  "*Amount of time to wait between successive beeps.")

David Byers's avatar
X    
David Byers committed
435
(def-kom-var kom-ding-on-new-letter nil
436
  "*Non-nil means ding if a message arrives in the letter box. See 
David Byers's avatar
X    
David Byers committed
437
438
kom-ding-on-priority-break for valid values."
  server)
439
440


David Byers's avatar
X    
David Byers committed
441
(def-kom-var kom-ding-on-priority-break 1
442
443
  "*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
X    
David Byers committed
444
445
program named by kom-audio-player."
  server)
David Byers's avatar
David Byers committed
446

David Byers's avatar
X    
David Byers committed
447
(def-kom-var kom-ding-on-wait-done 1
448
449
450
  "*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 
David Byers's avatar
X    
David Byers committed
451
452
function to call."
  server)
453

David Byers's avatar
X    
David Byers committed
454
(def-kom-var kom-ding-on-common-messages 0
455
  "*Non-nil means ding as common messages arrive. 
456
A number means the number of times to ding. A string is an argument for the
457
program named by kom-audio-player. A symbol is interpreted as a function to
David Byers's avatar
X    
David Byers committed
458
459
call."
  server)
David Byers's avatar
David Byers committed
460

David Byers's avatar
X    
David Byers committed
461
(def-kom-var kom-ding-on-group-messages 1
462
  "*Non-nil means ding as group messages arrive.
463
A number means the number of times to ding. A string is an argument for the
464
program named by kom-audio-player. A symbol is interpreted as a function
David Byers's avatar
X    
David Byers committed
465
466
to call."
  server)
467

David Byers's avatar
X    
David Byers committed
468
(def-kom-var kom-ding-on-personal-messages 2
469
  "*Non-nil means ding as personal messages arrive.
470
A number means the number of times to ding. A string is an argument for the
471
program named by kom-audio-player. A symbol is interpreted as a function 
David Byers's avatar
X    
David Byers committed
472
473
to call."
  server)
David Byers's avatar
David Byers committed
474
475


David Byers's avatar
David Byers committed
476
(def-kom-var kom-ding-on-no-subject 2
477
  "*How to ding if the user has not entered a subject line.
478
479
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 
David Byers's avatar
David Byers committed
480
481
to call."
  server)
David Byers's avatar
David Byers committed
482

483

David Byers's avatar
X    
David Byers committed
484
485
(def-kom-var kom-audio-player "audioplay"
  "*Program to play audio files.")
David Byers's avatar
David Byers committed
486

Per Cederqvist's avatar
.    
Per Cederqvist committed
487

David Byers's avatar
X    
David Byers committed
488
(def-kom-var kom-default-message-recipient 'group
David Byers's avatar
David Byers committed
489
490
491
  "*Determines default recipient of personal messages.

everybody means the default recipient is everybody.
David Byers's avatar
David Byers committed
492
493
494
495
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. 
David Byers's avatar
X    
David Byers committed
496
497
sender    means the sender of the last message received."
  server)
David Byers's avatar
David Byers committed
498
499


David Byers's avatar
X    
David Byers committed
500
(def-kom-var lyskom-filter-outgoing-messages t
501
  "*t if outgoing remote-control messages and automatic replies are not
David Byers's avatar
X    
David Byers committed
502
to be displayed in the buffer.")
David Byers's avatar
David Byers committed
503
504


David Byers's avatar
X    
David Byers committed
505
506
507
(def-kom-var kom-friends nil
  "*List of people whose names should be formatted using kom-friends-face."
  server)
508

David Byers's avatar
X    
David Byers committed
509
510
(def-kom-var kom-default-face-scheme nil  
  "*Face scheme to use per default for new logins.")
David Byers's avatar
David Byers committed
511

David Byers's avatar
X    
David Byers committed
512
(def-kom-var kom-text-properties t
513
  "*Non-nil means to insert text properties in the Emacs buffer for
David Byers's avatar
X    
David Byers committed
514
various LysKOM elements.")
515

David Byers's avatar
X    
David Byers committed
516
517
(def-kom-var kom-use-button-hints t
  "*Non-nil means use button hints for overriding default actions.")
David Byers's avatar
David Byers committed
518

David Byers's avatar
David Byers committed
519
(def-kom-var kom-autowrap t
David Byers's avatar
David Byers committed
520
521
  "*Non-nil means auto wrap articles with discretion.
A number means wrap articles shorter than the number (in bytes)."
David Byers's avatar
David Byers committed
522
523
  server)

524

David Byers's avatar
David Byers committed
525
526
527
528
;;;
;;; lyskom-button-actions has been moved to swedish-strings.el on account
;;; of there being a bunch of language-dependent strings in it.
;;;
529
530


David Byers's avatar
David Byers committed
531
(def-kom-var lyskom-url-protocol-regexp
David Byers's avatar
David Byers committed
532
533
  "\\(file\\|ftp\\|gopher\\|http\\|https\\|news\\|wais\\|mailto\\|telnet\\):")

David Byers's avatar
X    
David Byers committed
534
(def-kom-var lyskom-text-buttons
535
536
  '(
    ;; Text numbers
537
538
539
540
541
542
    ("\\(\\<[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)
543
544
     )

David Byers's avatar
David Byers committed
545
546
547
548
549
    ;; Email

    ("[^()<>@,;:\"\\\\\000- ]+@[^\000- <>;,.'\"!:?) \t\012\014]+\\(\\.[^\000- <>;,.'\"!:?)]+\\)+"
     email 0 0 kom-url-face)

550
551
    ;; URLs

552
    ("\\(www\\|ftp\\|home\\)\\.[^\t \012\014\"<>|\\]*[^\t \012\014\"<>|.,!(){}?'`:]" 
David Byers's avatar
David Byers committed
553
554
     pseudo-url 0 nil kom-url-face)

555
    ("\\(file://\\|ftp://\\|gopher://\\|http://\\|https://\\|news:\\|wais://\\|mailto:\\|telnet:\\)[^\t \012\014\"<>|\\]*[^\t \012\014\"<>|.,!(){}?'`:]" 
556
     url 0 nil kom-url-face)
David Byers's avatar
X    
David Byers committed
557
558
559
    ("<URL:\\s-*\\([^>]*\\)\\s-*>"
     url 1 1 kom-url-face)

560
561
    ;; JySKom enhancements

David Byers's avatar
David Byers committed
562
563
564
565
    ("<(?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)

566
567
568
569
570
    ;; Info node reference

    ("\\*Note[ \n\t]+\\([^:]*\\):\\([^.,\t]*\\)[.,\t]" 
     info-node 1 2 kom-url-face)

David Kågedal's avatar
David Kågedal committed
571
    )
572
573
574
575
576
577
  "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
X    
David Byers committed
578
FACE is the text face to apply to the button, or nil to use the default face.")
579

David Byers's avatar
X    
David Byers committed
580
(def-kom-var kom-url-viewer-preferences '("emacs"
581
582
				    "netscape"
				    "w3")
David Byers's avatar
David Byers committed
583

584
  "*LysKOM will attempt to use URL viewers in the order specified here.
David Byers's avatar
David Byers committed
585
586
587
588
589
590
591
592
593
594
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 
David Byers's avatar
X    
David Byers committed
595
to some URL viewers.")
596
597


David Byers's avatar
X    
David Byers committed
598
599
(def-kom-var kom-url-managers '(("default"
                            ".*"
600
                            "Browse-URL"
David Byers's avatar
X    
David Byers committed
601
602
                            lyskom-view-url-browse-url)
                           ("w3" 
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
			    "\\(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"
Peter Liljenberg's avatar
Peter Liljenberg committed
623
624
625
626
627
628
629
			    "\\(http\\|gopher\\|ftp\\|mailto\\|news\\|wais\\|file\\|telnet\\)"
			    "NCSA Mosaic"
			    lyskom-view-url-mosaic)
			   ("lynx"
			    "\\(http\\|gopher\\|ftp\\|mailto\\|news\\|wais\\|file\\|telnet\\)"
			    "Lynx"
			    lyskom-view-url-lynx))
630
631

  "List of URL managers. Each element is a list consisting of
David Byers's avatar
David Byers committed
632
633
634
635
636
(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
X    
David Byers committed
637
with the URL and the manager entry as arguments.")
David Byers's avatar
David Byers committed
638

David Byers's avatar
X    
David Byers committed
639
640
(def-kom-var kom-mosaic-command "/usr/local/bin/mosaic"
  "*Command to run to start Mosaic")
David Byers's avatar
David Byers committed
641

David Byers's avatar
X    
David Byers committed
642
(def-kom-var kom-netscape-command "netscape"
David Byers's avatar
David Byers committed
643
644
645
646
647
648
649
  "*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\"
David Byers's avatar
X    
David Byers committed
650
is not. Instead, the latter should be \(\"netscape\" \"-d\" \"host:0\"\)")
David Byers's avatar
David Byers committed
651

Peter Liljenberg's avatar
Peter Liljenberg committed
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
(def-kom-var kom-lynx-terminal 'xterm
  "*Where to start Lynx.
Valid values are 'xterm (start Lynx in an xterm) and 'terminal (start
Lynx in Emacs terminal mode.")

(def-kom-var kom-lynx-xterm-command
  '("xterm" "-geometry" "90x50+100+100" "-e" "lynx")
  "*Command to run to start Lynx in an xterm.
Must be a list of strings, where the first element is the name of the
xterm program, and the remaining elements are arguments to the
xterm. The last elements should be \"-e\" \"lynx\", or something similar,
to start Lynx.")

(def-kom-var kom-lynx-terminal-command "lynx"
  "*Command to run Lynx in Emacs terminal mode.

This can be either a string, to start Lynx with no arguments, or a
list of strings, where the first element is the command, and the rest
are arguments to Lynx.")
671

David Byers's avatar
X    
David Byers committed
672
(def-kom-var kom-confirm-multiple-recipients 'after
673
674
  "*Non-nil means ask the user for confirmation about recipients.
When the user writes a comment to a text with more than one recipient
675
676
he gets a y-or-n-p question for all recipients. 'before means check
before opening the edit buffer. Anything else means check before
David Byers's avatar
X    
David Byers committed
677
678
sending the article."
  server)
679

David Byers's avatar
David Byers committed
680
681
682
683
684
685
686
687
(def-kom-var kom-check-for-new-comments t
  "*Non-nil means check that no new comments have been written to a commented
texts since the last check. A list means check in all conferences except
those listed. A function means call the function and check if non-nil is
returned. The function is called with the commented text's text-stat as
an argument."
  server)

David Byers's avatar
X    
David Byers committed
688
(def-kom-var kom-check-commented-author-membership t
689
690
  "*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
David Byers's avatar
X    
David Byers committed
691
692
add them as recipients."
  server)
693

David Byers's avatar
X    
David Byers committed
694
(def-kom-var kom-inhibit-typeahead nil
695
  "*If non-nil, discard keyboard input that arrives while a LysKOM command is
David Byers's avatar
X    
David Byers committed
696
697
executing. "
  server)
698

David Byers's avatar
X    
David Byers committed
699
700
701
(def-kom-var kom-max-buffer-size nil
  "*If non-nil, ensure that buffers won't grow any larger than this"
  local)
David Byers's avatar
David Byers committed
702

David Byers's avatar
X    
David Byers committed
703
704
(def-kom-var lyskom-print-complex-dates t
  "If non-nil, print today and yesterday using a special format.")
705

David Byers's avatar
David Byers committed
706
707
708
709
710
(def-kom-var kom-show-namedays nil
  "*Non-nil means display namedays when running in swedish.
This variable will eventually be replaced with something else."
  server)

David Byers's avatar
David Byers committed
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
(def-kom-var kom-www-proxy nil
  "*Non-nil indicates a WWW proxy to use for the connection.
This is useful behind a firewall if the proxy supports the CONNECT
method. 

If this variable is a string, it is assumed to be a proxy
specification for all LysKOM servers. If it is a list, it is assumed
to be a list of pairs, (SERVER . PROXY) where SERVER is the server for
which PROXY, a proxy specification is to be used. The special value t
can be used for SERVER to indicate a default proxy.

A proxy specification has the form \"HOST:PORT\" where HOST is the
host name of the proxy and PORT is the port to connect to. The :PORT
part is optional. If it is not specified, port 80 is assumed.")

David Byers's avatar
X    
David Byers committed
726
(def-kom-var kom-server-aliases
David Kågedal's avatar
David Kågedal committed
727
728
729
  '(("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
730
731
    ("kom.csd.uu.se" . "CSD-KOM")
    ("striterax.medio.mh.se" . "MedioKOM")
732
733
    ("kom.mds.mdh.se" . "MdS-KOM")
    ("kom.stacken.kth.se" . "TokKOM"))
David Byers's avatar
X    
David Byers committed
734
  "*An alist mapping server names to shorter identification strings")
David Byers's avatar
David Byers committed
735

David Byers's avatar
X    
David Byers committed
736
737
738
(def-kom-var kom-ansaphone-on nil
  "t if automatic replies to personal messages are in effect."
  local)
739

David Byers's avatar
X    
David Byers committed
740
741
742
(def-kom-var kom-ansaphone-record-messages t
  "*t if messages are recorded while the ansaphone is on."
  server)
743

David Byers's avatar
X    
David Byers committed
744
745
746
(def-kom-var kom-ansaphone-show-messages t
  "*t if messages are to be shown when they are recorded."
  server)
747
748


David Byers's avatar
X    
David Byers committed
749
(def-kom-var lyskom-ansaphone-messages nil
750
  "Messages collected by the automatic reply facility.
David Byers's avatar
X    
David Byers committed
751
752
The most recent message is the first message in the list."
  local)
753

David Byers's avatar
X    
David Byers committed
754
755
756
(def-kom-var lyskom-ansaphone-when-set (current-time-string)
  "Time when the auto-reply facility was enabled."
  local)
757

David Byers's avatar
X    
David Byers committed
758
759
760
(def-kom-var kom-remote-control t
  "*t if LysKOM may be remotely controlled."
  server)
761

David Byers's avatar
X    
David Byers committed
762
(def-kom-var kom-remote-controllers nil 
David Byers's avatar
David Byers committed
763
764
  "*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
X    
David Byers committed
765
766
information."
  server)
David Byers's avatar
David Byers committed
767

David Byers's avatar
X    
David Byers committed
768
(def-kom-var kom-self-control t
David Byers's avatar
David Byers committed
769
  "*If non-nil, remote control commands are accepted from sessions logged
David Byers's avatar
X    
David Byers committed
770
771
in as the same user as the current session."
  server)
David Byers's avatar
David Byers committed
772

David Byers's avatar
X    
David Byers committed
773
(def-kom-var kom-ansaphone-replies
David Byers's avatar
David Byers committed
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
  '((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
X    
David Byers committed
793
794
If none of the elements match, KOM-ANSAPHONE-DEFAULT-REPLY is sent."
  server)
David Byers's avatar
David Byers committed
795

David Byers's avatar
David Byers committed
796
(def-kom-var kom-default-language nil
David Byers's avatar
David Byers committed
797
798
799
  "*Which lagnuage to use for new sessions."
  server inherited protected)

David Byers's avatar
David Byers committed
800
(def-kom-var lyskom-language nil
Niels Möller's avatar
Niels Möller committed
801
802
  ;; One might extend this into a list of languages, sorted in
  ;; preference order.
David Byers's avatar
David Byers committed
803
804
  "The language currently in use."
  local
David Byers's avatar
X    
David Byers committed
805
806
807
808
809
810
811
812
813
814
815
816
817
818
  inherited
  protected)


(def-kom-var lyskom-edit-mode-map nil
  "Mode map for LysKOM edit."
  local)

(def-kom-var lyskom-edit-prefix nil
  "Mode-map for lyskom edit mode.")

(def-kom-var lyskom-customize-map nil
  "Keymap for the customize buffer"
  local)
Niels Möller's avatar
Niels Möller committed
819

David Byers's avatar
David Byers committed
820

David Kågedal's avatar
David Kågedal committed
821
822
823
824
825
;;; =================================================================
;;;
;;; Language-dependent variables
;;;

David Byers's avatar
X    
David Byers committed
826
827
828
(def-kom-var lyskom-onoff-table nil
  "A completion table for on and off selections."
  local)
David Kågedal's avatar
David Kågedal committed
829

David Byers's avatar
David Byers committed
830
831
832
833
834
(def-kom-var lyskom-language-codes nil
  "A list of ISO 639 language codes"
  local)
(put 'lyskom-language-codes 'lyskom-language-force t)

David Byers's avatar
X    
David Byers committed
835
836
837
(def-kom-var lyskom-filter-predicate-list nil
      "A list of legal filter comparison predicates."
      local)
David Kågedal's avatar
David Kågedal committed
838

David Byers's avatar
X    
David Byers committed
839
840
841
(def-kom-var lyskom-filter-what nil
      "A list of legal filter conditions and their textual representation."
      local)
David Kågedal's avatar
David Kågedal committed
842

David Byers's avatar
X    
David Byers committed
843
844
845
(def-kom-var lyskom-filter-actions nil
      "A list of legal filter actions an their textual representation."
      local)
David Kågedal's avatar
David Kågedal committed
846

David Byers's avatar
X    
David Byers committed
847
(def-kom-var lyskom-text-start nil
David Kågedal's avatar
David Kågedal committed
848
849
850
  "Regexp matching beginning of a text in lyskom buffer.
Cf. paragraph-start.")

David Byers's avatar
X    
David Byers committed
851
852
853
(def-kom-var lyskom-filter-edit-map nil
  "Keymap for LysKOM filter edit"
  local)
David Kågedal's avatar
David Kågedal committed
854

David Byers's avatar
X    
David Byers committed
855
856
857
(def-kom-var lyskom-prioritize-mode-map nil
  "Keymap used in lyskom-prioritize-mode."
  local)
David Kågedal's avatar
David Kågedal committed
858

David Byers's avatar
X    
David Byers committed
859
860
861
(def-kom-var lyskom-prioritize-header-lines nil
  "Number of lines in the header of the prioritization buffer"
  local)
David Kågedal's avatar
David Kågedal committed
862

David Byers's avatar
X    
David Byers committed
863
864
865
(def-kom-var lyskom-prioritize-header nil
  "Header for the reprioritization buffer"
  inherited)
David Kågedal's avatar
David Kågedal committed
866

David Byers's avatar
X    
David Byers committed
867
868
869
(def-kom-var kom-ansaphone-default-reply nil
  "*Default message to send when the ansaphone is on."
  server)
David Kågedal's avatar
David Kågedal committed
870

David Byers's avatar
David Byers committed
871
872
873
874
(def-kom-var kom-ispell-dictionary nil
  "*Dictionary to use for spell checking."
  server)

David Byers's avatar
X    
David Byers committed
875
876
(def-kom-var lyskom-button-actions nil
  "This variable defines valid button types in LysKOM. Each element is a
David Kågedal's avatar
David Kågedal committed
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
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.

David Byers's avatar
X    
David Byers committed
898
899
Also see the function \"lyskom-add-button-action\"."
  local)
David Kågedal's avatar
David Kågedal committed
900

901
902
(put 'lyskom-button-actions 'lyskom-language-force t)

David Byers's avatar
X    
David Byers committed
903
(def-kom-var kom-mercial nil
David Kågedal's avatar
David Kågedal committed
904
905
  "*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.
David Byers's avatar
X    
David Byers committed
906
907
Users are encouraged to use their best sense of humor."
  server)
David Kågedal's avatar
David Kågedal committed
908
909
910



David Byers's avatar
David Byers committed
911
912
913
914
915
;;; =================================================================
;;;
;;; Inherited variables
;;;

David Byers's avatar
X    
David Byers committed
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
;(eval-and-compile
;  (def-kom-var 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
;      lyskom-server-name
;      lyskom-language
;      )
;    "Variables that all buffers associated with a LysKOM buffer inherit."))


;(eval-and-compile
;  (def-kom-var lyskom-protected-variables 
;    (append '(lyskom-reset-var 
;              lyskom-dedicated-frame
;              kill-buffer-hook 
;              lyskom-buffer-type
;              lyskom-saved-window-configuration)
;            lyskom-inherited-variables)
;    "Variables that need to be permanent local variables."))

;(mapcar 'lyskom-protect-variable
;        lyskom-protected-variables)
David Byers's avatar
David Byers committed
948
949


Niels Möller's avatar
Niels Möller committed
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
(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-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
David Byers's avatar
David Byers committed
1066
    kom-customize
David Byers's avatar
David Byers committed
1067
    kom-change-language
David Byers's avatar
David Byers committed
1068
    kom-calculate
David Byers's avatar
David Byers committed
1069
1070
1071

    kom-next-kom
    kom-previous-kom
David Byers's avatar
David Byers committed
1072
    kom-next-unread-kom
Niels Möller's avatar
Niels Möller committed
1073
1074
    ))

David Byers's avatar
X    
David Byers committed
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
;(defconst lyskom-elisp-variables
;  '(kom-permissive-completion
;    kom-bury-buffers
;    kom-ding-on-new-letter
;    kom-ding-on-personal-messages
;    kom-ding-on-group-messages
;    kom-ding-on-common-messages
;    kom-ding-on-priority-break
;    kom-ding-on-wait-done
;    kom-show-personal-messages-in-buffer
;    kom-pop-personal-messages
;    kom-user-prompt-format
;    kom-user-prompt-format-executing
;    kom-enabled-prompt-format
;    kom-enabled-prompt-format-executing
;    kom-do-when-done
;    kom-higher-priority-breaks
;    kom-login-hook
;    kom-membership-default-placement
;    kom-membership-default-priority
;    kom-mercial 
;    kom-inhibit-typeahead
;    kom-page-before-command 
;    kom-continuous-scrolling
;    kom-permanent-filter-list
;    kom-presence-messages-in-buffer
;    kom-quit-hook
;    kom-show-where-and-what
;    kom-who-buffer-size-when-displaying
;    kom-default-message-recipient
;    kom-write-texts-in-window
;    kom-edit-filters-in-window
;    kom-list-membership-in-window
;    kom-prioritize-in-window
;    kom-customize-in-window
;    kom-customize-format
;    kom-cite-string
;    kom-remote-control
;    kom-remote-controllers
;    kom-self-control
;    kom-ansaphone-default-reply
;    kom-ansaphone-replies
;    kom-ansaphone-record-messages
;    kom-ansaphone-show-messages
;    kom-show-footnotes-immediately
;    kom-follow-comments-outside-membership
;    kom-friends
;    kom-check-commented-author-membership
;    lyskom-fetch-map-nos
;    lyskom-new-text-hook
;    lyskom-prefetch-conf-tresh 
;    lyskom-prefetch-confs
;    lyskom-who-info-has-changed-hook
;    lyskom-language)
;  "Tells the client what flags and hooks that are to be saved in the server.
;These are the flags that are saved in the elisp-client part of the server.")
Per Cederqvist's avatar
.    
Per Cederqvist committed
1131
1132
1133
1134
1135
1136


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


1137
(defconst lyskom-clientversion "@@CLIENTVERSION@@"
Per Cederqvist's avatar
.    
Per Cederqvist committed
1138
1139
1140
1141
1142
  "Version of the LysKOM elisp client.")

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

1143
(defconst lyskom-server-features
David Byers's avatar
David Byers committed
1144
1145
  '(((>  1 9 0) (lyskom-bcc-flag))
    ((>= 1 9 0) (lyskom-accept-async-flag
1146
1147
                 lyskom-dynamic-session-info-flag
                 lyskom-idle-time-flag))
1148
1149
1150
1151
1152
1153
1154
    ((>= 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)))
1155
1156
    ((= 1 7 1) ((protocol-version 7)))
    ((< 1 7 0) ((protocol-version 6))))
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
  "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'.")


David Byers's avatar
X    
David Byers committed
1173
(def-kom-var lyskom-server-version '(0 0 0)
1174
  "The version of the server.  A list of three integers, major
David Byers's avatar
X    
David Byers committed
1175
1176
version, minor version and revision."
  local)
1177

David Byers's avatar
X    
David Byers committed
1178
(def-kom-var lyskom-server-supports nil
1179
  "Assoc list of features supported by the LysKOM server. See
David Byers's avatar
X    
David Byers committed
1180
1181
lyskom-server-features for more information."
  inherited)
1182

David Byers's avatar
X    
David Byers committed
1183
1184
1185
(def-kom-var lyskom-idle-time-flag nil
  "t if idle time calls are supported by the server."
  inherited)
1186

David Byers's avatar
X    
David Byers committed
1187
1188
1189
(def-kom-var lyskom-dynamic-session-info-flag nil
  "t if dynamic session info is supported by the server."
  inherited)
1190

David Byers's avatar
X    
David Byers committed
1191
1192
1193
(def-kom-var lyskom-long-conf-types-flag nil
  "t if extended conf types are supported by the server."
  inherited)
1194

David Byers's avatar
X    
David Byers committed
1195
1196
1197
(def-kom-var lyskom-set-last-read-flag nil
  "t if the set-last-read call is supported by the server."
  inherited)
1198

David Byers's avatar
X    
David Byers committed
1199
1200
1201
(def-kom-var lyskom-uconf-stats-flag nil
  "t if the server supports the get-uconf-stat call."
  inherited)
1202

David Byers's avatar
X    
David Byers committed
1203
1204
1205
(def-kom-var lyskom-z-lookup-flag nil
  "t if the server supports regexp name lookups."
  inherited)
1206

David Byers's avatar
X    
David Byers committed
1207
1208
1209
(def-kom-var lyskom-accept-async-flag nil
  "t if the server supports the accept-async call."
  inherited)
1210

David Byers's avatar
David Byers committed
1211
1212
1213
1214
(def-kom-var lyskom-bcc-flag nil
  "t if the server supports the bcc misc items."
  inherited)

David Byers's avatar
X    
David Byers committed
1215
(def-kom-var lyskom-max-packet-size lyskom-max-int
Per Cederqvist's avatar
.    
Per Cederqvist committed
1216
1217
1218
1219
1220
  "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.")

David Byers's avatar
X    
David Byers committed
1221
(def-kom-var lyskom-pending-commands nil
1222
1223
1224
1225
1226
1227
  "Commands pending to be executed.
When a command finishes, it checks this variable to see if another command
should be run.

It should be a lest where each element should be either a symbol or an
expression. If it is a symbol it is invoked with `call-interactively', and
David Byers's avatar
X    
David Byers committed
1228
1229
an expression is evaluated with `eval'."
  local)
1230

David Byers's avatar
X    
David Byers committed
1231
1232
1233
(def-kom-var lyskom-do-when-done nil
  "Internal of kom-do-when-done."
  local)
Linus Tolke's avatar
Linus Tolke committed
1234

David Byers's avatar
X    
David Byers committed
1235
(def-kom-var lyskom-do-when-starting nil
1236
  "Internal of kom-do-when-starting. Obsolete")
Linus Tolke's avatar
Linus Tolke committed
1237

David Byers's avatar
X    
David Byers committed
1238
(def-kom-var lyskom-sessions-with-unread nil
Linus Tolke's avatar
Linus Tolke committed
1239
1240
1241
  "List of lyskom-sessions with unread texts.
This is not buffer-local.")

David Byers's avatar
X    
David Byers committed
1242
(def-kom-var lyskom-sessions-with-unread-letters nil
1243
1244
  "List of lyskom-sessions with unread letters.
This is not buffer-local.")
Linus Tolke's avatar
Linus Tolke committed
1245

David Byers's avatar
X    
David Byers committed
1246
1247
1248
1249
1250
1251
1252
1253
1254
(def-kom-var lyskom-buffer nil
  "What is the lyskom-buffer we are connected to."
  inherited
  minibuffer)

(def-kom-var lyskom-buffer-type nil
  "What type of buffer is the current buffer."
  local
  protected)
Linus Tolke's avatar
Linus Tolke committed
1255