vars.el.in 102 KB
Newer Older
David Byers's avatar
David Byers committed
1
;;;;; -*-coding: raw-text;mode: emacs-lisp;-*-
Linus Tolke's avatar
Linus Tolke committed
2
;;;;; $Id$
3
;;;;; Copyright (C) 1991-2002  Lysator Academic Computer Association.
Linus Tolke's avatar
Linus Tolke committed
4
;;;;;
5
;;;;; This file is part of the LysKOM Emacs LISP client.
Linus Tolke's avatar
Linus Tolke committed
6
7
8
;;;;; 
;;;;; 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

38
39
(defvar lyskom-dummy-variable-to-fool-the-byte-compiler)

David Byers's avatar
David Byers committed
40
(defvar lyskom-mule-compiled
41
42
  (eval-when-compile (and (fboundp 'multibyte-string-p)
                          (multibyte-string-p "ÅÄÖ")))
David Byers's avatar
David Byers committed
43
44
  "Non-nil if the client was compiled with multibyte characters enabled")

David Byers's avatar
X    
David Byers committed
45
(provide 'lyskom)
46

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

David Byers's avatar
David Byers committed
49
50
51
52
53
54
55
56
57
58
59
(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.

60
Don't change these. They are defined by the protocol.")
61

David Byers's avatar
David Byers committed
62
63
64
65
66
67
(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.

68
Don't change these. They are defined by the protocol.")
David Byers's avatar
David Byers committed
69
70


David Byers's avatar
X    
David Byers committed
71
72

(defun lyskom-protect-variable (sym) 
David Byers's avatar
David Byers committed
73
  "Protect SYM from being killed when deleting local variables."
David Byers's avatar
X    
David Byers committed
74
75
76
77
78
  (put sym 'permanent-local t)
  (lyskom-local-variable sym)
  (add-to-list 'lyskom-protected-variables sym))

(defun lyskom-local-variable (sym)
David Byers's avatar
David Byers committed
79
  "Define SYM as a buffer-local variable"
David Byers's avatar
X    
David Byers committed
80
81
82
  (add-to-list 'lyskom-local-variables sym))

(defun lyskom-inherited-variable (sym)
David Byers's avatar
David Byers committed
83
84
  "Define SYM as a variable that is inherited when creating new buffers.
Inheritance only works with the LysKOM buffer handling functions."
David Byers's avatar
X    
David Byers committed
85
86
87
88
  (add-to-list 'lyskom-inherited-variable sym)
  (lyskom-protect-variable sym))

(defun lyskom-setup-local-variables ()
David Byers's avatar
David Byers committed
89
  "Set up all globally defined local variables in the current buffer."
David Byers's avatar
X    
David Byers committed
90
91
  (mapcar 'make-local-variable lyskom-local-variables)
  (mapcar 'make-local-hook lyskom-local-hooks))
Per Cederqvist's avatar
.  
Per Cederqvist committed
92

David Byers's avatar
David Byers committed
93
94
95
(defvar lyskom-is-loaded nil
  "Non-nil when lyskom has been loaded.")

96
97
98
(defvar lyskom-have-one-login nil
  "Non-nil after the first login")

David Byers's avatar
David Byers committed
99

David Byers's avatar
David Byers committed
100
101
(def-kom-var kom-dont-read-saved-variables '(kom-dont-read-saved-variables
                                             lyskom-login-hook)
102
  "*Non-nil means don't read some variables from the server.
David Byers's avatar
David Byers committed
103
104
105
t means don't read any variables. A list means don't read variables that
are in the list.")

106
107
108
109
(defmacro lyskom-maybe-setq (var value)
  "This is a wrapper around setq that does nothing
if the variable is in kom-dont-read-saved-variables."
  `(cond ((eq kom-dont-read-saved-variables t) nil)
110
         ((memq ,var kom-dont-read-saved-variables) nil)
David Byers's avatar
David Byers committed
111
         (t (set ,var ,value))))
112
113
114
115
116

(defmacro lyskom-maybe-setq-default (var value)
  "This is a wrapper around setq-default that does nothing
if the variable is in kom-dont-read-saved-variables."
  `(cond ((eq kom-dont-read-saved-variables t) nil)
117
         ((memq ,var kom-dont-read-saved-variables) nil)
David Byers's avatar
David Byers committed
118
         (t (set-default ,var ,value))))
Per Cederqvist's avatar
.  
Per Cederqvist committed
119
120
121
122
123
124
125
126


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


;;; User flags

127
128
129
130
(def-kom-var kom-text-links
  '((t ("\\<bug[ \t\n]+\\([0-9]+\\)\\>"
	"http://bugzilla.lysator.liu.se/show_bug.cgi?id=\\1"
	0 t)))
131
132
  "*Links in the text.
This list is an alist where the car is a conference number and the cdr
133
134
a list of link specifications for that conference. Use the value t as the
car to apply the specification in all conferences. Each link specification
135
136
137
138
139
140
is a list \(PATTERN REPLACEMENT HIGHLIGHT IGNORE-CASE), where PATTERN is
a regexp to look for in the text, REPLACEMENT is a replacement text to 
generate a URL from a match for REGEXP (see the NEWTEXT argument to 
replace-in-string for more information), HIGHLIGHT is the match group to
highlight in the LysKOM buffer (use 0 for the entire match) and IGNORE-CASE
is a flag: when non-nil case is ignored when looking for REGEXP."
141
142
  server)

143

144
(defconst kom-old-farts-text-prompt-strategy
David Byers's avatar
David Byers committed
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
  '((kom-comment-previous . ((t   . lyskom-get-previous-text)
			     (nil . lyskom-get-previous-text)))
    (t . ((t   . lyskom-get-last-read-text)
	  (nil . lyskom-get-last-read-text)
	  (0   . lyskom-get-text-at-point)
	  (-     lyskom-get-text-above-point (lambda (&optional args) 1))
	  (listp . lyskom-prompt-for-text-no)
	  (lyskom-plusp . lyskom-get-explicit-text)
	  (lyskom-minusp  lyskom-get-text-above-point abs))))
"Put in your `kom-pick-text-no-strategy-alist' to get the 0.46 behaviour:
 * No prefix argument refers to the most recently read text.
 * The prefix argument zero refers to the text under point.
 * A positive prefix argument is interpreted as a text-no.
 * A negative prefix argument will try to find the text-no
   of the text `arg' messages above point from the current
   kom buffer.")

162
163
164
165
(defconst lyskom-old-farts-text-prompt-strategy
  kom-old-farts-text-prompt-strategy
  "Obsolete: Alias for kom-old-farts-text-prompt-strategy.")

David Byers's avatar
David Byers committed
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
(def-kom-var kom-pick-text-no-strategy-alist
      '((kom-comment-previous . ((t   . lyskom-get-previous-text)
				 (nil . lyskom-get-previous-text)))
        (kom-private-answer-previous . ((t   . lyskom-get-previous-text)
                                        (nil . lyskom-get-previous-text)))
	(t . ((t   . lyskom-get-text-at-point) ; default for prompts
	      (nil . lyskom-get-text-at-point) ; no prefix arg
	      (0   . lyskom-prompt-for-text-no)
	      (-     lyskom-get-text-above-point (lambda (&optional arg) 1))
	      (listp lyskom-get-text-at-point-ancestor
		     (lambda (arg) (/ (logb (car arg)) 2)))
	      (lyskom-plusp . lyskom-get-text-below-point)
	      (lyskom-minusp  lyskom-get-text-above-point abs))))
      "Defines how prefix arguments are used to find a text-no to operate on.
The cars on the list are either one of the functions which invokes
`lyskom-read-text-no-prefix-arg' (typically the one of the kom-* functions),
or the value t for the strategy common to all such functions. For functions in
the list, the strategy is chosen from the cdr of that entry and, if and when
no matching rule was found that way, from the common strategy.

Each cdr on the list is an alist specifying when to do how when mapping a
prefix argument to a text-no.

The cars on this alist are the predicates for which the cdrs map functions that
retrieve the text-no to operate on. Each predicate is tested in turn on the
prefix argument, and when one returns non-nil, the cdr gets invoked, until the
list is empty or one cdr returned some non-nil value, whichever comes first. If
you like, the cars can also be the actual prefix-arg values (-, 0 or nil, for
example) that you want to invoke some special rule for. The value t means that
the behaviour given by the cdr stipulates the DEFAULT value for the prompt,
when one is shown.

The cdrs on the list may be either of:

* a function, in which case it gets called with four parameters: the prefix
  argument, the PROMPT that would be used to ask the user for a text-no, a
  (possibly nil) DEFAULT choice for that prompt, and a CONSTRAINT value, all
  as provided in the call to `lyskom-read-text-no-prefix-arg' (see its docs)
  Returning a positive integer means return that text-no. Returning a common
  lyskom format string aborts, showing your helpful error description. A nil
  return value means try successive rules instead to get a text-no.

* a list of two functions, optionally followed by additional list items,
  in which case the second function is called to change the prefix argument
  parameter for the first function, which is then called as above. Any extra
  items on the argument list will be appended to its argument list. Hence, a
  '(my-get-text-no abs 17 4711) entry would result in a my-get-text-no call
  (funcall my-get-text-no (abs prefix-arg) prompt default nil 17 4711)."
  )

David Byers's avatar
David Byers committed
216
(def-kom-var kom-url-transformation-rules 
217
218
219
  '(
    ("^http://[^/]*aftonbladet\\.se/.*/story/.*html?$" . "\\&.")
    )
David Byers's avatar
David Byers committed
220
221
222
223
224
225
226
227
228
229
230
231
  "*An alist specifying transformations to be applied to URLs.

Elements in this list are of the form `(REGEXP . NEWTEXT)'. Before an
URL is opened, it is transformed by replacing REGEXP with NEWTEXT.
Each element in the list is applied in order.

The list elements REGEXP and NEWTEXT correspond to the REGEXP and
NEWTEXT arguments to `replace-in-string'."
  server
  )


232
233
234
(def-kom-var kom-check-configuration-on-startup t
  "*When non-nil, check Emacs configuration on client startup.")

David Byers's avatar
David Byers committed
235

236
237
238
239
240
241
(def-kom-var kom-keyboard-menu-immediate-selection nil
  "*When non-nil, typing a keyboard shortcut in a keyboard menu selects
the item immediately, without requiring the user to press RET to confirm."
  server)


242
243
244
245
246
247
(def-kom-var kom-edit-hide-add-button nil
  "*If non-nil, hide the add button shown after the headers when editing
a text."
  server
)

David Byers's avatar
David Byers committed
248
249
250
251
252
253
254
255
(def-kom-var kom-max-overlays 120
  "*Maximum number of overlays to use to highlight texts.
Each text uses one, two, three or four overlays, depending on settings.
Must be a positive integer or nil. If nil, the number of overlays will
be unlimited. Behavior of non-positive and non-nil values is undefined."
  server
)

256
(def-kom-var kom-highlight-text-body t
David Byers's avatar
David Byers committed
257
258
259
260
  "*If t, overlay kom-text-body-face on printed text bodies in LysKOM.
When this is enabled, an overlay or extent will be created that may
override certain aspects of the underlying text's formatting. Values
other than t or nil are reserved for future use."
261
262
263
  server
)

264
(def-kom-var kom-highlight-first-line t
David Byers's avatar
David Byers committed
265
266
267
268
  "*If t, overlay kom-first-line-face on the first header line of texts.
When this is enabled, an overlay or extent will be created that may
override certain aspects of the underlying text's formatting. Values
other than t or nil are reserved for future use."
269
270
271
272
  server
)

(def-kom-var kom-highlight-dashed-lines t
David Byers's avatar
David Byers committed
273
274
275
276
  "*If t, overlay kom-dashed-lines-face on the lines surrounding texts.
When this is enabled, an overlay or extent will be created that may
override certain aspects of the underlying text's formatting. Values
other than t or nil are reserved for future use."
277
278
279
  server
)

280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
(def-kom-var kom-async-highlight-text-body t
  "*If t, overlay kom-text-body-face on asynchronous messages in LysKOM.
When this is enabled, an overlay or extent will be created that may
override certain aspects of the underlying text's formatting. Values
other than t or nil are reserved for future use."
  server
)

(def-kom-var kom-async-highlight-dashed-lines t
  "*If t, overlay kom-dashed-lines-face on the lines surrounding messages.
When this is enabled, an overlay or extent will be created that may
override certain aspects of the underlying text's formatting. Values
other than t or nil are reserved for future use."
  server
)

David Byers's avatar
David Byers committed
296
(def-kom-var kom-extended-status-information nil
297
298
299
300
301
302
  "*If t, list extended status information for all objects in LysKOM.
Extended status information include such information as read FAQs.
Values other than t or nil are reserved for future extensions."
  server
)

David Byers's avatar
David Byers committed
303
304
305
306
307
308
(def-kom-var kom-auto-list-faqs t
  "*If non-nil, list unread FAQs when entering a conference or logging
on to the server."
  server
)

309
(def-kom-var kom-auto-review-faqs t
David Byers's avatar
David Byers committed
310
311
  "*If non-nil, automatically review unread FAQs when entering a
conference or logging on to the server."
312
313
314
  server
)

David Byers's avatar
X    
David Byers committed
315
(def-kom-var kom-allow-incompleteness nil
316
317
  "*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,
318
but it might make them faster, especially during the login phase."
David Byers's avatar
X    
David Byers committed
319
320
  server
)
321

David Byers's avatar
X    
David Byers committed
322
(def-kom-var kom-bury-buffers t
323
324
325
  "*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
326
327
`kom-previous-kom' or `kom-next-unread-kom' is invoked."
  server)
328

David Byers's avatar
X    
David Byers committed
329
(def-kom-var kom-write-texts-in-window nil
330
  "*Where to edit texts. One of nil, 'other, 'new-frame, 'other-frame, a string
David Byers's avatar
David Byers committed
331
332
333
or a buffer.

nil means edit texts in the same window as the LysKOM buffer.
334
335
336
'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 
David Byers's avatar
David Byers committed
337
          when editing is finished.
338
A string or buffer means edit in the indicated buffer."
David Byers's avatar
X    
David Byers committed
339
  server)
340

David Byers's avatar
X    
David Byers committed
341
(def-kom-var kom-view-commented-in-window 'other
342
  "*Where to view commented texts. See kom-write-texts-in-window for details."
David Byers's avatar
X    
David Byers committed
343
  server)
David Byers's avatar
David Byers committed
344

David Byers's avatar
X    
David Byers committed
345
346
347
348
(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
349

David Byers's avatar
X    
David Byers committed
350
351
352
353
(def-kom-var kom-list-membership-in-window 'other
  "*Where to list membership. See kom-write-texts-in-window for
more information."
  server)
354

355
356
357
358
359
(def-kom-var kom-personal-messages-in-window 'other
  "*Where to display personal messages. See kom-write-texts-in-window 
for more information."
  server)

David Byers's avatar
X    
David Byers committed
360
361
362
(def-kom-var kom-customize-format 'long
  "*Format of the customize buffer. Must be long or short."
  server)
363

David Byers's avatar
X    
David Byers committed
364
365
366
(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
367

Per Cederqvist's avatar
.  
Per Cederqvist committed
368

David Byers's avatar
X    
David Byers committed
369
370
371
(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
372
373


David Byers's avatar
X    
David Byers committed
374
375
376
(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
377

378

David Byers's avatar
X    
David Byers committed
379
380
381
382
(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
383

David Byers's avatar
David Byers committed
384
385
386
387
388
389
390
391
(def-kom-var kom-anonymous-prompt-format "%[%c% %m%] (%a) - "
  "*Format of the LysKOM prompt when running anonymously."
  server)

(def-kom-var kom-anonymous-prompt-format-executing "%[%c% %m%] (%a)."
  "*Format of the LysKOM prompt when executing a command anonymously."
  server)

392
393
394
395
(def-kom-var kom-show-week-number t
  "*If non-nil show the ISO week number when displaying the time."
  server)

David Byers's avatar
David Byers committed
396

David Byers's avatar
X    
David Byers committed
397
398
399
(def-kom-var kom-cite-string ">"
  "*String to insert before each line of a commented text."
  server)
400

401
402
403
404
405
406
(def-kom-var kom-created-texts-are-saved nil
  "*If non-nil, save all created texts to a file. 
The value of this variable is the file name on which to save new texts."
  server
  inherited)

407
(def-kom-var kom-created-texts-are-read nil
David Byers's avatar
X    
David Byers committed
408
409
  "*Non-nil means automatically mark texts that you create as read."
  server)
David Byers's avatar
David Byers committed
410

411
412
413
414
415
416
417
(def-kom-var kom-mark-read-texts-as-read-in-new-recipient t
  "*When t, silently mark texts as read when they are added to a new
recipient, if they have been read in any conference. When nil, do not
mark as read. Values other than t or nil are reserved for future
extensions."
  server)

David Byers's avatar
X    
David Byers committed
418
(def-kom-var kom-customize-in-window nil
419
  "*Where to customize LysKOM. See kom-write-texts-in-window."
David Byers's avatar
X    
David Byers committed
420
  server)
Per Cederqvist's avatar
.  
Per Cederqvist committed
421

David Byers's avatar
X    
David Byers committed
422
(def-kom-var kom-prioritize-in-window nil
423
  "*Where to prioritize conferences. See kom-write-texts-in-window."
David Byers's avatar
X    
David Byers committed
424
  server)
David Byers's avatar
David Byers committed
425

426
(def-kom-var kom-default-mark nil
427
  "*If non-nil (must be an integer), the user is not asked for type of mark."
David Byers's avatar
X    
David Byers committed
428
  server)
Per Cederqvist's avatar
.  
Per Cederqvist committed
429

430
431
432
433
(def-kom-var kom-symbolic-marks-alist '(("Standard" . 100))
  "*Assoc list which maps symbolic mark strings to mark numbers."
  server)

David Byers's avatar
X    
David Byers committed
434
(def-kom-var kom-reading-puts-comments-in-pointers-last t
435
  "*If non-nil, the texts are shown with comment references at the end."
David Byers's avatar
David Byers committed
436
437
  server
  inherited)
David Byers's avatar
David Byers committed
438

439
440
441
442
443
(def-kom-var kom-review-uses-cache t
  "*If non-nil, review commands don't use the cache."
  server
  inherited)

444
445
446
447
448
(def-kom-var kom-review-marks-texts-as-read nil
  "*If non-nil, review commands mark the reviewed texts as read."
  server
  inherited)

David Byers's avatar
David Byers committed
449
450
451
452
453
(def-kom-var kom-postpone-default 17
  "*The number of articles to postpone by default."
  server)


David Byers's avatar
X    
David Byers committed
454
(def-kom-var kom-dashed-lines t
455
  "*If non-nil, all texts will be surrounded by lines of dashes."
David Byers's avatar
David Byers committed
456
457
  server
  inherited)
Per Cederqvist's avatar
.  
Per Cederqvist committed
458

459
(def-kom-var kom-long-lines nil
460
  "*If non-nil, some lines and borders will be made longer."
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
  server
  inherited)

(def-kom-var kom-text-footer-dash-length 52
  "*If non-nil, the total length of the text footer, when dashes are in use.
Note that the footer may end up longer than this if one or more elements
together are longer than this length.

This length is currently ignored when kom-text-footer-format is used."
  server
  inherited)

(def-kom-var kom-text-header-dash-length 60
  "*If non-nil, the total length of the dashes before a text body.
If kom-dashed-lines is non-nil, this is ignored."
  server
  inherited)



481
482
483
484
485
486
487
488
489
490
491
492
493
494
(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
495
truncated). A negative field width means left justify the contents.
496
497

The field width of %- is special. It specifies the maximum number of
498
dashes printed. The actual number will be the maximum minus the
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
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)



519
(def-kom-var kom-show-creating-software nil
520
  "*If non-nil, show the creating software of each text, if specified."
521
522
523
  server
  inherited)

David Byers's avatar
David Byers committed
524
(def-kom-var kom-show-author-at-end t
525
  "*If non-nil, the author will be shown at the end of each text."
David Byers's avatar
David Byers committed
526
527
  server
  inherited)
David Byers's avatar
David Byers committed
528

529
(def-kom-var kom-truncate-threshold nil
530
531
  "*If non-nil, truncate long texts when reviewing.
If the text is longer (in lines), the threshold it will be
532
533
534
truncated to `kom-truncate-show-lines' length."
  server)

535
(def-kom-var kom-truncate-show-lines 10
536
537
538
539
540
541
542
  "*How many lines to show after truncating.
If the text is truncated by `kom-truncate-threshold', show this many
lines.  If this is greater than the threshold, the threshold will be
used."
  server)


David Byers's avatar
X    
David Byers committed
543
(def-kom-var kom-print-number-of-unread-on-entrance t
544
  "*If non-nil, print automatically the number of unread articles when
David Byers's avatar
X    
David Byers committed
545
546
entering a conference."
  server)
Per Cederqvist's avatar
.  
Per Cederqvist committed
547

548
(def-kom-var kom-show-unread-in-frame-title t
549
  "*If non-nil, show an unread indicator in the frame title of each
550
551
552
LysKOM session."
  server)

David Byers's avatar
David Byers committed
553
554
555
556
557
558
559
560
561
562
563
;; In the common block of the user-area is a simple boolean variable
;; `presence-messages'.  The control of presence messages in the Emacs
;; Lisp client is more advanced, using two non-boolean variables instead
;; (`kom-presence-messages-in-echo' and `kom-presence-messages-in-buffer').
;;
;; Keep track of the common block variable too, although it isn't used here.
;; `lyskom-save-options' sets it before saving it in obvious cases,
;; but generally it's not possible to know what value it should have.
;; (It could also be used for default values for the presence options for
;; users converting from another client, but that isn't done.)

David Byers's avatar
X    
David Byers committed
564
(def-kom-var kom-presence-messages t
David Byers's avatar
David Byers committed
565
566
567
568
569
570
571
572
573
  "Equivalent of the variable `presence-messages' in the user-area.
This is a boolean where other clients may store whether the user wants
messages about people logging in and out of LysKOM.  Here this is instead
controlled by `kom-presence-messages-in-echo-area' and
`kom-presence-messages-in-buffer', so only use this variable to
influence what this client stores in the common block of the user-area."
  server)

(def-kom-var kom-presence-messages-in-echo-area t
574
  "*If non-nil, LysKOM prints continuous info about what other people are doing.
David Byers's avatar
David Byers committed
575
Info is printed on the echo area and never in the buffer. If minibuffer is
576
used, no message is printed.
Linus Tolke's avatar
Linus Tolke committed
577

David Byers's avatar
David Byers committed
578
579
580
581
A list of integers means show messages for those users.

The value 'friends means show messages for the users in kom-friends.

582
583
584
585
586
The value 'morons means show messages for the users in kom-morons.

The value 'friends-and-morons means show messages for the users in 
kom-friends and kom-morons.

587
If you want the messages in the buffer, you could set the variable 
David Byers's avatar
X    
David Byers committed
588
589
kom-presence-messages-in-buffer."
  server)
David Byers's avatar
David Byers committed
590

David Byers's avatar
David Byers committed
591
592


David Byers's avatar
X    
David Byers committed
593
(def-kom-var kom-presence-messages-in-buffer nil
David Byers's avatar
David Byers committed
594
  "*If non-nil, LysKOM prints information about what other people are doing in the buffer.
Per Cederqvist's avatar
.  
Per Cederqvist committed
595
All printing is done just before the prompt.
David Byers's avatar
David Byers committed
596

Per Cederqvist's avatar
.  
Per Cederqvist committed
597
If nil no messages are printed.
598
599
If 'presence, messages about people logging in, out and people 
changing name are printed."
David Byers's avatar
X    
David Byers committed
600
  server)
Per Cederqvist's avatar
.  
Per Cederqvist committed
601

David Byers's avatar
X    
David Byers committed
602
(def-kom-var kom-show-where-and-what t
Per Cederqvist's avatar
.  
Per Cederqvist committed
603
  "*Non-nil means kom-who-is-on shows from which machine the user is running
David Byers's avatar
X    
David Byers committed
604
605
and what he is doing."
  server)
David Byers's avatar
David Byers committed
606

607
608
(def-kom-var kom-show-since-and-when nil
  "*Non-nil means kom-who-is-on shows when the user connected and when
609
he last was active."
610
  server)
Per Cederqvist's avatar
.  
Per Cederqvist committed
611

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

David Byers's avatar
X    
David Byers committed
617
618
619
(def-kom-var kom-show-footnotes-immediately t
  "*Non-nil means show footnotes immediately following the text."
  server)
620

David Byers's avatar
X    
David Byers committed
621
(def-kom-var kom-follow-comments-outside-membership nil
622
623
624
  "*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
625
626
will not be shown."
  server)
627

David Byers's avatar
David Byers committed
628
629
630
631
(def-kom-var kom-follow-attachments t
  "*Follow attachments as if they are regular comments."
  server)

632
633
634
635
;;(def-kom-var kom-who-buffer-size-when-displaying 10
;;  "Size of window to display the who-buffer.
;;This is used when executing the kom-display-who-buffer command."
;;  server)
Per Cederqvist's avatar
.  
Per Cederqvist committed
636

David Byers's avatar
X    
David Byers committed
637
638
639
(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
640

David Byers's avatar
X    
David Byers committed
641
(def-kom-var kom-continuous-scrolling t
642
  "*Non-nil means scroll LysKOM window as text is inserted. The last viewed
David Byers's avatar
X    
David Byers committed
643
644
position (generally the most recent prompt) will always be visible."
  server)
645
646


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

David Byers's avatar
David Byers committed
653
654
655
656
(def-kom-var lyskom-overlay-pool nil  
  "Pool of overlays"
  local)

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

660
661
662
663
664
665
(def-kom-var kom-review-priority nil
  "*If non-nil, the priority to use when reviewing texts. Set this to
255 or higher to avoid texts and conferences with higher priority to
break in while reviewing."
  server)

David Byers's avatar
X    
David Byers committed
666
(def-kom-var kom-higher-priority-breaks nil
667
668
669
  "*Non-nil means allow texts from conferences with higher priority to break in.
If the value is 'express, texts are allowed to break in the middle of a
comment chain. Otherwise we don't let them in until the end of the comment
David Byers's avatar
X    
David Byers committed
670
671
tree."
  server)
Per Cederqvist's avatar
.  
Per Cederqvist committed
672

673
674
(def-kom-var kom-server-priority-breaks nil
  "*Non-nil means allow servers with a higher priority to break in.
675
676
Valid values are 'express, 'express-letters, 'letters, 'after-conf, 
'after-conf-letters, t and 'when-done.
677

678
'express means break immediately when a text arrives in a prioritized
679
680
session.

681
'express-letters means break immediately when a letter arrives in a 
682
683
684
685
686
prioritized session.

t means break after the current comment chain when a text arrives in 
a prioritized session.

687
'letters means break after the current comment chain when a letter
688
689
arrives in a prioritized session.

690
'after-conf means break after the current conference when a text
691
692
arrives in a prioritized session.

693
'after-conf-letters means break after the current conference when a
694
695
letter arrives in a prioritized session.

696
'when-done means prompt user to go to the next session with unreads
697
698
699
700
701
after everything has been read. This overrides kom-do-when-done as
long as there are sessions with unread texts.
"
  server)

David Byers's avatar
David Byers committed
702
(def-kom-var kom-view-text-hook nil
703
  "*Hook that is called before a text is shown. When the hooks are
David Byers's avatar
David Byers committed
704
705
called, kom-view-text-text is bound to the text mass of the 
text and kom-view-text-text-stat to the text-stat of the text
706
707
to be shown."
  local-hook)
708

David Byers's avatar
David Byers committed
709
710
711
712
713
714
715
716
(def-kom-var lyskom-view-text-hook nil
  "Obsolete synonym for kom-view-text-hook."
  local-hook)


(def-kom-var lyskom-send-message-hook nil
  "*Obsolete synonym for lyskom-send-message-hook."
  local-hook)
717

David Byers's avatar
David Byers committed
718
(def-kom-var kom-send-message-hook '(lyskom-send-message-trim-newlines)
David Byers's avatar
David Byers committed
719
720
721
722
723
724
725
  "*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
726
727
be sent."
  local-hook)
David Byers's avatar
David Byers committed
728

David Byers's avatar
David Byers committed
729
(def-kom-var kom-send-message-setup-hook nil
730
731
  "*Hook that is called when the minibuffer is entered to read a message."
  local-hook)
732

David Byers's avatar
David Byers committed
733
734
735
736
737
(def-kom-var lyskom-send-message-setup-hook nil
  "*Obsolete synonym for kom-send-message-setup-hook."
  local-hook)

(def-kom-var kom-send-message-exit-hook nil
738
739
  "*Hook that is called when the minibuffer is exited after reading a message."
  local-hook)
740

David Byers's avatar
David Byers committed
741
742
743
744
745
(def-kom-var lyskom-send-message-exit-hook nil
  "*Obsolete synonym for kom-send-message-exit-hook."
  local-hook)

(def-kom-var kom-send-text-hook nil
David Byers's avatar
David Byers committed
746
  "*Hook that is called before sending a text. Hook functions return t to
747
748
749
signal success and nil to prevent the text from being sent. Note that this
hook is called before the text headers are parsed, so it is possible that
sending will be canceled or recipients altered after calling this hook."
750
  local-hook)
David Byers's avatar
David Byers committed
751

David Byers's avatar
David Byers committed
752
753
754
755
756
(def-kom-var lyskom-send-text-hook nil
  "*Obsolete synonym for kom-send-text-hook."
  local-hook)

(def-kom-var kom-after-load-hook nil
757
  "*Hook to run once after LysKOM is loaded.")
David Byers's avatar
David Byers committed
758

David Byers's avatar
David Byers committed
759
760
761
762
(def-kom-var lyskom-after-load-hook nil
  "*Obsolete synonym for kom-after-load-hook.")

(def-kom-var kom-change-conf-hook nil
David Byers's avatar
David Byers committed
763
764
  "*Hook to run when changing conferences.
The functions in this list are run with two arguments. The first is the 
765
766
767
768
769
770
current conf-no and the second is the conf-no being changed to.

This hook is run before lyskom-current-conf is changed, and before any
standard messages have been printed."
  local-hook)

David Byers's avatar
David Byers committed
771
772
773
774
775
(def-kom-var lyskom-change-conf-hook nil
  "*Obsolete synonym for kom-change-conf-hook"
  local-hook)

(def-kom-var kom-after-change-conf-hook nil
776
777
778
779
780
781
  "*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.

This hook is run after lyskom-current-conf is changed, and after any
standard messages have been printed."
782
  local-hook)
David Byers's avatar
David Byers committed
783

David Byers's avatar
David Byers committed
784
785
786
787
(def-kom-var lyskom-after-change-conf-hook nil
  "*Obsolete synonym for kom-after-change-conf-hook."
  local-hook)

David Byers's avatar
X    
David Byers committed
788
(def-kom-var lyskom-login-hook nil
789
  "*What to do when logged in.
790
This hook is called after we have logged in but before any command is
791
accepted from the keyboard. It is called immediately before
792
793
kom-login-hook."
  local-hook)
794

David Byers's avatar
X    
David Byers committed
795
(def-kom-var kom-login-hook nil
Per Cederqvist's avatar
.  
Per Cederqvist committed
796
797
  "*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
798
799
any command is accepted from the keyboard. See also lyskom-login-hook."
  server)
David Byers's avatar
David Byers committed
800

801
802
803
(def-kom-var kom-confirm-add-recipients t
  "*When non-nil, offer to add cc-recipient instead of full recipient."
  server)
804

Per Cederqvist's avatar
.  
Per Cederqvist committed
805

David Byers's avatar
X    
David Byers committed
806
(def-kom-var kom-do-when-done '(kom-review-all-marked-texts kom-display-time)
Per Cederqvist's avatar
.  
Per Cederqvist committed
807
808
809
810
811
  "*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:
812

Per Cederqvist's avatar
.  
Per Cederqvist committed
813
type			prompt
814
815
816
817
818
------------------------------
lyskom-function		from the lyskom-command-name function
command			\"Command:\" (name of function or definition of
			lambda expression)
keyboard macro		\"Command:\" (keyboard macro definition)"
David Byers's avatar
X    
David Byers committed
819
  server)
David Byers's avatar
David Byers committed
820

David Byers's avatar
X    
David Byers committed
821
(def-kom-var kom-page-before-command nil
822
  "*This is a list of all commands before which the screen is cleared.
David Byers's avatar
X    
David Byers committed
823
824
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
825

David Byers's avatar
X    
David Byers committed
826
(def-kom-var kom-permissive-completion t
827
828
  "*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
829
830
for future use."
  server)
831

832
833
834
835
836
(def-kom-var kom-unsubscribe-makes-passive t
  "*If non-nil subtracting oneself from a conference makes the membership
passive. A second leave will actually remove the membership."
  server)

David Byers's avatar
David Byers committed
837
(def-kom-var kom-membership-default-priority 'ask
Per Cederqvist's avatar
.  
Per Cederqvist committed
838
839
840
841
  "*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
842
843
Valid priorities are only the range 0-255."
  server)
David Byers's avatar
David Byers committed
844

David Byers's avatar
X    
David Byers committed
845
(def-kom-var kom-membership-default-placement 'last
Per Cederqvist's avatar
.  
Per Cederqvist committed
846
847
848
849
850
  "*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
851
otherwise => the new conference is entered after all conferences."
David Byers's avatar
X    
David Byers committed
852
  server)
David Byers's avatar
David Byers committed
853

David Byers's avatar
X    
David Byers committed
854
(def-kom-var lyskom-current-prompt nil
855
856
  "The current prompt or nil.
This is either nil, indicating that there is currently no prompt, or
857
a symbol indicating which command is prompted in the LysKOM buffer."
David Byers's avatar
X    
David Byers committed
858
  local)
David Byers's avatar
David Byers committed
859

David Byers's avatar
X    
David Byers committed
860
861
862
863
864
865
(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)

866
(def-kom-var lyskom-current-prompt-args nil
867
  "The current prompt arguments.
868
869
870
These are arguments used to format the current prompt."
  local)

871
872
873
874
875
(def-kom-var lyskom-current-prompt-timestamp nil
  "The creationtime of the current prompt.
This is used when updating the prompt and on lyskom-start-of-command."
  local)

876
877
878
879
(def-kom-var lyskom-need-prompt-update nil
  "Non-nil if all prompts need to be updated."
  local)

David Byers's avatar
X    
David Byers committed
880
(def-kom-var kom-show-personal-messages-in-buffer t
881
882
883
884
  "*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
885
886
nonexistent) buffer in which the message is inserted."
  server)
David Byers's avatar
David Byers committed
887

David Byers's avatar
X    
David Byers committed
888
(def-kom-var kom-pop-personal-messages nil
889
  "*Non-nil means pop up a buffer with personal messages as they arrive.
David Byers's avatar
X    
David Byers committed
890
891
kom-show-personal-messages-in-buffer decides which buffer to pop."
  server)
892

893
894
895
(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
896
(def-kom-var kom-ding-on-new-letter nil
897
  "*Non-nil means ding if a message arrives in the letter box. See 
David Byers's avatar
X    
David Byers committed
898
899
kom-ding-on-priority-break for valid values."
  server)
900
901


David Byers's avatar
X    
David Byers committed
902
(def-kom-var kom-ding-on-priority-break 1
903
904
  "*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
905
906
program named by kom-audio-player."
  server)
David Byers's avatar
David Byers committed
907

David Byers's avatar
X    
David Byers committed
908
(def-kom-var kom-ding-on-wait-done 1
909
910
911
  "*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
912
913
function to call."
  server)
914

David Byers's avatar
X    
David Byers committed
915
(def-kom-var kom-ding-on-common-messages 0
916
917
918
919
920
921
922
  "*Non-nil means ding as alarm messages arrive. 
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. A list consisting of pairs (KEY . VALUE) is used
for fine-grained control. The list is searched for a pair where KEY
matches the sender identity. The corresponding VALUE is used as the
specification on how to beep."
David Byers's avatar
X    
David Byers committed
923
  server)
David Byers's avatar
David Byers committed
924

David Byers's avatar
X    
David Byers committed
925
(def-kom-var kom-ding-on-group-messages 1
926
  "*Non-nil means ding as group messages arrive.
927
928
929
930
931
932
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. A list consisting of pairs (KEY . VALUE) is used
for fine-grained control. The list is searched for a pair where KEY
matches the recipient identity. The corresponding VALUE is used as the
specification on how to beep."
David Byers's avatar
X    
David Byers committed
933
  server)
934

David Byers's avatar
X    
David Byers committed
935
(def-kom-var kom-ding-on-personal-messages 2
936
  "*Non-nil means ding as personal messages arrive.
937
938
939
940
941
942
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. A list consisting of pairs (KEY . VALUE) is used
for fine-grained control. The list is searched for a pair where KEY
matches the sender identity. The corresponding VALUE is used as the
specification on how to beep."
David Byers's avatar
X    
David Byers committed
943
  server)
David Byers's avatar
David Byers committed
944
945


David Byers's avatar
David Byers committed
946
(def-kom-var kom-ding-on-no-subject 2
947
  "*How to ding if the user has not entered a subject line.
948
949
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
950
951
to call."
  server)
David Byers's avatar
David Byers committed
952

953

David Byers's avatar
X    
David Byers committed
954
(def-kom-var kom-audio-player "audioplay"
David Byers's avatar
David Byers committed
955
956
  "*Program to play audio files."
  server)
David Byers's avatar
David Byers committed
957

Per Cederqvist's avatar
.  
Per Cederqvist committed
958

959
960
961
962
963
964
965
966
(def-kom-var kom-ignore-message-senders nil
  "*List of senders whose personal, group and alarm messages are ignored."
  server)

(def-kom-var kom-ignore-message-recipients nil
  "*List of recipients you do not want group messages to."
  server)

967
968
969
970
(def-kom-var kom-show-personal-message-date t
  "*Show date on personal messages is non-nil."
  server)

David Byers's avatar
X    
David Byers committed
971
(def-kom-var kom-default-message-recipient 'group
David Byers's avatar
David Byers committed
972
973
  "*Determines default recipient of personal messages.

974
975
976
977
978
979
'everybody means the default recipient is everybody.
'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
X    
David Byers committed
980
  server)
David Byers's avatar
David Byers committed
981
982


David Byers's avatar
David Byers committed
983
(def-kom-var kom-filter-outgoing-messages t
984
  "*t if outgoing remote-control messages and automatic replies are not
985
986
to be displayed in the buffer."
  server)
David Byers's avatar
David Byers committed
987
988


David Byers's avatar
X    
David Byers committed
989
(def-kom-var kom-friends nil
David Byers's avatar
David Byers committed
990
991
992
  "*List of people whose names should be formatted using kom-friends-face.
Also used in kom-who-is-on-and-friend. This is a list of integers (person
numbers)."
David Byers's avatar
X    
David Byers committed
993
  server)
994

995
996
997
998
(def-kom-var kom-morons nil
  "*List of people whose names should be formatted using kom-morons-face."
  server)

999
1000
1001
(def-kom-var kom-dont-check-commented-authors nil
  "*List of recipients who do not need to be added to comments that they
might not see. Typically this list consists of import agents."
1002
1003
  server
  inherited)
1004

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

David Byers's avatar
David Byers committed
1008
1009
1010
1011
(def-kom-var kom-smileys t
  "*Non-nil means to reformat smileys in text."
  server)

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

David Byers's avatar
X    
David Byers committed
1016
1017
(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
1018

David Byers's avatar
David Byers committed
1019
(def-kom-var kom-autowrap t
David Byers's avatar
David Byers committed
1020
1021
  "*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
1022
1023
  server)

1024
1025
1026
(def-kom-var kom-keep-alive-interval 180
  "*The number of seconds between periodic requests used to keep the session alive"
  server)
1027

1028
1029
1030
1031
(defvar lyskom-transforming-external-text nil
  "Dynamically bound to non-nil when transforming text in which text,
conference and person buttons are not expected.")

David Byers's avatar
David Byers committed
1032
(def-kom-var lyskom-url-protocol-regexp
1033
1034
  "\\(file\\|ftp\\|gopher\\|http\\|https\\|news\\|wais\\|mailto\\|telnet\\):"
  "Regexp to match the protocol part of a URL.")
David Byers's avatar
David Byers committed
1035

David Byers's avatar
X    
David Byers committed
1036
(def-kom-var lyskom-text-buttons
1037
1038
  '(
    ;; Text numbers
1039
1040
1041
1042
1043
1044
    ("\\(\\<[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)
1045
1046
     )

David Byers's avatar
David Byers committed
1047
1048
    ;; Email

David Byers's avatar
David Byers committed
1049
    ("\\(\\b\\|^\\)[^()<>@,;:\"\\\\\000- ]+@[^\000- <>;,.'\"!:?) \t\012\014]+\\(\\.[^\000- <>;,.'\"!:?)]+\\)+"
David Byers's avatar
David Byers committed
1050
1051
     email 0 0 kom-url-face)

1052
1053
    ;; URLs

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

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

1062
1063
    ;; JySKom enhancements

1064
    ("<(?m[|ö]te[ \t\n\r]*\\([0-9]+\\)\\([^0-9>]?\\|[^0-9>][^>]*\\))?>"
1065
     conf 0 1 nil)
1066
    ("<(?text[ \t\n\r]*\\([0-9]+\\)\\([^0-9>]?\\|[^0-9>][^>]*\\))?>"
1067
     text 0 1 nil)
1068
    ("<(?person[ \t\n\r]*\\([0-9]+\\)\\([^0-9>]?\\|[^0-9>][^>]*\\))?>"
1069
     pers 0 1 nil)
David Byers's avatar
David Byers committed
1070

1071
1072
    ;; Info node reference

David Byers's avatar
David Byers committed
1073
    ("\\*Note[ \n\t]+\\([^:\n]*\\(\n[^:\n]*\\)?\\):\\s-*\\(\\(([^\)]+)\\)?[^.,\t\n]*\\(\n[^.,\t\n]*\\)?\\)[.,\t]" 
1074
     info-node 1 3 kom-url-face)
1075

David Kågedal's avatar
David Kågedal committed
1076
    )
1077
1078
1079
  "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.
1080
TYPE is the button type. Valid button types are defined in lyskom-button-actions.
1081
BUTTON-MATCH is the number of the parenthesized expression that is the actual button.
1082
BUTTON-ARG-MATCH is the number of the expression to be used as the button argument.
David Byers's avatar
X    
David Byers committed
1083
FACE is the text face to apply to the button, or nil to use the default face.")
1084

David Byers's avatar
X    
David Byers committed
1085
(def-kom-var kom-url-viewer-preferences '("emacs"
1086
1087
                                          "windows"
                                          "w3")
David Byers's avatar
David Byers committed
1088

1089
  "*LysKOM will attempt to use URL viewers in the order specified here.
David Byers's avatar
David Byers committed
1090
1091
1092
kom-url-managers is a list of all available viewers. Note that the elements
are all strings.

1093
When you select a URL, this list is used to determine which URL
David Byers's avatar
David Byers committed
1094
1095
1096
1097
1098
1099
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.