Commit 79729ff4 authored by David Byers's avatar David Byers
Browse files

New commands: kom-list-new-conferences and kom-list-new-persons

Detailed changes:
> 	* services.el (initiate-first-unused-conf-no): New function.
> 	(initiate-first-unused-text-no): New function.
> 	(initiate-find-next-conf-no): New function.
> 	(initiate-find-previous-conf-no): New function.
>
> 	* commands2.el (kom-set-personal-label): Use capitalized strings
> 	for conf, pers and text.
> 	(lyskom-list-new-conferences): New function.
> 	(kom-list-new-persons): New command.
> 	(kom-list-new-conferences): New command.
>
> 	* commands1.el (lyskom-read-cross-reference-and-get-aux-item): Use
> 	capitalized strings for conf, pers and text.
> 	(lyskom-read-link): Same here.
>
parent 6d326786
2003-08-14 David Byers <byers@lysator.liu.se>
* services.el (initiate-first-unused-conf-no): New function.
(initiate-first-unused-text-no): New function.
(initiate-find-next-conf-no): New function.
(initiate-find-previous-conf-no): New function.
* commands2.el (kom-set-personal-label): Use capitalized strings
for conf, pers and text.
(lyskom-list-new-conferences): New function.
(kom-list-new-persons): New command.
(kom-list-new-conferences): New command.
* commands1.el (lyskom-read-cross-reference-and-get-aux-item): Use
capitalized strings for conf, pers and text.
(lyskom-read-link): Same here.
Handle async-new-presentation and async-new-motd correctly:
* async.el (lyskom-parse-async): Set the correct buffer when
looking for confs in the cache.
......
......@@ -4145,9 +4145,9 @@ Arguments:
(defun lyskom-read-cross-reference-and-get-aux-item ()
"Query user about cross reference type and value, and return the
corresponding aux-item."
(let* ((completions (list (cons (lyskom-get-string 'conference) 'conf)
(cons (lyskom-get-string 'person) 'pers)
(cons (lyskom-get-string 'text) 'text)))
(let* ((completions (list (cons (lyskom-get-string 'Conference) 'conf)
(cons (lyskom-get-string 'Person) 'pers)
(cons (lyskom-get-string 'Text) 'text)))
(completion-ignore-case t)
(type (cdr (lyskom-string-assoc
(lyskom-completing-read
......@@ -4191,9 +4191,9 @@ corresponding aux-item."
(defun lyskom-read-link ()
"Query user about link type and value, and return the corresponding
link as a string."
(let* ((completions (list (cons (lyskom-get-string 'conference) 'conf)
(cons (lyskom-get-string 'person) 'pers)
(cons (lyskom-get-string 'text) 'text)))
(let* ((completions (list (cons (lyskom-get-string 'Conference) 'conf)
(cons (lyskom-get-string 'Person) 'pers)
(cons (lyskom-get-string 'Text) 'text)))
(completion-ignore-case t)
(type (cdr (lyskom-string-assoc
(lyskom-completing-read
......
......@@ -2269,9 +2269,9 @@ really only a simple interface to the basic functionality of calc."
"This command is obsolete, broken and doesn't work. Don't use it.
Sets a personal label on an object of some kind."
(interactive)
(let* ((completions (list (cons (lyskom-get-string 'conference) 'conf)
(cons (lyskom-get-string 'person) 'pers)
(cons (lyskom-get-string 'text) 'text)))
(let* ((completions (list (cons (lyskom-get-string 'Conference) 'conf)
(cons (lyskom-get-string 'Person) 'pers)
(cons (lyskom-get-string 'Text) 'text)))
(completion-ignore-case t)
(type (cdr (lyskom-string-assoc
(completing-read (lyskom-get-string 'label-what-kind)
......@@ -3541,6 +3541,71 @@ are advisory; clients may ignore them."
(membership->type mship)))
(lp--update-buffer (uconf-stat->conf-no uconf-stat))))))
(def-kom-command kom-list-new-conferences ()
"List conferences created since the last time this command
was given."
(interactive)
(lyskom-list-new-conferences 'lyskom-last-known-conf-no
'conferences
(lambda (el)
(not (conf-type->letterbox
(uconf-stat->conf-type el))))))
(def-kom-command kom-list-new-persons ()
"List persons created since the last time this command
was given."
(interactive)
(lyskom-list-new-conferences 'lyskom-last-known-pers-no
'persons
(lambda (el)
(conf-type->letterbox
(uconf-stat->conf-type el)))))
(defun lyskom-list-new-conferences (varsym obj filter)
"List conferences created since the last time this command
was given."
(interactive)
(let* ((result (make-collector))
(var (symbol-value varsym))
(count 0)
(conf-no (or (car var) 1))
(last-conf-no (blocking-do 'first-unused-conf-no))
(time-string (condition-case nil
(and var (lyskom-format-time
'date-and-time (cdr var)))
(error nil))))
(cond ((null last-conf-no)
(lyskom-format-insert 'no-support-in-server))
((>= conf-no last-conf-no)
(lyskom-format-insert 'no-new-conferences
time-string (lyskom-get-string obj)))
(t
(lyskom-format-insert 'new-conferences-since
time-string (lyskom-get-string obj))
(while (< conf-no last-conf-no)
(initiate-get-uconf-stat 'main
(lambda (val result)
(and val (collector-push val result)))
conf-no result)
(setq conf-no (1+ conf-no)))
(lyskom-wait-queue 'main)
(lyskom-traverse conf (nreverse (collector->value result))
(when (funcall filter conf)
(setq count (1+ count))
(lyskom-format-insert "%5#1m %#2c %#1M\n"
conf
(lyskom-list-conf-membership-char
(uconf-stat->conf-no conf)))))
(when (lyskom-j-or-n-p (lyskom-format 'mark-confs-as-known
(lyskom-get-string obj)
count))
(set varsym (cons conf-no (lyskom-current-client-time)))
(lyskom-save-options lyskom-buffer
nil
nil
nil))))))
......
......@@ -1588,10 +1588,18 @@ Contents: \"%#9s\"
;; Cross-reference stuff
(person . "User")
(conference . "Conference")
(text . "Text")
(server . "Server")
(Person . "User")
(person . "user")
(persons . "users")
(Conference . "Conference")
(conference . "conference")
(conferences . "conferences")
(Text . "Text")
(text . "text")
(texts . "texts")
(Server . "Server")
(server . "server")
(servers . "servers")
(xref-type . "What to you want to refer to (text, conference or person)? ")
(which-text-to-xref . "Add reference to text: ")
......@@ -1966,6 +1974,10 @@ written a presentation.%]
(unit-year . "year")
(db-status-backup . "information loss may have occurred")
(no-support-in-server . "No support in server for this command.\n")
(mark-confs-as-known . "Mark these %#2d %#1s as known? ")
(no-new-conferences . "No new %#2s%#1?b%[ since %#1s%]%[%].\n")
(new-conferences-since . "New %#2s%#1?b%[ since %#1s%]%[%]:\n")
))
......@@ -2199,6 +2211,8 @@ written a presentation.%]
(kom-change-message-flag . "Change reception (of) group messages")
(kom-list-faqs . "List FAQs")
(kom-list-server-faqs . "List server-FAQs")
(kom-list-new-conferences . "List new conferences")
(kom-list-new-persons . "List new users")
))
(lyskom-language-var global lyskom-language-codes en
......
......@@ -556,7 +556,10 @@ All key bindings:
(defvar lyskom-custom-variables-missing '(kom-permanent-filter-list
kom-quit-hook)
kom-quit-hook lyskom-last-known-conf-no
lyskom-last-known-pers-no
kom-presence-messages
kom-dont-complain-about-missing-presentation)
"List of user variables not in lyskom-custom-variables.")
(defvar lyskom-custom-variables
......
......@@ -1326,6 +1326,26 @@ Args: KOM-QUEUE HANDLER SESSION-NO &rest DATA"
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-static-server-info)
(lyskom-send-packet kom-queue (lyskom-format-objects 113)))))
(defun initiate-first-unused-conf-no (kom-queue handler &rest data)
(lyskom-server-call
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-num)
(lyskom-send-packet kom-queue (lyskom-format-objects 114))))
(defun initiate-first-unused-text-no (kom-queue handler &rest data)
(lyskom-server-call
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-num)
(lyskom-send-packet kom-queue (lyskom-format-objects 115))))
(defun initiate-find-next-conf-no (kom-queue handler conf-no &rest data)
(lyskom-server-call
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-num)
(lyskom-send-packet kom-queue (lyskom-format-objects 116 conf-no))))
(defun initiate-find-previous-conf-no (kom-queue handler conf-no &rest data)
(lyskom-server-call
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-num)
(lyskom-send-packet kom-queue (lyskom-format-objects 117 conf-no))))
;;; ================================================================
......
......@@ -1622,10 +1622,18 @@ Inneh
;; Cross-reference stuff
(person . "Person")
(conference . "Mte")
(text . "Inlgg")
(server . "Server")
(Person . "Person")
(person . "person")
(persons . "personer")
(Conference . "Mte")
(conference . "mte")
(conferences . "mten")
(Text . "Inlgg")
(text . "inlgg")
(texts . "inlgg")
(Server . "Server")
(server . "server")
(servers . "servrar")
(xref-type . "Vad vill du referera till (inlgg, mte eller person)? ")
(which-text-to-xref . "Lgg till referens till text nummer: ")
......@@ -1996,6 +2004,10 @@ att upprepas d
(unit-year . "r")
(db-status-backup . "informationsfrlust kan ha frekommit")
(no-support-in-server . "Servern saknar ndvndig funktionalitet fr detta kommando.\n")
(mark-confs-as-known . "Markera dessa %#2d %#1s som knda? ")
(no-new-conferences . "Inga nya %#2s%#1?b%[ sedan %#1s%]%[%].\n")
(new-conferences-since . "Nya %#2s%#1?b%[ sedan %#1s%]%[%]:\n")
))
(lyskom-language-var local lyskom-month-names sv
......@@ -2228,6 +2240,8 @@ att upprepas d
(kom-change-message-flag . "ndra mottagning (av) gruppmeddelanden")
(kom-list-faqs . "Lista FAQ")
(kom-list-server-faqs . "Lista server-FAQ")
(kom-list-new-conferences . "Lista nya mten")
(kom-list-new-persons . "Lista nya personer")
))
(lyskom-language-var local lyskom-language-codes sv
......
......@@ -3013,6 +3013,8 @@ Users are encouraged to use their best sense of humor."
kom-change-message-flag
kom-list-faqs
kom-list-server-faqs
kom-list-new-conferences
kom-list-new-persons
))
;;; ================================================================
......@@ -3858,6 +3860,14 @@ should be dynamically bound whenever it needs to be used.")
"List of invitations that have been rejected."
inherited)
(def-kom-var lyskom-last-known-conf-no nil
"Last known conference number."
server)
(def-kom-var lyskom-last-known-pers-no nil
"Last known conference number."
server)
(defvar lyskom-xface-cache (make-vector 29 0))
......
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