Commit 509f1475 authored by David Kågedal's avatar David Kågedal
Browse files

Läsnivåer och lite fixar.

parent 1cc6151a
No preview for this file type
......@@ -457,6 +457,8 @@ In that case, just discard this call."
;; Update the read-lists.
(if (and (lyskom-conf-fetched-p (conf-stat->conf-no recipient))
(lyskom-member-p (conf-stat->conf-no recipient)))
(not (read-list-enter-text text-no recipient lyskom-to-do-list)))
;; If we have already read all texts in the conference...
(let ((info (lyskom-create-read-info
......@@ -167,7 +167,7 @@ Return the new uconf-stat or nil"
(defun cache-set-marked-texts (mark-array)
"Sets the marks for all marked texts. A mark-list is an array, but we
want a list in the cache, so this remakes it into a list."
(setq lyskom-marked-text-cache (lyskom-array-to-list mark-array)))
(setq lyskom-marked-text-cache (listify-vector mark-array)))
(defun cache-text-is-marked (text-no)
......@@ -231,7 +231,7 @@ otherwise return nil"
(local-set-key [mouse-2] 'kom-mouse-2)
(mapcar 'cache-add-who-info
(sort (lyskom-array-to-list who-info-arr)
(sort (listify-vector who-info-arr)
(function (lambda (who1 who2)
(< (who-info->connection who1)
(who-info->connection who2)))))))
......@@ -396,6 +396,8 @@ Returns t if it was possible, otherwise nil."
"Adds MEMBERSHIP to the sorted list of memberships.
Also adds to lyskom-to-do-list."
;;; +++ What should this do if the priority is lower than
;;; kom-session-priority?
(if membership
(setq lyskom-membership (sort (cons membership lyskom-membership)
......@@ -408,7 +410,7 @@ Also adds to lyskom-to-do-list."
(conf-stat->no-of-texts conf-stat))))
(if map
(let ((texts (skip-first-zeros
(sort (append (map->text-nos map) nil)
(sort (listify-vector (map->text-nos map))
(if texts
......@@ -262,7 +262,8 @@ otherwise: the conference is read with lyskom-completing-read."
(if (or (null member-conf-stat)
(null membership))
(lyskom-insert-string 'secret-membership)
(lyskom-print-date-and-time (membership->last-time-read membership))
(membership->last-time-read membership))
(let ((unread (- (+ (conf-stat->first-local-no conf-stat)
(conf-stat->no-of-texts conf-stat))
(membership->last-text-read membership)
......@@ -1223,6 +1224,25 @@ current conference to another session."
;;; ================================================================
;;; S{tt l{sniv} - Sess session priority
;;; Author: David K}gedal
(def-kom-command kom-set-session-priority (priority)
"Set the priority level of the current session.
This sets the variable kom-session-priority and refetches all
membership info."
(interactive "P")
(let ((pri (or priority
(lyskom-read-number (lyskom-get-string
(setq lyskom-session-priority pri)
;;; ================================================================
;;; Begrav lyskom-sessionen - kom-bury
......@@ -151,11 +151,6 @@ Logins is a list of conf-nos (only significant when PREDICATE is logins)."
(memq (conf-stat->conf-no cs) logins))))
;; +++ Where should this be put?
(defsubst listify-vector (vector)
"Turn VECTOR into a list"
(append vector nil))
(defun lyskom-read-conf-name-internal (string predicate all)
"The \"try-completion\" for the lyskom-read name.
STRING is the string to be matched.
......@@ -453,7 +453,8 @@ Entry to this mode runs lyskom-edit-mode-hook."
(if (or (eq (car headers) 'comm-to)
(eq (car headers) 'footn-to))
(setq no (car (cdr headers))
headers nil)))
headers nil)
(setq headers (cdr (cdr headers)))))
(goto-char p)
......@@ -497,6 +497,7 @@ Mark the envelope with \"LysKOM bug report\"\n\n")
(who-to-throw-out . "Which session do you want to kill: ")
(throwing-out . "Killing session %#1d... ")
(postpone-prompt . "How much do you want to read now: ")
(set-session-priority . "Set reading level:")
; From review.el:
(latest-n . "last %#1d")
......@@ -828,6 +829,7 @@ Text:
(kom-list-news "List news")
(kom-membership "List subscriptions")
(kom-postpone "Postpone reading")
(kom-set-session-priority "Set reading level")
(kom-prioritize "Prioritize conferences")
(kom-status-person "Status (of) user")
(kom-status-conf "Status (of) conference")
No preview for this file type
......@@ -715,15 +715,14 @@ i.e creates the buffer, sets all markers and pointers."
(set-buffer buffer)
(let* ((kom-queue (cdr (assoc ref-no lyskom-pending-calls)))
(call-info (lyskom-locate-ref-no kom-queue ref-no)))
(if (null call-info)
nil ; This call has probably been cancelled
(set-buffer lyskom-unparsed-buffer)
(apply-parser call-info)
(set-buffer buffer)
(setq lyskom-pending-calls
(lyskom-assoc-dremove ref-no lyskom-pending-calls))
(lyskom-check-call kom-queue)))))
(set-buffer lyskom-unparsed-buffer)
(if call-info
(apply-parser call-info))
(set-buffer buffer)
(setq lyskom-pending-calls
(lyskom-assoc-dremove ref-no lyskom-pending-calls))
(lyskom-check-call kom-queue))))
(defun lyskom-locate-ref-no (kom-queue ref-no)
......@@ -507,7 +507,7 @@ Put the requests on QUEUE."
(defun lyskom-prefetch-membership-handler (membership pers-no queue)
"Handle the return of the membership prefetch call."
(let ((list (lyskom-array-to-list membership)))
(let ((list (listify-vector membership)))
(lyskom-add-membership-to-membership membership)
(while list
(lyskom-prefetch-map (membership->conf-no (car list))
......@@ -541,7 +541,8 @@ Put the requests on QUEUE."
Maps are `cached' in lyskom-to-do-list."
(if map
(let ((list (lyskom-array-to-list (map->text-nos map))))
(let ((list (listify-vector (map->text-nos map))))
;; +++ Check kom-session-priority
(if list
conf-stat (+ first-local lyskom-fetch-map-nos)
......@@ -42,7 +42,7 @@
"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))))
(let ((list (listify-vector (map->text-nos map))))
(while list
(if (zerop (car list))
(setq list (cdr list))
......@@ -70,7 +70,7 @@ also means modifying the lyskom-reading-list. The zero text-nos are skipped."
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)))
(let ((list (listify-vector membership)))
(while list
(if (memq (membership->conf-no (car list))
(mapcar (function membership->conf-no) lyskom-membership))
......@@ -78,4 +78,4 @@ lyskom-membership-is-read is decreased by 1."
(-- lyskom-membership-is-read))
(setq lyskom-membership (append lyskom-membership (list (car list)))))
(setq list (cdr list)))
(setq list (lyskom-array-to-list membership))))
(setq list (listify-vector membership))))
......@@ -242,7 +242,7 @@ This is called at login and after prioritize and set-unread."
(defun lyskom-set-membership (membership)
"Sets lyskom-membership to a new value.
(setq lyskom-membership (sort (lyskom-array-to-list membership)
(setq lyskom-membership (sort (listify-vector membership)
(setq lyskom-membership-is-read t))
......@@ -527,6 +527,7 @@ to see, set of call."
(make-local-variable 'lyskom-server-info)
(make-local-variable 'lyskom-server-name)
(make-local-variable 'lyskom-session-no)
(make-local-variable 'lyskom-session-priority)
(make-local-variable 'lyskom-text-cache)
(make-local-variable 'lyskom-text-mass-cache)
(make-local-variable 'lyskom-to-be-printed-before-prompt)
......@@ -521,6 +521,7 @@ M\344rk kuvertet \"LysKOM buggrapport f\366r elispklienten\".\n\n")
(who-to-throw-out . "Vilken session vill du kasta ut? ")
(throwing-out . "Kastar nu ut session %#1d... ")
(postpone-prompt . "Hur lite vill du l\344sa nu? ")
(set-session-priority . "S\344tt l\344sniv\345:")
; From review.el:
(latest-n . "senaste %#1d")
......@@ -864,6 +865,7 @@ Text:
(kom-list-news "Lista nyheter")
(kom-membership "Lista medlemsskap")
(kom-postpone "Uppskjuta l\344sning")
(kom-set-session-priority "S\344tt l\344sniv\345")
(kom-prioritize "Prioritera m\366ten")
(kom-status-person "Status (f\366r) person")
(kom-status-conf "Status (f\366r) m\366te")
......@@ -492,6 +492,11 @@ different packets.")
(defvar lyskom-session-no 0
"Session number in the server for this connection")
(defvar lyskom-session-priority 0
"*This sessions priority.
Only texts in conferences with a priority equal to or higher than this
will be shown.")
(defvar lyskom-proc nil
"The process (network connection) that is associated with this buffer.")
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