Commit e97d965d authored by Linus Tolke's avatar Linus Tolke
Browse files

Moved around functions to the new reading.el file.

parent d3303f8b
Thu Jul 30 03:54:50 1992 Linus Tolke Y (linus@lysator)
* reading.el: New file, to contain functions that sets
lyskom-membership, lyskom-to-do-list and lyskom-reading-list.
* startup.el (lyskom-start-anew-login-3): Started the prefetch
*after* stacking all entry prefetch-defaults.
......
......@@ -24,7 +24,10 @@
#
# $Id$
# $Log$
# Revision 35.19 1992/07/26 23:14:02 linus
# Revision 35.20 1992/07/30 19:49:22 linus
# Moved around functions to the new reading.el file.
#
# Revision 35.19 1992/07/26 23:14:02 linus
# Added prefetch.el
#
# Revision 35.18 1992/06/16 11:33:32 linus
......@@ -93,12 +96,13 @@ EMACS-BATCH = emacs -batch -l /usr/local/lib/elisp/bytecomp
# NOTE: lyskom-rest.el must be the last file in PARTS-EL and SRC-ELC.
PARTS-EL = komtypes.el clienttypes.el startup.el \
reading.el prefetch.el \
internal.el parse.el services.el cache.el\
commands1.el commands2.el review.el edit-text.el \
view-text.el async.el completing-read.el \
prioritize.el flags.el \
elib-string.el \
prefetch.el lyskom-rest.el
lyskom-rest.el
HEADER-EL = macros.el vars.el
HEADER-ELC = macros.elc vars.elc
SWEDISH-EL = swedish-strings.el
......@@ -106,12 +110,13 @@ SWEDISH-ELC = swedish-strings.elc
ENGLISH-EL = english-strings.el
ENGLISH-ELC = english-strings.elc
SRC-ELC = komtypes.elc clienttypes.elc startup.elc \
reading.elc prefetch.elc \
internal.elc parse.elc services.elc cache.elc\
commands1.elc commands2.elc review.elc edit-text.elc \
view-text.elc async.elc completing-read.elc \
prioritize.elc flags.elc \
elib-string.elc \
prefetch.elc lyskom-rest.elc
lyskom-rest.elc
PARTS-ELC = $(SRC-ELC)
.SUFFIXES : .el .elc
......
......@@ -496,14 +496,7 @@ Put the requests on QUEUE."
"Handle the return of the membership prefetch call."
(lyskom-stop-prefetch)
(let ((list (lyskom-array-to-list membership)))
(while list
(if (memq (membership->conf-no (car list))
(mapcar (function membership->conf-no) lyskom-membership))
(if (numberp lyskom-membership-is-read)
(-- lyskom-membership-is-read))
(setq lyskom-membership (append lyskom-membership (list (car list)))))
(setq list (cdr list)))
(setq list (lyskom-array-to-list membership))
(lyskom-add-membership-to-membership membership)
(while list
(lyskom-prefetch-map (membership->conf-no (car list))
(membership->last-text-read (car list))
......@@ -539,16 +532,7 @@ Maps are `cached' in lyskom-to-do-list."
(lyskom-prefetch-map-using-conf-stat
conf-stat (+ first-local lyskom-fetch-map-nos)
queue))
(while list
(if (read-list-enter-text (car list) conf-stat lyskom-to-do-list)
(setq list (cdr list))
(let ((info (lyskom-create-read-info
'CONF conf-stat
(membership->priority
(lyskom-member-p (conf-stat->conf-no conf-stat)))
(lyskom-create-text-list list))))
(read-list-enter-read-info info lyskom-to-do-list)
(setq list nil))))))
(lyskom-enter-map-in-to-do-list map conf-stat)))
(lyskom-queue-enter queue 'FINISHED)
(-- lyskom-pending-prefetch)
(lyskom-start-prefetch)
......@@ -569,6 +553,7 @@ Maps are `cached' in lyskom-to-do-list."
(defun lyskom-prefetch-whobuffer-handler (who-is-on queue)
"Handle the who-is-on info. The goal here is to get an updated who-buffer."
(cache-initiate-who-info-buffer who-is-on) ;+++ should be done later
(-- lyskom-pending-prefetch)
)
......
;;;;;
;;;;; $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.
;;;;;
;;;; ================================================================
;;;; ================================================================
;;;;
;;;; File: reading.el
;;;;
;;;; This file contains functions that manage membership and reading
;;;; lists, namely lyskom-membersip lyskom-reading-list and
;;;; lyskom-to-do-list. These are called both from prefetch and from
;;;; startup procedures.
;;;;
(setq lyskom-clientversion-long
(concat lyskom-clientversion-long
"$Id$\n"))
(defun lyskom-enter-map-in-to-do-list (map conf-stat)
"Takes a MAP and enters all its listed text-nos in the conference CONF-STAT.
This works by modifying the lyskom-to-do-list which in some cases
also means modifying the lyskom-reading-list. The zero text-nos are skipped."
(let ((list (lyskom-array-to-list (map->text-nos map))))
(while list
(if (zerop (car list))
(setq list (cdr list))
(if (read-list-enter-text (car list) conf-stat lyskom-to-do-list)
(setq list (cdr list))
(let ((info (lyskom-create-read-info
'CONF conf-stat
(membership->priority
(lyskom-member-p (conf-stat->conf-no conf-stat)))
(lyskom-create-text-list
(apply 'append
(mapcar
(function
(lambda (k)
(if (zerop k) nil k)))
list)
nil)))))
(read-list-enter-read-info info lyskom-to-do-list)
(setq list nil)))))))
(defun lyskom-add-membership-to-membership (membership)
"Adds a newly fetched MEMBERSHIP-PART to the list in lyskom-membership.
If an item of the membership is already read and entered in the
lyskom-membership list then this item is not entered and the variable
lyskom-membership-is-read is decreased by 1."
(let ((list (lyskom-array-to-list membership)))
(while list
(if (memq (membership->conf-no (car list))
(mapcar (function membership->conf-no) lyskom-membership))
(if (numberp lyskom-membership-is-read)
(-- lyskom-membership-is-read))
(setq lyskom-membership (append lyskom-membership (list (car list)))))
(setq list (cdr list)))
(setq list (lyskom-array-to-list membership))))
......@@ -319,14 +319,7 @@ Information required for this:
"Adds a PART last in the membership-list."
(let ((list (lyskom-array-to-list membership))
sent)
(while list
(if (memq (membership->conf-no (car list))
(mapcar (function membership->conf-no) lyskom-membership))
(if (numberp lyskom-membership-is-read)
(-- lyskom-membership-is-read))
(setq lyskom-membership (append lyskom-membership (list (car list)))))
(setq list (cdr list)))
(setq list (lyskom-array-to-list membership))
(lyskom-add-membership-to-membership membership)
(while (and (not sent) list)
(if (and lyskom-unread-confs
(not (memq (membership->conf-no (car list))
......@@ -388,17 +381,7 @@ If not, fetch next conf-stat from REST-MEMBERSHIPLIST."
(defun lyskom-decide-unread-map (map conf)
"Enters this map in the lyskom-to-do-list and returns to lyskom-start-anew-login-3."
(let ((list (lyskom-array-to-list (map->text-nos map))))
(while list
(if (read-list-enter-text (car list) conf lyskom-to-do-list)
(setq list (cdr list))
(let ((info (lyskom-create-read-info
'CONF conf
(membership->priority
(lyskom-member-p (conf-stat->conf-no conf)))
(lyskom-create-text-list list))))
(read-list-enter-read-info info lyskom-to-do-list))
(setq list))))
(lyskom-enter-map-in-to-do-list map conf)
(lyskom-start-anew-login-3 'cont))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment