Commit e9f5bd10 authored by Johan Sundström's avatar Johan Sundström
Browse files

Various harmonizing and/or news -- se ChangeLog.

parent 90ce05f7
......@@ -149,7 +149,7 @@
(when (lyskom-report-command-answer
(blocking-do 'delete-text text-no))
(when is-marked-by-me
(lyskom-unmark-text text-no nil)))))))
(lyskom-unmark-text text-no)))))))
......@@ -199,13 +199,12 @@ If the current text is comment to (footnote to) several text then the first
text is shown and a REVIEW list is built to shown the other ones. If the
optional arg TEXT-NO is present review the text that text commented instead."
(interactive (list (lyskom-read-text-no-prefix-arg 'review-commented-q)))
(let ((text-no (or text-no lyskom-current-text)))
(if text-no
(progn
(lyskom-tell-internat 'kom-tell-read)
(lyskom-view-commented-text
(blocking-do 'get-text-stat text-no)))
(lyskom-insert-string 'have-to-read))))
(if text-no
(progn
(lyskom-tell-internat 'kom-tell-read)
(lyskom-view-commented-text
(blocking-do 'get-text-stat text-no)))
(lyskom-insert-string 'have-to-read)))
(def-kom-command kom-view-previous-commented-text ()
......@@ -799,15 +798,38 @@ If optional arg TEXT-NO is present write a comment to that text instead."
(def-kom-command kom-write-footnote (&optional text-no)
"Write a footnote to a text.
If optional arg TEXT-NO is present write a footnote to that text instead."
(interactive (list
(lyskom-read-text-no-prefix-arg 'what-footnote-no t
'last-seen-written)))
(interactive)
(let ((text-stat nil))
(setq text-no
(cond ((and (null current-prefix-arg)
lyskom-current-text
(setq text-stat
(blocking-do 'get-text-stat lyskom-current-text))
(eq (text-stat->author text-stat) lyskom-pers-no))
(setq text-no lyskom-current-text))
((and (null current-prefix-arg)
lyskom-last-written
(setq text-stat
(blocking-do 'get-text-stat lyskom-last-written)))
(lyskom-read-number (lyskom-get-string 'what-footnote-no)
lyskom-last-written))
((integerp current-prefix-arg)
current-prefix-arg)
((listp current-prefix-arg)
(lyskom-read-number (lyskom-get-string 'what-footnote-no)
(lyskom-text-at-point)))
(t (signal 'lyskom-internal-error '(kom-write-footnote)))))
(if text-no
(lyskom-write-comment-soon
(blocking-do 'get-text-stat text-no)
(blocking-do 'get-text text-no)
text-no 'footnote)
(lyskom-insert-string 'confusion-what-to-footnote)))
(lyskom-insert-string 'confusion-what-to-footnote))))
(def-kom-command kom-comment-previous ()
......@@ -1561,65 +1583,45 @@ If you are not member in the conference it will be flagged with an asterisk."
;;; Markera och Avmarkera - Mark and Unmark a text
;;; Author: Inge Wallin
;;; [ndrad av: Linus Tolke
;;; Modified by: Linus Tolke, Johan Sundström
(def-kom-command kom-mark-text (text-no-arg)
"Mark a text.
If the argument TEXT-NO-ARG is non-nil, the user has used a prefix
command argument. If kom-defaul-mark is a number it is used as the
mark. If it is nil the user is prompted for the mark to use."
(interactive "P")
(lyskom-mark-text text-no-arg (lyskom-get-string 'text-to-mark)))
(def-kom-command kom-mark-text (&optional text-no)
"Mark the text TEXT-NO."
(interactive (list (lyskom-read-text-no-prefix-arg 'text-to-mark)))
(lyskom-mark-text text-no))
(def-kom-command kom-unmark-text (text-no-arg)
"Unmark a text. If the argument TEXT-NO-ARG is non-nil, the user has used
a prefix command argument."
(interactive "P")
(lyskom-unmark-text text-no-arg (lyskom-get-string 'text-to-unmark)))
(def-kom-command kom-unmark-text (&optional text-no)
"Unmark the text TEXT-NO."
(interactive (list (lyskom-read-text-no-prefix-arg 'text-to-unmark)))
(lyskom-unmark-text text-no))
(defun lyskom-unmark-text (text-no-arg prompt)
"Get the number of the text that is to be marked and do the marking.
Arguments: TEXT-NO-ARG: an argument as it is gotten from (interactive P)
PROMPT: A string that is used when prompting for a number."
(let ((text-no (cond ((integerp text-no-arg) text-no-arg)
((and text-no-arg
(listp text-no-arg))
(car text-no-arg))
(t lyskom-current-text))))
(if prompt
(setq text-no (lyskom-read-number prompt text-no)))
(lyskom-format-insert 'unmarking-textno text-no)
(if (blocking-do 'unmark-text text-no)
(progn
(lyskom-insert-string 'done)
(cache-del-marked-text text-no))
(lyskom-insert-string 'nope)) ;+++ lyskom-errno?
(cache-del-text-stat text-no)))
(defun lyskom-unmark-text (text-no)
"Do the actual unmarking of the text TEXT-NO."
(lyskom-format-insert 'unmarking-textno text-no)
(defun lyskom-mark-text (text-no-arg prompt)
"Get the number of the text that is to be marked and do the marking.
Arguments: TEXT-NO-ARG: an argument as it is gotten from (interactive P)
PROMPT: A string that is used when prompting for a number."
(let ((text-no (cond ((integerp text-no-arg) text-no-arg)
((and text-no-arg
(listp text-no-arg))
(car text-no-arg))
(t lyskom-current-text)))
(mark nil))
(if prompt
(setq text-no (lyskom-read-number prompt text-no)))
(setq mark
(or kom-default-mark (lyskom-read-num-range
0 255 (lyskom-get-string 'what-mark) t)))
(if (blocking-do 'unmark-text text-no)
(progn
(lyskom-insert-string 'done)
(cache-del-marked-text text-no))
(lyskom-insert-string 'nope)) ;+++ lyskom-errno?
(cache-del-text-stat text-no))
(defun lyskom-mark-text (text-no &optional mark)
"Mark TEXT-NO using kom-default-mark (if non-nil) or prompt
the user for what mark to use."
(let ((mark
(or mark
kom-default-mark
(lyskom-read-num-range
0 255 (lyskom-get-string 'what-mark) t))))
(lyskom-format-insert 'marking-textno text-no)
(if (blocking-do 'mark-text text-no mark)
(progn
(lyskom-insert-string 'done)
(lyskom-insert-string 'done)
(cache-add-marked-text text-no mark))
(lyskom-insert-string 'nope)) ;+++ lyskom-errno?
(cache-del-text-stat text-no)))
......
......@@ -2038,7 +2038,7 @@ Return-value: 'no-session if there is no suitable session to switch to
(def-kom-command kom-add-faq (&optional conf-no text-no)
"Add a FAQ to a conference"
(interactive (list (lyskom-read-conf-no 'conf-to-add-faq '(conf) nil nil t)
(lyskom-read-text-no-prefix-arg 'text-to-add-as-faq t 'last-seen-written)))
(lyskom-read-number 'text-to-add-as-faq)))
(let ((text (blocking-do 'get-text-stat text-no)))
(if (null text)
(lyskom-format-insert 'no-such-text-no text-no)
......@@ -2314,3 +2314,32 @@ The variable kom-keep-alive-interval controls the frequency of the request."
(defun lyskom-stop-keep-alive ()
(mapcar 'cancel-timer lyskom-keep-alive-timers)
(setq lyskom-keep-alive-timers nil))
;;; ========================================================================
;;; Check (if Person is a) member (of Conference)
;;; Quickly finds out whether a person is a member of a given conference
;;; Author: Johan Sundstrm
(def-kom-command kom-is-person-member-of-conference
(&optional pers-no &optional conf-no)
"Find out whether PERS-NO is a member of conference CONF-NO."
(interactive)
(let* ((pers-no
(or conf-no
(lyskom-read-conf-no (lyskom-get-string 'pers-to-check-mship-for)
'(all) nil nil t)))
(conf-no
(or conf-no
(lyskom-read-conf-no (lyskom-get-string 'conf-to-check-mship-of)
'(all) nil nil t)))
(member-list (blocking-do 'get-members conf-no 0 lyskom-max-int)))
(if (null member-list)
(lyskom-format-insert 'conf-is-empty conf-no)
(or (lyskom-traverse member (member-list->members member-list)
(when (= pers-no (member->pers-no member))
(lyskom-format-insert 'pers-is-member-of-conf pers-no conf-no)
(lyskom-traverse-break t)))
(lyskom-format-insert 'pers-is-not-member-of-conf pers-no conf-no)))))
......@@ -479,6 +479,13 @@ Read all about it at http://www.lysator.liu.se/history/")
(who-is-on-in-what-conference . "Who in which conference: ")
(who-is-active-and-member . "Only members in %#1M are shown.\n")
;; Used for kom-is-person-member-of-conference:
(pers-to-check-mship-for . "Whom whose membership do you want to check? ") ;-)
(conf-to-check-mship-of . "...for what conference? ")
(conf-is-empty . "The conference %#1M is empty.\n")
(pers-is-member-of-conf . "Yes, %#1P is a member of the conference %#2M.\n")
(pers-is-not-member-of-conf . "No, %#1P is not a member of the conference %#2M.\n")
; From commands2.el:
(your-memberships . "Your LysKOM conference memberships:\n")
......@@ -1552,6 +1559,8 @@ You must become an active member of the conference to enter it.\n")
(kom-keep-alive . "Keep connection alive")
(kom-stop-keep-alive . "Stop keeping connection alive")
(kom-is-person-member-of-conference . "Check (if Person is a) member (of Conference)")
))
(lyskom-language-var lyskom-language-codes en
......
......@@ -595,7 +595,7 @@ This is a LysKOM button action."
(progn
(pop-to-buffer buf)
(lyskom-start-of-command 'kom-mark-text)
(lyskom-mark-text arg nil))
(lyskom-mark-text arg))
(lyskom-end-of-command)))))
(defun lyskom-button-unmark-text (buf arg text)
......@@ -606,7 +606,7 @@ This is a LysKOM button action."
(progn
(pop-to-buffer buf)
(lyskom-start-of-command 'kom-unmark-text)
(lyskom-unmark-text arg nil))
(lyskom-unmark-text arg))
(lyskom-end-of-command)))))
......
......@@ -661,6 +661,12 @@ M
(not-logged-in . "Du r inte inloggad. ")
;; Used for kom-is-person-member-of-conference:
(pers-to-check-mship-for . "Vem vars medlemskap vill du underska? ") ;-)
(conf-to-check-mship-of . "...i vilket mte? ")
(conf-is-empty . "Mtet %#1M r tomt.\n")
(pers-is-member-of-conf . "Ja, %#1P r medlem i mtet %#2M.\n")
(pers-is-not-member-of-conf . "Nej, %#1P r inte medlem i mtet %#2M.\n")
;; +++ cant seem to find where these are used:
(name-is-not-in-conf . "%#1s r inte nrvarande i ngot mte.\n")
......@@ -1562,6 +1568,8 @@ Du m
(kom-keep-alive . "Hll frbindelsen aktiv")
(kom-stop-keep-alive . "Avbryt hll frbindelsen aktiv")
(kom-is-person-member-of-conference . "Kontrollera (om Person r) medlem (i Mte)")
))
(lyskom-language-var lyskom-language-codes sv
......
......@@ -1268,6 +1268,8 @@ Users are encouraged to use their best sense of humor."
kom-keep-alive
kom-stop-keep-alive
kom-is-person-member-of-conference
))
;;; ================================================================
......@@ -1692,13 +1694,6 @@ This is used by the command kom-busy-wait."
"Text-no of last text written. nil means no text written."
local)
(def-kom-var lyskom-last-seen-written nil
"Text-no of last text read or written by the current user.
When a new text is written, this is set to the text number of that text.
When a text is read that was written by the current user, this is
set to that text."
local)
(def-kom-var lyskom-previous-text nil
"Text-no of previous text. Nil means no text."
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