startup.el 21.1 KB
Newer Older
Linus Tolke's avatar
Linus Tolke committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
;;;;;
;;;;; $Id$
;;;;; Copyright (C) 1991  Lysator Academic Computer Association.
;;;;;
;;;;; 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 
;;;;; the Free Software Foundation; either version 1, or (at your option) 
;;;;; 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
34
35
;;;; ================================================================
;;;; ================================================================
;;;;
;;;; File: startup.el
;;;;
;;;; This file contains functions that are called only when lyskom
;;;; is loaded, started or when a new user is logged in during a 
;;;; session.
;;;;


36
37
38
39
40
(setq lyskom-clientversion-long 
      (concat lyskom-clientversion-long
	      "$Id$\n"))


Per Cederqvist's avatar
.    
Per Cederqvist committed
41
42
43
44
45
46
;;; ================================================================
;;;                         Start kom.


(defun lyskom (&optional host username password)
  "Start a LysKOM session.
Linus Tolke's avatar
Linus Tolke committed
47
48
49
Optional arguments: HOST, USERNAME and PASSWORD.

See lyskom-mode for details."
David Kågedal's avatar
David Kågedal committed
50
51
52
53
  (interactive (list (lyskom-read-server-name
		      (lyskom-format 'server-q
				     (or (getenv "KOMSERVER")
					 lyskom-default-server)))
Per Cederqvist's avatar
.    
Per Cederqvist committed
54
55
56
		     nil
		     nil))

57
  (run-hooks 'lyskom-init-hook)
58
  (setq username
David Kågedal's avatar
David Kågedal committed
59
	(or username (getenv "KOMNAME")))
60
  (setq password
David Kågedal's avatar
David Kågedal committed
61
	(or password (getenv "KOMPASSWORD")))
Per Cederqvist's avatar
.    
Per Cederqvist committed
62
63
64
  (if (zerop (length host))
      (setq host (or (getenv "KOMSERVER")
		     lyskom-default-server)))
65
66
  (let ((port 4894)
	(init-done nil))
Per Cederqvist's avatar
.    
Per Cederqvist committed
67
68
69
70
71
72
73
74
75
    (cond				;Allow "nanny:4892" to use port 4892.
     ((string-match ":" host)
      (setq port (string-to-int (substring host (match-end 0))))
      (cond
       ((zerop (match-beginning 0))
	(setq host lyskom-default-server))
       (t
	(setq host (substring host 0 (match-beginning 0)))))))

David Kågedal's avatar
David Kågedal committed
76
77
78
79
80
81
82
83
    (let* ((buffer (generate-new-buffer host))
	   (name (buffer-name buffer))
	   (proc nil))
      (unwind-protect
	  (progn
	    (setq proc (open-network-stream name buffer host port))
	    (switch-to-buffer buffer)
	    (lyskom-mode)		;Clearing lyskom-default...
84
	    (setq lyskom-buffer buffer)
David Kågedal's avatar
David Kågedal committed
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
	    (setq lyskom-default-user-name username)
	    (setq lyskom-default-password password)
	    (setq lyskom-server-name host)
	    (setq lyskom-proc proc)
	    (lyskom-insert
	     (lyskom-format 'try-connect lyskom-clientversion host))
	    (set-process-filter proc 'lyskom-connect-filter)
	    (lyskom-process-send-string proc
					(concat "A"
						(lyskom-format-objects
						 (concat (user-login-name)
							 "%" (system-name)))))
	    (while (eq 'lyskom-connect-filter (process-filter proc))
	      (accept-process-output proc))
	    ;; Now we have got the correct response.
	    (set-process-sentinel proc 'lyskom-sentinel)

	    (save-excursion
David Kågedal's avatar
David Kågedal committed
103
	      (lyskom-init-parse buffer))
David Kågedal's avatar
David Kågedal committed
104
105
106
107
108
109
110
111
112
113

	    (setq lyskom-server-info (blocking-do 'get-server-info))
	    (lyskom-format-insert 
	     'connection-done
	     (if (zerop (% (server-info->version lyskom-server-info) 100))
		 (format "%d.%d"
			 (/ (server-info->version lyskom-server-info) 10000)
			 (/ (% (server-info->version lyskom-server-info) 10000) 
			    100))
	       (format "%d.%d.%d"
114
		       (/ (server-info->version lyskom-server-info) 10000)
David Kågedal's avatar
David Kågedal committed
115
116
117
118
119
120
121
122
123
124
125
		       (/ (% (server-info->version lyskom-server-info) 10000)
			  100)
		       (% (server-info->version lyskom-server-info) 100))))
	    (if (not (zerop (server-info->motd-of-lyskom lyskom-server-info)))
		(lyskom-insert 
		 (text->text-mass 
		  (blocking-do 'get-text 
			       (server-info->motd-of-lyskom
				lyskom-server-info)))))
	    ;; Can't use lyskom-end-of-command here.
	    (setq lyskom-executing-command nil) 
126
	  ;;; B|rja
David Kågedal's avatar
David Kågedal committed
127
128
	    (kom-start-anew t)
	    (setq init-done t))
129
	;; Something went wrong. Lets cleanup everything. :->
David Kågedal's avatar
David Kågedal committed
130
131
132
133
	(if init-done
	    nil
	  (if proc (delete-process proc))
	  (kill-buffer buffer))))))
Per Cederqvist's avatar
.    
Per Cederqvist committed
134
135
136
137


(defun lyskom-connect-filter (proc output)
  "Receive connection acknowledgement from server."
138
139
140
141
142
143
144
145
146
147
148
149
  (if lyskom-debug-communications-to-buffer
      (save-excursion
	(set-buffer
	 (get-buffer-create lyskom-debug-communications-to-buffer-buffer))
	(goto-char (point-max))
	(insert "\n" (format "%s" proc) "-----> " output)))
  (cond
   ((string-match "^LysKOM\n" output)
    (set-process-filter proc 'lyskom-filter))))



Per Cederqvist's avatar
.    
Per Cederqvist committed
150
151
152
153
154
155
156


;;; ================================================================
;;;                        Start anew


(defun kom-start-anew (&optional first-time-around)
157
  "Start as a new person."
Per Cederqvist's avatar
.    
Per Cederqvist committed
158
159
  (interactive)
  (lyskom-start-of-command 'kom-start-anew)
David Kågedal's avatar
David Kågedal committed
160
161
  (let ((old-me lyskom-pers-no))
    (unwind-protect
Per Cederqvist's avatar
.    
Per Cederqvist committed
162
	(progn
David Kågedal's avatar
David Kågedal committed
163
164
165
166
167
168
169
170
171
172
173
174
175
	  (if first-time-around
	      nil
	    (lyskom-tell-internat 'kom-tell-login))
	  (setq lyskom-pers-no nil)
	  (while (not lyskom-pers-no)
	    (if (and first-time-around
		     lyskom-default-user-name)
		;; This is nil if we can't find a unique match.
		(setq lyskom-pers-no
		      (lyskom-read-conf-name-internal lyskom-default-user-name
						      'pers 'conf-no)))
	    (if lyskom-pers-no
		nil
David Byers's avatar
David Byers committed
176
177
178
	      (let ((name (lyskom-read-conf-name
			   (lyskom-get-string 'what-is-your-name)
			   'pers nil "")))
David Kågedal's avatar
David Kågedal committed
179
180
181
		(setq lyskom-pers-no
		      (or (lyskom-read-conf-name-internal name 'pers 'conf-no)
			  (lyskom-create-new-person name)))))
David Kågedal's avatar
David Kågedal committed
182
183
	    ;; Now lyskom-pers-no contains a number of a person.
	    ;; Lets log him in.
David Kågedal's avatar
David Kågedal committed
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
	    (if lyskom-pers-no
		(let ((conf-stat (blocking-do 'get-conf-stat lyskom-pers-no))
		      (lyskom-inhibit-minibuffer-messages t))
		  (lyskom-insert (concat (conf-stat->name conf-stat) "\n"))
		  (setq first-time-around nil)
		  (if (blocking-do 'login lyskom-pers-no
				   (if lyskom-default-password
				       (prog1
					   lyskom-default-password
					 (setq lyskom-default-password nil)
					 (set-default 'lyskom-default-password
						      nil))
				     ;; Use password read when creating
				     ;; the person when loggin in new
				     ;; users
				     (or lyskom-is-new-user
					 (silent-read (lyskom-get-string 'password)))))
		      (if lyskom-is-new-user
			  (blocking-do 'add-member
				       (server-info->conf-pres-conf lyskom-server-info)
				       lyskom-pers-no 100 1))
		    (lyskom-insert-string 'wrong-password)
		    (setq lyskom-pers-no nil))
		  (setq lyskom-is-new-user nil))))
	  
David Kågedal's avatar
David Kågedal committed
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
	  ;; Now we are logged in.
	  (lyskom-insert-string 'are-logged-in)
	  (let ((conf-stat (blocking-do 'get-conf-stat lyskom-pers-no)))
	    (if (and conf-stat
		     (/= (conf-stat->msg-of-day conf-stat) 0))
		(progn
		  (lyskom-insert-string 'you-have-motd)
		  (lyskom-view-text (conf-stat->msg-of-day conf-stat))))
	    (if (and conf-stat
		     (zerop (conf-stat->presentation conf-stat))
		     (not (zerop (conf-stat->no-of-texts conf-stat))))
		(lyskom-insert-string 'presentation-encouragement)))
	  (lyskom-read-options) 
	  (lyskom-refetch)
	  ;; (cache-initiate-who-info-buffer (blocking-do 'who-is-on))
	  (cache-set-marked-texts (blocking-do 'get-marks))
	  ;; What is this variable? It is never used. It is ust to
	  ;; fill the cache?
227
	  (let ((lyskom-who-am-i (blocking-do 'who-am-i)))
David Kågedal's avatar
David Kågedal committed
228
229
	    (if lyskom-who-am-i (setq lyskom-session-no lyskom-who-am-i))))
	  
David Kågedal's avatar
David Kågedal committed
230
231
      ;; If something failed, make sure we are someone
      (if (null lyskom-pers-no) (setq lyskom-pers-no old-me))
David Kågedal's avatar
David Kågedal committed
232
      (setq lyskom-is-new-user nil)
David Kågedal's avatar
David Kågedal committed
233
234
235
236
237
238
      (lyskom-end-of-command)))
  ;; Run the hook kom-login-hook. We don't want to hang the
  ;; login, just because something crashed here.
  (condition-case err
      (run-hooks 'kom-login-hook)
    (error (lyskom-format-insert-before-prompt
David Kågedal's avatar
David Kågedal committed
239
	    'error-in-login-hook (format "%s" err)))))
Linus Tolke's avatar
Linus Tolke committed
240
241
242


(defun lyskom-refetch ()
243
244
245
246
247
248
  "Resets and fetches all reading info.
This is called at login and after prioritize and set-unread."
  ;; The whole membership!
  (lyskom-set-membership (blocking-do 'get-membership lyskom-pers-no))
  (setq lyskom-membership-is-read t)
  (setq lyskom-unread-confs (blocking-do 'get-unread-confs lyskom-pers-no))
Linus Tolke's avatar
Linus Tolke committed
249
250
  (setq lyskom-last-conf-fetched -1)
  (setq lyskom-last-conf-received -1)
251
  (setq lyskom-last-conf-done -1)
Linus Tolke's avatar
Linus Tolke committed
252
  (setq lyskom-to-do-list (lyskom-create-read-list))
253
  (setq lyskom-reading-list (lyskom-create-read-list)))
254
255


Linus Tolke's avatar
Linus Tolke committed
256
257
258
(defun lyskom-set-membership (membership)
  "Sets lyskom-membership to a new value.
Args: MEMBERSHIP."
David Kågedal's avatar
David Kågedal committed
259
  (setq lyskom-membership (sort (listify-vector membership)
Linus Tolke's avatar
Linus Tolke committed
260
261
				'lyskom-membership-<))
  (setq lyskom-membership-is-read t))
Per Cederqvist's avatar
.    
Per Cederqvist committed
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300


(defun lyskom-print-name (conf-stat)
  "Print the name of the CONF-STAT, with a trailing \n."
  (lyskom-insert (concat (conf-stat->name conf-stat) "\n")))


(defun lyskom-extract-persons (conf-list)
  "Extract persons from a conf-list.
Return a list of pers-nos of all conferences that are persons.
Args: CONF-LIST."
  (lyskom-do-extract-persons-or-confs conf-list t))


(defun lyskom-extract-confs (conf-list)
  "Extract conferences from a conf-list.
Return a list of conf-nos of all conferences that are persons.
Args: CONF-LIST."
  (lyskom-do-extract-persons-or-confs conf-list nil))


(defun lyskom-do-extract-persons-or-confs (conf-list want-persons)
  "Extract persons or conferences from CONF-LIST.
WANT-PERSONS is t for persons, nil for confs."
  (let* ((result nil)
	 (i 0)
	 (nos (conf-list->conf-nos conf-list))
	 (types (conf-list->conf-types conf-list))
	 (len (length nos)))
    (while (< i len)
      (cond
       ((eq (conf-type->letterbox (elt types i))
	    want-persons)
	(setq result (cons (elt nos i)
			   result))))
      (++ i))
    (nreverse result)))


David Kågedal's avatar
David Kågedal committed
301
(defun lyskom-create-new-person (name)
Per Cederqvist's avatar
.    
Per Cederqvist committed
302
303
304
305
306
307
308
309
310
311
  "A new user named NAME (or an old that mis-spelled his name)."
  (lyskom-insert
   (lyskom-format 'first-greeting name))
  (lyskom-scroll)
  (cond
   ((ja-or-nej-p (lyskom-format 'is-name-correct name))
    (let ((password (silent-read (lyskom-get-string 'personal-password))))
      (cond
       ((not (equal password 
		    (silent-read (lyskom-get-string 'repeat-password))))
David Kågedal's avatar
David Kågedal committed
312
	;; Failed to enter the same password twice
Per Cederqvist's avatar
.    
Per Cederqvist committed
313
	(lyskom-insert-string 'repeat-failure)
David Kågedal's avatar
David Kågedal committed
314
	nil)
Per Cederqvist's avatar
.    
Per Cederqvist committed
315
       (t
David Kågedal's avatar
David Kågedal committed
316
317
318
319
320
321
322
323
	;; Entered the same password twice
	(let ((new-person (blocking-do 'create-person name password)))
	  (if (null new-person)
	      (lyskom-insert-string 'could-not-create-you)
	    ;; Raise a flag so the user will be added to the
	    ;; presentation conference after login
	    (setq lyskom-is-new-user password))
	  new-person)))))
Per Cederqvist's avatar
.    
Per Cederqvist committed
324
   (t
David Kågedal's avatar
David Kågedal committed
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
    ;; Do not create a new person
    nil)))


;;(defun lyskom-start-anew-create-handler (pers-no name password)
;;  "A new person has been created. Log in as him."
;;  (cond
;;   ((null pers-no)
;;    (lyskom-insert-string 'could-not-create-you)
;;    (setq lyskom-executing-command nil)
;;    (kom-start-anew))
;;   (t
;;    (initiate-login 'main 'lyskom-add-for-new-person
;;		    pers-no password pers-no lyskom-pers-no)
;;    )))

;;(defun lyskom-add-for-new-person (reply pers-no lyskom-pers-no)
;;  "Add a news person as member in the default presentation conference."
;;  (initiate-add-member 'main 'lyskom-start-anew-login-2
;;		       (server-info->conf-pres-conf lyskom-server-info)
;;		       pers-no 100 1
;;		       pers-no lyskom-pers-no))
Linus Tolke's avatar
Linus Tolke committed
347

Per Cederqvist's avatar
.    
Per Cederqvist committed
348

David Kågedal's avatar
David Kågedal committed
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
(defun lyskom-read-server-name (prompt)
  "Read the name of a LysKOM server.
Copmpletion is done on the servers i lyskom-server-aliases. If an
alias name is entered, the corresponding address is returned."
  ;; Create a completion table like
  ;; (("kom.lysator.liu.se" . "kom.lysator.liu.se")
  ;;  ("LysKOM" . "kom.lysator.liu.se"))
  (let ((known-servers
	 (append (mapcar (function (lambda (pair)
				     (cons (car pair) (car pair))))
			 lyskom-server-aliases)
		 (mapcar (function (lambda (pair)
				     (cons (cdr pair) (car pair))))
			 lyskom-server-aliases)))
	(completion-ignore-case t)
	server)
    (setq server (completing-read prompt known-servers nil nil))
    (or (cdr (assoc server known-servers))
	server)))
      

Per Cederqvist's avatar
.    
Per Cederqvist committed
370
371
372
;;; ================================================================
;;;                        The LysKOM mode.

373
374
375
;; The LysKOM mode should not be inherited if we create a new buffer
;; and default-major-mode is nil.
(put 'lyskom-mode 'mode-class 'special)
Per Cederqvist's avatar
.    
Per Cederqvist committed
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397

(defun lyskom-mode ()
  "\\<lyskom-mode-map>Mode for LysKOM client.
Commands:
\\[kom-next-command]	reads the next text, selects next conference with unread texts
	or whatever the prompt says.
\\[kom-go-to-conf]	asks for a conference and makes you a member (if your not) in
	that conference. (you name the conference).
\\[kom-list-conferences]	writes a list of conferences matching a given string.
\\[kom-list-persons]	writes a list of persons matching a given string.

\\[kom-list-news]	gives a list of the amount of unread texts you have and in 
	what conferences.
\\[kom-go-to-next-conf]	put the current conference in the bottom of the list and read 
	the next one from the list of conferences with unread texts.

\\[kom-membership]	creates a buffer with the list of conferences you are member in.

\\[kom-quit]	leaves this lyskom session.
\\[kom-who-is-on]	gives you a list of all the users of lyskom right now.

\\[kom-extended-command]	reads a command using the minibuffer and executes it.
398
	This is another way to give commands.
Per Cederqvist's avatar
.    
Per Cederqvist committed
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463

\\[kom-write-text]	asks for subject and start editing of a new text.
\\[kom-write-comment]	starts editing of a comment to the last read article.
\\[kom-private-answer]	starts editing of a personal answer to the author of the last
	read article.
\\[kom-send-letter]	prompts for a name of a person or conference and then starts
	editing a letter to this person or conference.

\\[kom-page-next-command]	starts at the top of a page and then does what \\[kom-next-command] does.
\\[kom-line-next-command]	does what the \\[kom-next-command] does but scrolls at most 1 line.

0 .. 9	gives a numeric argument to certain commands.
\\[describe-mode]	gives you this help.

\\[kom-busy-wait]	put the lyskom-session in wait mode. The next created text with 
	a priotity higher that that of the next conference you are going
	to will be read directly when it is created.
\\[kom-set-unread]	mark a number of texts as unread.
\\[kom-jump]	skip, mark as read, all the comments to this article recursively.
\\[kom-display-time]	show the current date and time.

\\[kom-change-presentation]	change your presentation.
\\[kom-view]	view the specified text.
\\[kom-view-commented-text]	view the text that the current text comments or is a footnote to.
\\[kom-review-presentation]	show the presentation for a person or a conferencce.

\\[kom-review-comments]	view all comments to the current text.
\\[kom-review-tree]	view all comments to the current text and step through the tree
	in depth-first order.

\\[kom-find-root-review]	view the complete comment tree.
\\[kom-find-root]	show the root text of this comment tree.
\\[kom-review-by-to]	view the last (first or all) article written by named author
	in a named conference.

\\[kom-mark-text]	creates a mark on a text. (you specify a number).
\\[kom-unmark-text]	removes the mark on a text.
\\[kom-review-marked-texts]	view all text marked with a certain mark. (you specify it).
\\[kom-review-all-marked-texts]	view all marked text.

\\[kom-view-next-new-text]	push the viewing on the bottom of the stack and read the next new
	text from the list of unread.
\\[kom-review-next]	continue the viewing.
\\[kom-review-stack]	show the stack of things we are viewing.
\\[kom-review-clear]	clear the stack of things we are viewing.
\\[kom-review-backward]	toggles the read order of reviewed texts. This can only be done
	when viewing texts with \\[kom-review-by-to], \\[kom-review-marked-texts] and \\[kom-review-all-marked-texts].

\\[kom-status-conf]	show the status of a conference.
\\[kom-status-person]	show the status of a person
\\[kom-save-text]	save the text you are looking at to a file.

\\[kom-get-abuse]	get an insulting text.
\\[kom-get-appreciation]	get an encouraging text.

\\[kom-list-news-old]	another list of unread texts. Sometimes they differ due to 
	bugs in the client. This will not exist any more when there are no 
	more bugs in these parts of the code.

\\[kom-add-self]	makes you a member of a conference.
\\[kom-sub-self]	removes you as a member of a conference.

All bindings (this is here due to the fact that inconsistensies while 
developping this package are frequent):
\\{lyskom-mode-map}
Linus Tolke's avatar
Linus Tolke committed
464
465
466
467
468
469
Entry to this mode runs lyskom-mode-hook.

Functions and variables beginning with kom- are intended for the user to see,
set or call.
Functions and variables beginning with lyskom- are not intended for the user
to see, set of call."
Per Cederqvist's avatar
.    
Per Cederqvist committed
470
471
472
  (interactive)
  (lyskom-clear-vars)
  (setq mode-line-buffer-identification
473
	(list (concat (lyskom-mode-name-from-host) ": ") 'mode-line-conf-name))
Per Cederqvist's avatar
.    
Per Cederqvist committed
474
475
476
477
478

  (setq major-mode 'lyskom-mode)
  (setq mode-name "LysKOM")
  (setq mode-line-process '(": %s"))
  (use-local-map lyskom-mode-map)
479
  (lyskom-count-down-edits)
480
481
  (run-hooks 'lyskom-mode-hook)
  (lyskom-tell-phrases-validate))
Per Cederqvist's avatar
.    
Per Cederqvist committed
482
483
484
485
486
487
488
489
490
491
492


(defun lyskom-clear-vars ()
  "Set up buffer-local vars."
  (let ((proc lyskom-proc)
	(pers-no lyskom-pers-no)
	(membership lyskom-membership)
	(membership-is-read lyskom-membership-is-read)
	(last-viewed lyskom-last-viewed)
	(replies-buffer lyskom-unparsed-buffer)
	(replies-marker lyskom-unparsed-marker)
Linus Tolke's avatar
Linus Tolke committed
493
	(server-info lyskom-server-info)
494
	(server-name lyskom-server-name)
Linus Tolke's avatar
Linus Tolke committed
495
	)
Per Cederqvist's avatar
.    
Per Cederqvist committed
496
    (kill-all-local-variables)
497
498
499
500
    (make-local-variable 'kom-ansaphone-on)
    (make-local-variable 'kom-ansaphone-default-reply)
    (make-local-variable 'kom-remote-control)
    (make-local-variable 'kom-remote-controllers)
David Kågedal's avatar
David Kågedal committed
501
    (make-local-variable 'kom-login-hook)
Linus Tolke's avatar
Linus Tolke committed
502
    (make-local-variable 'lyskom-blocking-return)
David Kågedal's avatar
David Kågedal committed
503
504
    (make-local-variable 'lyskom-buffer)
    (make-local-variable 'lyskom-command-to-do)
Per Cederqvist's avatar
.    
Per Cederqvist committed
505
    (make-local-variable 'lyskom-conf-cache)
David Kågedal's avatar
David Kågedal committed
506
507
508
509
    (make-local-variable 'lyskom-count-var)
    (make-local-variable 'lyskom-current-conf)
    (make-local-variable 'lyskom-current-subject)
    (make-local-variable 'lyskom-current-text)
510
    (make-local-variable 'lyskom-default-password)
David Kågedal's avatar
David Kågedal committed
511
512
513
514
515
516
517
518
    (make-local-variable 'lyskom-default-user-name)
    (make-local-variable 'lyskom-do-when-done)
    (make-local-variable 'lyskom-dont-change-prompt)
    (make-local-variable 'lyskom-errno)
    (make-local-variable 'lyskom-executing-command)
    (make-local-variable 'lyskom-fetched-texts)
    (make-local-variable 'lyskom-filter-list)
    (make-local-variable 'lyskom-is-administrator)
Per Cederqvist's avatar
.    
Per Cederqvist committed
519
    (make-local-variable 'lyskom-is-parsing)
David Kågedal's avatar
David Kågedal committed
520
521
522
    (make-local-variable 'lyskom-is-waiting)
    (make-local-variable 'lyskom-is-writing)
    (make-local-variable 'lyskom-last-conf-done)
Per Cederqvist's avatar
.    
Per Cederqvist committed
523
524
    (make-local-variable 'lyskom-last-conf-fetched)
    (make-local-variable 'lyskom-last-conf-received)
David Kågedal's avatar
David Kågedal committed
525
526
527
    (make-local-variable 'lyskom-last-viewed)
    (make-local-variable 'lyskom-list-of-edit-buffers)
    (make-local-variable 'lyskom-marked-text-cache)
Per Cederqvist's avatar
.    
Per Cederqvist committed
528
    (make-local-variable 'lyskom-membership)
David Kågedal's avatar
David Kågedal committed
529
    (make-local-variable 'lyskom-membership-is-read)
Linus Tolke's avatar
Linus Tolke committed
530
    (make-local-variable 'lyskom-no-prompt)
David Kågedal's avatar
David Kågedal committed
531
532
533
534
535
536
537
538
539
540
541
542
543
    (make-local-variable 'lyskom-number-of-pending-calls)
    (make-local-variable 'lyskom-options-done)
    (make-local-variable 'lyskom-other-clients-user-areas)
    (make-local-variable 'lyskom-output-queue)
    (make-local-variable 'lyskom-pending-calls)
    (make-local-variable 'lyskom-pers-cache)
    (make-local-variable 'lyskom-pers-no)
    (make-local-variable 'lyskom-prefetch-conf-tresh)
    (make-local-variable 'lyskom-prefetch-confs)
    (make-local-variable 'lyskom-prefetch-texts)
    (make-local-variable 'lyskom-previous-text)
    (make-local-variable 'lyskom-prioritize-buffer)
    (make-local-variable 'lyskom-proc)
Per Cederqvist's avatar
.    
Per Cederqvist committed
544
    (make-local-variable 'lyskom-reading-list)
David Kågedal's avatar
David Kågedal committed
545
546
547
    (make-local-variable 'lyskom-server-info)
    (make-local-variable 'lyskom-server-name)
    (make-local-variable 'lyskom-session-no)
David Kågedal's avatar
David Kågedal committed
548
    (make-local-variable 'lyskom-session-priority)
David Kågedal's avatar
David Kågedal committed
549
550
    (make-local-variable 'lyskom-text-cache)
    (make-local-variable 'lyskom-text-mass-cache)
Per Cederqvist's avatar
.    
Per Cederqvist committed
551
    (make-local-variable 'lyskom-to-be-printed-before-prompt)
David Kågedal's avatar
David Kågedal committed
552
553
554
555
    (make-local-variable 'lyskom-to-do-list)
    (make-local-variable 'lyskom-unparsed-buffer)
    (make-local-variable 'lyskom-unparsed-marker)
    (make-local-variable 'lyskom-unread-confs)
Per Cederqvist's avatar
.    
Per Cederqvist committed
556
    (make-local-variable 'lyskom-what-i-am-doing)
David Kågedal's avatar
David Kågedal committed
557
558
559
    (make-local-variable 'lyskom-who-info-buffer)
    (make-local-variable 'lyskom-who-info-buffer-is-on)
    (make-local-variable 'lyskom-who-info-cache)
Per Cederqvist's avatar
.    
Per Cederqvist committed
560
561
562
563
564
565
566
567
568
    (make-local-variable 'mode-line-conf-name)
    (setq lyskom-proc proc)
    (setq lyskom-pers-no pers-no)
    (setq lyskom-membership membership)
    (setq lyskom-last-viewed last-viewed)
    (setq lyskom-membership-is-read membership-is-read)
    (setq lyskom-unparsed-buffer replies-buffer)
    (setq lyskom-unparsed-marker replies-marker)
    (setq lyskom-server-info server-info)
569
    (setq lyskom-server-name server-name)
Per Cederqvist's avatar
.    
Per Cederqvist committed
570
571
    (setq lyskom-do-when-done (cons kom-do-when-done kom-do-when-done))
    (setq lyskom-output-queue (lyskom-queue-create))
572
    (setq lyskom-list-of-edit-buffers nil)
Per Cederqvist's avatar
.    
Per Cederqvist committed
573
    (lyskom-set-mode-line (lyskom-get-string 'not-present-anywhere))))