Commit eae5f150 authored by David Byers's avatar David Byers
Browse files

Initiate-funktionerna returnerar ref-no för anropet.

Det går att stoppa serveranrop som ligger på kö.
kom-list-created-confs stoppar uteliggande anrop om man trycker C-g
kom-list-created-confs går att avbryta och ger lite mer ledtexter.
Lista möten och lista organisatörsskap tittat på kom-allow-incompleteness och lyskom-membership-is-read.
Completion fungerar i icke-MULE Gnu Emacs 20.x (förhoppningsvis slutar inget annat att fungera).
parent 69eb092e
2000-08-14 David Byers <>
* services.el (lyskom-server-call): Return the ref-no of the call
just made.
* commands1.el (kom-list-created-conferences): Attempt to cancel
calls still in the pipe before quitting.
* services.el (lyskom-cancel-call): New function.
* clienttypes.el (lyskom-queue-set-data): New function.
* compatibility.el (nil): Set lyskom-server-coding-system
according to the value of enable-multibyte-characters in Gnu Emacs
to make stuff work better in multibyte-disabled Gnu Emacsen.
* commands1.el (kom-list-conferences): Wait for membership to be
(kom-list-created-conferences): Wait for membership to be read.
(lyskom-list-conf-membership-char): New function to print
membership char in name lists.
(lyskom-list-created-conferences-2): Use it.
(lyskom-list-conf-print): Use it.
(kom-list-created-conferences): Make it possible to quit with C-g.
Fri Aug 11 17:34:39 2000 David Byers <>
* Release av 0.46-BETA-L
......@@ -388,6 +388,10 @@ element will be the new first element."
"Make the queue QUEUE empty."
(setcdr queue (cons nil nil)))
(defsubst lyskom-queue-set-data (queue data)
(lyskom-queue-make-empty queue)
(setcdr queue (cons data (last data))))
(defsubst lyskom-queue-delete-first (queue)
"Delete the first element of QUEUE and return it. If QUEUE is empty
......@@ -1407,11 +1407,18 @@ Those that you are not a member in will be marked with an asterisk."
;;; Author: ceder
;;; Rewritten: linus
(def-kom-command kom-list-conferences (match)
(def-kom-command kom-list-conferences (&optional match)
"List all conferences whose name matches MATCH (a string).
Those that you are not a member in will be marked with an asterisk."
(interactive (list (lyskom-read-string
(lyskom-get-string 'search-for-conf))))
(unless kom-allow-incompleteness
(sit-for 0)
(setq match (or match
(lyskom-get-string 'search-for-conf))))
(let ((result (blocking-do 'lookup-z-name match 0 1)))
(if result
(if (conf-z-info-list->conf-z-infos result)
......@@ -1424,52 +1431,76 @@ Those that you are not a member in will be marked with an asterisk."
(def-kom-command kom-list-created-conferences (arg)
"List all conferences created by some person."
(interactive "P")
(unless kom-allow-incompleteness
(sit-for 0)
(blocking-do 'get-uconf-stat lyskom-pers-no)
(let ((pers-no (lyskom-read-conf-no
(if arg 'list-pers-confs-created-by 'list-confs-created-by)
(if (cache-get-uconf-stat lyskom-pers-no)
(cons (conf-stat->name (cache-get-conf-stat lyskom-pers-no)) 0)1
(cons (conf-stat->name (cache-get-uconf-stat lyskom-pers-no)) 0)1
(lyskom-message (lyskom-get-string (if arg 'getting-all-pers-confs 'getting-all-confs)))
(let ((result (blocking-do 'lookup-z-name "" (if arg 1 0) 1)))
(lyskom-message (lyskom-get-string (if arg 'getting-all-pers confs-done 'getting-all-confs-done)))
(lyskom-message (lyskom-get-string (if arg 'getting-all-pers-confs-done 'getting-all-confs-done)))
(if result
(if (conf-z-info-list->conf-z-infos result)
(let ((counter (cons 1 (length (conf-z-info-list->conf-z-infos result)))))
(lyskom-traverse conf-z (conf-z-info-list->conf-z-infos result)
(initiate-get-conf-stat 'main
(conf-z-info->conf-no conf-z)
(lyskom-wait-queue 'main))
(let ((counter (vector nil
(length (conf-z-info-list->conf-z-infos result))
(calls nil))
(condition-case arg
(progn (lyskom-traverse conf-z (conf-z-info-list->conf-z-infos result)
(setq calls (cons
(initiate-get-conf-stat 'main
(conf-z-info->conf-no conf-z)
(lyskom-wait-queue 'main)
(when (eq 0 (elt counter 3))
(lyskom-format-insert 'no-created-confs pers-no))
(quit (aset counter 0 t)
(lyskom-cancel-call 'main calls))))
(lyskom-insert (lyskom-get-string (if arg 'no-pers-confs-exist 'no-confs-exist))))
(lyskom-format-insert (lyskom-current-error))))))
(defun lyskom-list-conf-membership-char (conf-no)
(if lyskom-membership-is-read
(cond ((lyskom-get-membership conf-no) ?\ )
((lyskom-get-membership conf-no t) ?-)
(t ?*))
(cond ((lyskom-try-get-membership conf-no) ?\ )
((lyskom-try-get-membership conf-no t) ?-)
(t ?\?))))
(defun lyskom-list-created-conferences-2 (cs counter pers-no arg)
(setcar counter (1+ (car counter)))
(lyskom-message (lyskom-format (if arg 'finding-created-pers-confs 'finding-created-confs)
(car counter)
(cdr counter)))
(when (and cs (or (eq (conf-stat->creator cs) pers-no)
(eq (conf-stat->supervisor cs) pers-no)
(eq (conf-stat->super-conf cs) pers-no)))
(lyskom-format-insert "%[%#1@%4#2:m %#3c %4#4s %#2M%]\n"
(lyskom-default-button 'conf (conf-stat->conf-no cs))
(if (lyskom-get-membership (conf-stat->conf-no cs))
(if (lyskom-get-membership (conf-stat->conf-no cs) t)
?- ?*))
(concat (if (eq pers-no (conf-stat->creator cs)) "C" " ")
(if (eq pers-no (conf-stat->supervisor cs)) "O" " ")
(if (eq pers-no (conf-stat->super-conf cs)) "S" " ")))))
(unless (elt counter 0)
(aset counter 1 (1+ (elt counter 1)))
(lyskom-message (lyskom-format (if arg 'finding-created-pers-confs 'finding-created-confs)
(elt counter 1)
(elt counter 2)))
(when (and cs (or (eq (conf-stat->creator cs) pers-no)
(eq (conf-stat->supervisor cs) pers-no)
(eq (conf-stat->super-conf cs) pers-no)))
(aset counter 3 (1+ (elt counter 3)))
(lyskom-format-insert "%[%#1@%4#2:m %#3c %4#4s %#2M%]\n"
(lyskom-default-button 'conf (conf-stat->conf-no cs))
(lyskom-list-conf-membership-char (conf-stat->conf-no cs))
(concat (if (eq pers-no (conf-stat->creator cs)) "C" " ")
(if (eq pers-no (conf-stat->supervisor cs)) "O" " ")
(if (eq pers-no (conf-stat->super-conf cs)) "S" " "))))))
(defun lyskom-list-conf-print (conf-z)
......@@ -1478,10 +1509,7 @@ If you are not member in the conference it will be flagged with an asterisk."
(lyskom-format-insert "%[%#1@%4#2:m %#3c %#2M%]\n"
(lyskom-default-button 'conf (conf-z-info->conf-no conf-z))
(if (lyskom-get-membership (conf-z-info->conf-no conf-z))
(if (lyskom-get-membership (conf-z-info->conf-no conf-z) t)
?- ?*))))
(lyskom-list-conf-membership-char (conf-z-info->conf-no conf-z))))
;;; ================================================================
;;; Lista med regexpar - List regexp
......@@ -318,6 +318,12 @@ string to search in."
(lyskom-provide-function string-make-multibyte (str) str)
(lyskom-provide-function multibyte-string-p (str) nil)
(lyskom-xemacs-or-gnu nil
(and (null enable-multibyte-characters)
(setq-default lyskom-server-coding-system 'raw-text)
(setq lyskom-server-coding-system 'raw-text)))
;;; Decode buggy versions of encode-coding-string and decode-coding-string
;;; such as those provided by APEL (part of TM and often included in XEmacs)
......@@ -332,14 +332,16 @@ and you have finished reading. Please come back later.
(no-matching-anys . "No persons or conferences match \"%#1s\".\n")
(no-confs-exist . "There are no conferences in the database.\n")
(no-pers-confs-exist . "There are no persons or conferences in the database.\n")
(list-confs-created-by . "List conferences created by: ")
(list-pers-confs-created-by . "List persons and conferences created by: ")
(list-confs-created-by . "List conferences administered by: ")
(listing-confs-created-by . "Listing conferences administered by %#1P\n")
(list-pers-confs-created-by . "List persons and conferences administered by: ")
(getting-all-confs . "Retrieving a list of all conferences from the server...")
(getting-all-pers-confs . "Retrieving a list of all persons and conferences from the server...")
(getting-all-confs-done . "Retrieving a list of all conferences from the server...done")
(getting-all-pers-confs-done . "Retrieving a list of all persons and conferences from the server...done")
(finding-created-confs . "Finding created persons and conferences (%#1d av %#2d klart)")
(finding-created-pers-confs . "Finding created persons and conferences (%#1d av %#2d klart)")
(finding-created-confs . "Finding administered conferences (%#1d av %#2d done)")
(finding-created-pers-confs . "Finding administered persons and conferences (%#1d av %#2d done)")
(no-created-confs . "%#1P is not creator, supervisor or super conference for any conference.\n")
(name-to-be-changed . "Name to change: ")
(no-such-conf-or-pers . "The conference or user doesn't exist.\n")
......@@ -1519,7 +1521,7 @@ You must become an active member of the conference to enter it.\n")
(kom-go-to-conf . "Go (to) conference")
(kom-go-to-next-conf . "(Go to) next conference")
(kom-jump . "Skip (all) comments")
(kom-list-created-conferences . "List created conferences")
(kom-list-created-conferences . "List administered conferences")
(kom-list-conferences . "List conferences")
(kom-list-persons . "List users")
(kom-list-news . "List news")
......@@ -81,8 +81,9 @@
from being called in the wrong buffer."
(` (let ((initiate-something-saved-buffer (current-buffer)))
(progn (or lyskom-output-queues (set-buffer lyskom-buffer))
(,@ body))
(prog2 (or lyskom-output-queues (set-buffer lyskom-buffer))
(,@ body))
(set-buffer initiate-something-saved-buffer)))))
(put 'lyskom-server-call 'lisp-indent-function 0)
......@@ -1376,6 +1377,34 @@ or get-text-stat."
(setq lyskom-multiple-blocking-return data
lyskom-ok-to-send-new-calls nil))
(defun lyskom-cancel-call (queue-name ref-nos)
"Attempt to cancel calls in queue QUEUE-NAME with ref-no in REF-NOS.
There is no guarantee that the call will be canceled. In particular, if
the call is not on QUEUE-NAME or has been sent to the server, it will
probably not be canceled."
(let ((found nil))
;; Delete the call from the pending queue
(let* ((queue (cdr (assq queue-name lyskom-call-data)))
(calls (and queue (lyskom-queue->all-entries (kom-queue->pending queue)))))
(when queue
(lyskom-queue-make-empty (kom-queue->pending queue))
(lyskom-traverse el calls
(if (memq (elt el 1) ref-nos)
(setq found t)
(lyskom-queue-enter (kom-queue->pending queue) el)))))
;; Delete the call from the output queue
(let* ((queue (aref lyskom-output-queues (lyskom-queue-priority queue-name))))
(when (and queue found)
(let ((calls (lyskom-queue->all-entries queue)))
(lyskom-queue-make-empty queue)
(lyskom-traverse el calls
(unless (memq (car el) ref-nos)
(lyskom-queue-enter queue el))))))))
(put 'blocking-do-multiple 'edebug-form-spec '(sexp body))
......@@ -313,14 +313,17 @@ du har l
(no-matching-anys . "Inga personer eller mten uppfyller uttrycket \"%#1s\".\n")
(no-confs-exist . "Det finns inga mten i databasen.\n")
(no-pers-confs-exist . "Det finns inga mten eller personer i databasen.\n")
(list-confs-created-by . "Lista mten skapade av: ")
(list-pers-confs-created-by . "Lista mten och personer skapade av: ")
(list-confs-created-by . "Lista organisatrsskap fr: ")
(listing-confs-created-by . "Organisatrsskap fr %#1P\n")
(list-pers-confs-created-by . "Lista organisatrsskap (med brevldor) fr: ")
(getting-all-confs . "Hmtar en lista av alla mten frn servern...")
(getting-all-pers-confs . "Hmtar en lista av alla personer och mten frn servern...")
(getting-all-confs-done . "Hmtar en lista av alla mten frn servern...klart")
(getting-all-pers-confs-done . "Hmtar en lista av alla personer och mten frn servern...klart")
(finding-created-confs . "Sker skapade mten (%#1d av %#2d klart)")
(finding-created-pers-confs . "Sker skapade mten och personer (%#1d av %#2d klart)")
(finding-created-confs . "Sker organisatrsskap (%#1d av %#2d klart)")
(finding-created-pers-confs . "Sker organisatrsskap (med brevldor) (%#1d av %#2d klart)")
(no-created-confs . "%#1P r inte skapare, organisatr eller supermte fr ngot mte.\n")
(name-to-be-changed . "Ange det namn som skall ndras: ")
(no-such-conf-or-pers . "Mtet eller personen finns ej.\n")
(new-name . "Nytt namn: ")
......@@ -1522,7 +1525,7 @@ Du m
(kom-go-to-conf . "G till mte")
(kom-go-to-next-conf . "G till nsta mte")
(kom-jump . "Hoppa ver alla kommentarer")
(kom-list-created-conferences . "Lista skapade mten")
(kom-list-created-conferences . "Lista organisatrsskap")
(kom-list-conferences . "Lista mten")
(kom-list-persons . "Lista personer")
(kom-list-news . "Lista nyheter")
Supports Markdown
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