Commit 2db56f73 authored by David Byers's avatar David Byers
Browse files

Probably fixed bug 1078. Worked on bug 1075.

Detailed changes:
> 	Work on bug 1075:
> 	* parse.el (lyskom-parse-static-server-info): New function.
>
> 	* services.el (initiate-get-boottime-info): New function.
>
> 	* vars.el.in (lyskom-static-server-info): New variable.
>
> 	* komtypes.el (static-server-info): New type.
>
> 	Fix bug 1078:
> 	* vars.el.in (lyskom-global-variable-types): Change read of
> 	integer.
> 	(kom-default-mark): Put this both in the common area and the elisp
> 	area. This is a good thing when we set it to values that are not
> 	legal according to the protocol specification.
>
> 	* flags.el (lyskom-flag-read-integer): When reading integers,
> 	accept nil too.
>
parent ce295516
2003-08-13 David Byers <byers@lysator.liu.se>
Work on bug 1075:
* parse.el (lyskom-parse-static-server-info): New function.
* services.el (initiate-get-boottime-info): New function.
* vars.el.in (lyskom-static-server-info): New variable.
* komtypes.el (static-server-info): New type.
Fix bug 1078:
* vars.el.in (lyskom-global-variable-types): Change read of
integer.
(kom-default-mark): Put this both in the common area and the elisp
area. This is a good thing when we set it to values that are not
legal according to the protocol specification.
* flags.el (lyskom-flag-read-integer): When reading integers,
accept nil too.
Delete initial value on change:
* completing-read.el (lyskom-read-from-minibuffer-clear-initial):
New function.
......
......@@ -39,6 +39,8 @@
(eval-when-compile
(require 'lyskom-command "command"))
(put 'lyskom-invalid-flag-type 'error-conditions
'(error lyskom-error lyskom-invalid-flag-type))
(defvar lyskom-options-text nil
"Text mass when reading options.")
......@@ -118,16 +120,18 @@ settings and save them to your emacs init file."
(common-block
(concat
(mapconcat (lambda (var)
(let ((common-name (elt var 0))
(elisp-name (elt var 1))
(type (elt var 2)))
(lyskom-format-objects
(symbol-name common-name)
(funcall
(cdr (assq 'write
(cdr (assq (or type t)
lyskom-global-variable-types))))
(symbol-value elisp-name)))))
(condition-case nil
(let ((common-name (elt var 0))
(elisp-name (elt var 1))
(type (elt var 2)))
(lyskom-format-objects
(symbol-name common-name)
(funcall
(cdr (assq 'write
(cdr (assq (or type t)
lyskom-global-variable-types))))
(symbol-value elisp-name))))
(lyskom-invalid-flag-type "")))
lyskom-global-variables
"\n")
))
......@@ -469,3 +473,11 @@ elisp variable VAR."
(defun lyskom-flag-read-from-string (str)
(car (read-from-string str)))
(defun lyskom-flag-read-integer (str)
(cond ((equal str "nil") nil)
(t (string-to-int str))))
(defun lyskom-flag-write-integer (val)
(cond ((integerp val) (prin1-to-string val))
(t (signal 'lyskom-invalid-flag-type nil))))
......@@ -841,6 +841,17 @@ Do nothing if the TLIST is less than N elements long."
(values :default nil))
:nil-safe)
(def-komtype static-server-info
((boot-time :read-only t)
(save-time :read-only t)
(db-status :read-only t)
(existing-texts :read-only t)
(highest-text-no :read-only t)
(existing-confs :read-only t)
(existing-persons :read-only t)
(highest-conf-no :read-only t))
:nil-safe)
;;; ================================================================
......
......@@ -1107,6 +1107,17 @@ Args: TEXT-NO. Value: text-stat."
"Parse an array of Stats"
(lyskom-parse-vector (lyskom-parse-num) 'lyskom-parse-stats))
(defun lyskom-parse-static-server-info ()
"Parse a static-server-info"
(lyskom-create-static-server-info (lyskom-parse-time)
(lyskom-parse-time)
(lyskom-parse-string)
(lyskom-parse-num)
(lyskom-parse-num)
(lyskom-parse-num)
(lyskom-parse-num)
(lyskom-parse-num)))
;;; ================================================================
;;; Parsing of complex datatypes without cache.
......
......@@ -1313,6 +1313,11 @@ Args: KOM-QUEUE HANDLER SESSION-NO &rest DATA"
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-stats-array)
(lyskom-send-packet kom-queue (lyskom-format-objects 112 what))))
(defun initiate-get-boottime-info (kom-queue handler &rest data)
(lyskom-server-call
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-static-server-info)
(lyskom-send-packet kom-queue (lyskom-format-objects 113))))
;;; ================================================================
......
......@@ -356,10 +356,11 @@ clients of the event. See lyskom-mode for details on lyskom."
(defun lyskom-accept-async ()
(blocking-do 'accept-async '(5 7 8 9 11 12 13 14 15 16 17 18 19))
(blocking-do 'accept-async '(5 7 8 9 11 12 13 14 15 16 17 18 19 20 21))
(let* ((ans (blocking-do 'query-async)))
(unless (memq 15 (listify-vector ans))
(blocking-do 'accept-async '(0 5 7 8 9 11 12 13 14 16 17 18 19)))))
;; async-new-text is not implemented, so use async-new-text-old
(blocking-do 'accept-async '(0 5 7 8 9 11 12 13 14 16 17 18 19 20 21)))))
(defun lyskom-www-proxy-connect-filter (proc output)
......
......@@ -52,8 +52,8 @@
(defconst lyskom-global-variable-types
'((boolean (read . lyskom-flag-read-boolean)
(write . lyskom-flag-write-boolean))
(integer (read . string-to-int)
(write . prin1-to-string))
(integer (read . lyskom-flag-read-integer)
(write . lyskom-flag-write-integer))
(symbol-list (read . lyskom-flag-read-symbol-list)
(write . lyskom-flag-write-symbol-list))
(t (read . lyskom-flag-read-from-string)
......@@ -673,7 +673,8 @@ simply mark with that number. When set to `nil', `kom-mark-text' will
ask for a mark.
Values other than integers and `nil' are reserved for future use."
common default-mark integer)
common default-mark integer
server)
(def-kom-var kom-symbolic-marks-alist '(("Standard" . 100))
"**Association list that maps symbolic marks to mark numbers.
......@@ -3272,6 +3273,10 @@ will be shown."
"Cache of conference statuses."
local)
(def-kom-var lyskom-static-server-info nil
"Cache of static-server-info"
local)
(def-kom-var lyskom-uconf-cache nil
"Cache of small conference statuses."
local)
......
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