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

Bug fixes. Membership type checks. Unsubscribe changes

parent 483a45f5
......@@ -23,6 +23,14 @@ tar-arkivet.
* Fitjurs, förbättringar och andra förändringar
** När man går ur ett möte blir man först passiv medlem. För att gå ur
mötet på riktigt så måste man upprepa utträdet. Detta beteende går
att styra med variabeln kom-unsubscribe-makes-passive.
** Elispklienten är lite mer Gnus-kompatibel. Om man råkar köra XEmacs
och kom-smileys är satt, så kommer gladmän att visas som små
bilder.
** Stöd för tilläggsinformation på inlägg och möten. Se nedan.
** Lista markeringar ger en lista av alla markerade inlägg.
......@@ -91,10 +99,6 @@ LysKOM-bufferten och i inl
** Tilläggsinformation i LysKOM-bufferten
*** Sätt personlig etikett sätter en personlig etikett på ett möte, en
person eller ett inlägg. Denna etikett visas oftast istället för
person- eller mötesnamnet eller inläggets ärenderad.
*** Efter tilläggsinformation visas en liten knapp "[*]". Om man
klickar på den så visas full information om tillägget.
......
1999-06-21 David Byers <davby@ida.liu.se>
* commands1.el (lyskom-sub-member): Become passive member the
first unsubscribe and really unsubscribe on the second try.
Better handling of membership types.
* lyskom-rest.el (lyskom-check-go-to-conf): New function to check
if it is OK to go to a conference. Offer to activate passive
memberships. Offer to accept invitations. Warn about secret
memberships.
1999-06-20 David Byers <davby@anton9.ida.liu.se>
* Release av 0.46-BETA-1
......
......@@ -7,6 +7,16 @@ Att g
listan, glöm inte att ta bort det från listan!
Kommandon: begär bekräftelse, endast personliga kommentarer, inga
kommentarer. Se inlägg 4089678.
lyskom-get-texts-to är buggig. Om man återser senaste N av vem som
helst till ett möte och det inte finns N texter så buggar den ur. Den
borde klippa till max texter i mötet.
Använd face-flag i lyskom-format-aux för att bestämma om man skall
visa faces eller inte. Kolla att
......
......@@ -395,7 +395,8 @@
""))
(defun lyskom-print-request-confirmation (item &optional obj)
(concat (lyskom-format 'request-confirmation-aux)
(concat (lyskom-format 'request-confirmation-aux
(aux-item->creator item))
(lyskom-aux-item-terminating-button item obj)))
(defun lyskom-edit-insert-request-confirmation (item &optional obj)
......@@ -409,21 +410,22 @@
(setq have-confirmation t)
(setq confirmations nil))
(setq confirmations (cdr confirmations)))
(when (and (not have-confirmation)
(lyskom-j-or-n-p
(lyskom-format (lyskom-get-string 'confirm-read-q)
text-stat)))
(let ((item (lyskom-create-aux-item 0 7 lyskom-pers-no
nil
(lyskom-create-aux-item-flags
nil nil nil nil nil nil nil nil)
0 "")))
(initiate-modify-text-info 'background
nil
(text-stat->text-no text-stat)
nil
(list item))
(cache-del-text-stat (text-stat->text-no text-stat))))))
(when (not have-confirmation)
(lyskom-scroll)
(when (lyskom-j-or-n-p
(lyskom-format (lyskom-get-string 'confirm-read-q)
text-stat))
(let ((item (lyskom-create-aux-item 0 7 lyskom-pers-no
nil
(lyskom-create-aux-item-flags
nil nil nil nil nil nil nil nil)
0 "")))
(initiate-modify-text-info 'background
nil
(text-stat->text-no text-stat)
nil
(list item))
(cache-del-text-stat (text-stat->text-no text-stat)))))))
(defun lyskom-print-read-confirm (item &optional obj)
(concat
......
......@@ -11,11 +11,6 @@
;;;;
;;;; or by M-x lyskom-check-strings
;;;;
;;;; TODO:
;;;; Check that all -tag and -doc strings correspond to an existing variable
;;;; Check that all server-local variables have -tag and -doc strings.
;;;; Check that all server-local variables are in the settings buffer
;;;; Check that all server-local variables have a widget definition
;;;;
(require 'lyskom)
......@@ -43,6 +38,9 @@
'lyskom-mode-map)
(mapcar 'lcs-check-category lyskom-language-categories)
(lcs-message t "Checking customizeable variables")
(lcs-check-customize-variables)
(or noninteractive
(display-buffer lcs-message-buffer)))
......@@ -187,6 +185,50 @@ STRING is the string."
(setq flist (delete (car flist) flist))))
(and result (null template))))
(defun lcs-check-customize-variables ()
"Check customize variables.
Check that all customizeable variables are server-stored.
Check that all server-stored variables are customizeable."
(let ((cust-vars-in-buffer
(delq nil (mapcar (lambda (el) (when (vectorp el) (elt el 0)))
lyskom-customize-buffer-format)))
(cust-vars-widgets (mapcar 'car lyskom-custom-variables))
(cust-vars-all (append lyskom-elisp-variables
lyskom-global-boolean-variables
lyskom-global-non-boolean-variables)))
(mapcar
(lambda (var)
(cond ((not (memq var cust-vars-widgets))
(lcs-message nil "(%s:%s) No widget definition for variable."
'lyskom-custom-variables var))
((not (memq var cust-vars-in-buffer))
(lcs-message nil "(%s:%s) Variable not in customize buffer."
'lyskom-customize-buffer-format var))
(t (unless (lyskom-get-string-internal
(intern (format "%s-tag" var))
'lyskom-custom-strings)
(lcs-message nil "(%s:%s) No tag string"
'lyskom-custom-strings var))
(unless (lyskom-get-string-internal
(intern (format "%s-doc" var))
'lyskom-custom-strings)
(lcs-message nil "(%s:%s) No doc string"
'lyskom-custom-strings var))))
(setq cust-vars-in-buffer (delq var cust-vars-in-buffer))
(setq cust-vars-widgets (delq var cust-vars-widgets))
nil)
cust-vars-all)
(mapcar (lambda (var)
(lcs-message nil "(%s:%s) Not a server-stored variable."
'lyskom-custom-variables var))
cust-vars-widgets)
(mapcar (lambda (var)
(lcs-message nil "(%s:%s) Not a server-stored variable."
'lyskom-custom-variables var))
cust-vars-in-buffer)))
(defun lcs-setup-message-buffer ()
"Inititalize the message buffer for string checking."
(save-excursion
......
......@@ -522,10 +522,38 @@ of the person."
(defun lyskom-sub-member (pers conf)
"Remove the person indicated by PERS as a member of CONF."
(let ((reply nil)
(self (= (conf-stat->conf-no pers) lyskom-pers-no)))
(let* ((reply nil)
(self (= (conf-stat->conf-no pers) lyskom-pers-no))
(mship (and self
kom-unsubscribe-makes-passive
(lyskom-get-membership (conf-stat->conf-no conf))))
(passivate (and mship
(not (membership-type->passive
(membership->type mship))))))
(cond ((null pers) (lyskom-insert-string 'error-fetching-person))
((null conf) (lyskom-insert-string 'error-fetching-conf))
(passivate
(lyskom-format-insert 'unsubscribe-to conf)
(set-membership-type->passive (membership->type mship) t)
(setq reply (blocking-do 'set-membership-type
(conf-stat->conf-no pers)
(conf-stat->conf-no conf)
(membership->type mship)))
(if (not reply)
(lyskom-format-insert 'unsubscribe-failed
(lyskom-get-string 'You)
conf)
(lyskom-insert-string 'done)
(lyskom-format-insert 'passivate-done conf)
(if (= (conf-stat->conf-no conf) lyskom-current-conf)
(progn
(set-read-list-empty lyskom-reading-list)
(lyskom-run-hook-with-args 'lyskom-change-conf-hook
lyskom-current-conf 0)
(setq lyskom-current-conf 0)))
(read-list-delete-read-info (conf-stat->conf-no conf)
lyskom-to-do-list)))
(t
(if self
(lyskom-format-insert 'unsubscribe-to conf)
......@@ -543,7 +571,7 @@ of the person."
(if self
(lyskom-get-string 'You)
(conf-stat->name pers))
(conf-stat->name conf))
conf)
(lyskom-insert-string 'done)
(if (and self
(= (conf-stat->conf-no conf)
......@@ -1153,7 +1181,8 @@ back on lyskom-to-do-list."
(lyskom-read-conf-stat
(lyskom-get-string 'go-to-conf-p)
'(all) nil "" t))))
(lyskom-go-to-conf conf)))
(when (lyskom-check-go-to-conf conf)
(lyskom-go-to-conf conf))))
(defun lyskom-go-to-conf (conf)
......@@ -1222,13 +1251,13 @@ Args: CONF-STAT MEMBERSHIP"
(++ r)))
(cond (found
(let ((read-info (read-list->nth lyskom-to-do-list r)))
(read-list-enter-first read-info lyskom-reading-list)
(read-list-delete-read-info (conf-stat->conf-no conf-stat)
lyskom-to-do-list)
(read-list-enter-first read-info lyskom-to-do-list)
(set-read-info->priority read-info priority)
(lyskom-enter-conf conf-stat read-info)))
(let ((read-info (read-list->nth lyskom-to-do-list r)))
(read-list-enter-first read-info lyskom-reading-list)
(read-list-delete-read-info (conf-stat->conf-no conf-stat)
lyskom-to-do-list)
(read-list-enter-first read-info lyskom-to-do-list)
(set-read-info->priority read-info priority)
(lyskom-enter-conf conf-stat read-info)))
(t
(lyskom-go-to-empty-conf conf-stat))))))
......@@ -1404,8 +1433,10 @@ If you are not member in the conference it will be flagged with an asterisk."
(setq name (lyskom-read-string (lyskom-get-string 'new-name)
(conf-stat->name conf-stat)))
(if (blocking-do 'change-name (conf-stat->conf-no conf-stat) name)
(lyskom-format-insert 'change-name-done name
(lyskom-default-button 'conf conf-stat))
(progn
(lyskom-format-insert 'change-name-done name
(lyskom-default-button 'conf conf-stat))
(cache-del-conf-stat (conf-stat->conf-no conf-stat)))
(lyskom-format-insert 'change-name-nope name
(lyskom-get-error-text lyskom-errno)
lyskom-errno))))))
......@@ -1430,8 +1461,10 @@ If you are not member in the conference it will be flagged with an asterisk."
old-paren))
(name (concat non-paren "(" paren ")")))
(if (blocking-do 'change-name (conf-stat->conf-no conf-stat) name)
(lyskom-format-insert 'change-name-done name
(lyskom-default-button 'conf conf-stat))
(progn
(lyskom-format-insert 'change-name-done name
(lyskom-default-button 'conf conf-stat))
(cache-del-conf-stat (conf-stat->conf-no conf-stat)))
(lyskom-format-insert 'change-name-nope name
(lyskom-get-error-text lyskom-errno)
lyskom-errno)))
......
......@@ -84,6 +84,7 @@ SOURCES = $(LANGUAGE-EL) \
lyskom-rest.el
HEADER = defvar.el \
feature.el \
vars.el \
macros.el \
compatibility.el \
......
......@@ -43,18 +43,13 @@
You need an Emacs. The client appears to work with the following
versions of Emacs:
* XEmacs version 20.2
* XEmacs version 20.2 and 21.2
* Gnu Emacs version 19.34 [1]
* Gnu Emacs version 20.1 [2]
* Gnu Emacs version 20.3 and 20.4
[1] You'll have to replace the included custom package, and if you
use Gnus, you may have to update that as well.
[2] Multibyte characters are not, and will not be, supported.
If you notice a case where something doesn't work, or Emacs
complains about "Not on a character boundary", please let us
know about it.
You need to have a recent version of the custom package installed.
The custom.el file that is bundled with Gnu Emacs 19.34 and older
versions of Gnus will not work.
......@@ -70,6 +65,12 @@
package, it's time to upgrade. The latest version of Gnus is
available from <URL:http://www.gnus.org/>.
MAKE SURE YOU DO NOT HAVE a file called macedit.el early in your
load path. This file redefines a function that the client relies
heavly on. The redefinition is buggy. You can recognize this
problem if your Emacs says something like this: "Key sequence < m
o u s e - 2 > uses invalid prefix characters"
2. What should I have
......
......@@ -1151,7 +1151,7 @@ On since %#8s%#9s")
(personal-comment-edit-aux . "Request private replies only")
(personal-comment-regexp . "Request private replies only")
(request-confirmation-aux . "The author requests confirmation of reading")
(request-confirmation-aux . "%#1P requests confirmation of reading")
(request-confirmation-edit-aux . "Request confirmation of reading")
(request-confirmation-regexp . "Request confirmation of reading")
(confirm-read-q . "Confirm reading article %#1n? ")
......@@ -1216,9 +1216,15 @@ Contents: \"%#9s\"
(no-comments-q . "Author requestes no comments. Comment anyway? ")
(private-answer-q . "Author requests private replies. Write private reply? ")
(your-invited . "You have been invited to %#1M by %#2P.\n")
(your-invited . "You have been invited to %#1M by %#2P.
By accepting the invitation you will continue to be a member of %#1M.
If you decline the invitation you will not be a member of the conference.
")
(accept-invitation . "Do you want to accept the invitation now? ")
(enter-passive . "You are a passive member of %#1M.\n")
(decline-invitation . "You are no longer a member of %#1M\n")
(enter-passive . "You are a passive member of %#1M.
You must become an active member of the conference to enter it.\n")
(convert-passive . "Vill du bli aktiv medlem i %#1M? ")
(invitation-mt-type . "invited")
(passive-mt-type . "passive")
......
......@@ -247,7 +247,8 @@ If there is no active area, then do something else."
"Do a keyboard menu selection."
(let ((prompt nil)
(maxlen 0)
(e entries))
(e entries)
(completion-ignore-case t))
(while e
(if (> (length (car (car e))) maxlen)
(setq maxlen (length (car (car e)))))
......
......@@ -436,8 +436,9 @@ Take first conf from lyskom-to-do-list and copy it to lyskom-reading-list.
Tell server what the user is doing. If the user is reading a conf it is
moved last on lyskom-to-do-list, with priority 0."
(interactive)
(lyskom-maybe-move-unread t)
(lyskom-go-to-next-conf))
(when (lyskom-check-go-to-conf)
(lyskom-maybe-move-unread t)
(lyskom-go-to-next-conf)))
(defun lyskom-go-to-pri-conf ()
......@@ -445,35 +446,32 @@ moved last on lyskom-to-do-list, with priority 0."
This differs from kom-go-to-next-conf only in the place where the yet unread
in the current conf is placed."
(lyskom-start-of-command 'kom-go-to-next-conf)
(lyskom-maybe-move-unread nil)
(lyskom-go-to-next-conf)
(lyskom-end-of-command))
(when (lyskom-check-go-to-conf)
(lyskom-maybe-move-unread nil)
(lyskom-go-to-next-conf)
(lyskom-end-of-command)))
(defun lyskom-go-to-next-conf ()
"Actually go to the next conference on the lyskom-to-do-list"
;; Copy first element on lyskom-to-do-list to lyskom-reading-list.
(if (not (read-list-isempty lyskom-to-do-list))
(progn
(read-list-enter-first
(read-list->first lyskom-to-do-list)
lyskom-reading-list)
;; Tell server which conf the user is reading.
(let ((conf-stat (read-info->conf-stat
(read-list->first lyskom-reading-list))))
(when conf-stat
(lyskom-enter-conf
conf-stat
(read-list->first lyskom-reading-list))
(lyskom-set-mode-line conf-stat))))
(let ((conf-stat (read-info->conf-stat
(read-list->first lyskom-to-do-list))))
(when conf-stat
(lyskom-set-mode-line conf-stat)
(read-list-enter-first
(read-list->first lyskom-to-do-list)
lyskom-reading-list)
(lyskom-enter-conf conf-stat
(read-list->first lyskom-to-do-list))))
(lyskom-insert-string 'all-conf-unread-r)
(lyskom-set-mode-line (lyskom-get-string 'all-conf-unread-s))))
(defun lyskom-maybe-move-unread (bury)
"Empty the reading list.
If the argument BURY is non-nil and there are unread artilces left in the
If the argument BURY is non-nil and there are unread articles left in the
reading list then the conf is inserted last in the to do list."
(if (not (read-list-isempty lyskom-reading-list))
(progn
......@@ -499,38 +497,72 @@ reading list then the conf is inserted last in the to do list."
(set-read-list-empty lyskom-reading-list))))
(defun lyskom-check-go-to-conf (&optional conf)
"Check if it is OK to go to conf CONF (a conf-stat).
It is assumed that lyskom-pers-no is a member of the conference.
This function interacts with the buffer and the user.
If CONF is nil, check the first conf on the to-do list."
(let* ((conf-stat (or conf
(read-info->conf-stat
(read-list->first lyskom-to-do-list))))
(mship (and conf-stat
(lyskom-get-membership (conf-stat->conf-no conf-stat))))
(type nil)
(continue t))
(when (and conf-stat mship)
(setq type (membership->type mship))
(when (membership-type->invitation type)
;;; State the invitation,give the user a chance to accept it
;;; Leave the conf if the user does not want it
(lyskom-format-insert 'your-invited
conf-stat
(membership->created-by mship))
(if (lyskom-j-or-n-p (lyskom-get-string 'accept-invitation))
(progn
(set-membership-type->invitation type nil)
(initiate-set-membership-type 'main
nil
lyskom-pers-no
(conf-stat->conf-no conf-stat)
(membership->type mship))
(setq continue t))
(progn
(lyskom-sub-member (blocking-do 'get-pers-stat lyskom-pers-no)
conf-stat)
(setq continue nil)
)))
(when (membership-type->secret type)
(lyskom-format-insert-before-prompt 'bug-secret-mship conf-stat))
(when (membership-type->passive type)
;;; Offer the user a chance to become an active member
;;; If the offer is refused, boot the user off the conference
(lyskom-format-insert 'enter-passive conf-stat)
(setq continue nil)
(if (lyskom-j-or-n-p (lyskom-format 'convert-passive conf-stat))
(progn
(set-membership-type->passive type nil)
(initiate-set-membership-type 'main
nil
lyskom-pers-no
(conf-stat->conf-no conf-stat)
(membership->type mship))
(setq continue t))
(progn
(setq continue nil))))
)
;;; Return the result
continue))
(defun lyskom-enter-conf (conf-stat read-info)
"Tell server which conf the user is reading.
Prints the name and amount of unread in the conference we just went to
according to the value of kom-print-number-of-unread-on-entrance.
Args: CONF-STAT READ-INFO"
;;
;; Deal with special membership types
;;
(let ((mship (lyskom-get-membership (conf-stat->conf-no conf-stat))))
(when mship
;; Check for invitation
(when (membership-type->invitation (membership->type mship))
(lyskom-format-insert 'your-invited
conf-stat
(membership->created-by mship))
(when (lyskom-j-or-n-p (lyskom-get-string 'accept-invitation))
(set-membership-type->invitation (membership->type mship)
nil)
(initiate-set-membership-type
'main
nil
lyskom-pers-no
(conf-stat->conf-no conf-stat)
(membership->type mship))))
;; Check for going to passive membership
(when (membership-type->passive (membership->type mship))
(lyskom-format-insert 'enter-passive conf-stat))))
(lyskom-run-hook-with-args 'lyskom-change-conf-hook
lyskom-current-conf
(conf-stat->conf-no conf-stat))
......@@ -538,13 +570,12 @@ Args: CONF-STAT READ-INFO"
(setq lyskom-current-conf (conf-stat->conf-no conf-stat))
(let ((num-unread (text-list->length (read-info->text-list read-info))))
(lyskom-format-insert (if (not kom-print-number-of-unread-on-entrance)
'enter-conf
(if (= num-unread 1)
'one-unread
'several-unread))
conf-stat
num-unread)))
'enter-conf
(if (= num-unread 1)
'one-unread
'several-unread))
conf-stat
num-unread)))
......
......@@ -135,21 +135,23 @@ Value returned is always nil."
"Decrement the variable VAR and return the value."
(list 'setq var (list '1- var)))
(if (fboundp 'when)
nil
(defmacro when (expr &rest body)
"Execute BODY if EXPR evaluates to non-nil"
(list 'if expr (cons 'progn body)))
(put 'when lisp-indent-function 1)
(put 'when 'edebug-form-spec t))
(if (fboundp 'unless)
nil
(defmacro unless (expr &rest body)
"Execute BODY if EXPR evaluates to non-nil"
(append (list 'if expr nil) body))
(put 'unless lisp-indent-function 1)
(put 'unless 'edebug-form-spec t))
(eval-and-compile
(if (fboundp 'when)
nil
(defmacro when (expr &rest body)
"Execute BODY if EXPR evaluates to non-nil"
(list 'if expr (cons 'progn body)))
(put 'when lisp-indent-function 1)
(put 'when 'edebug-form-spec t)))
(eval-and-compile
(if (fboundp 'unless)
nil
(defmacro unless (expr &rest body)
"Execute BODY if EXPR evaluates to non-nil"
(append (list 'if expr nil) body))
(put 'unless lisp-indent-function 1)
(put 'unless 'edebug-form-spec t)))
;;; ======================================================================
......
......@@ -345,6 +345,7 @@ du har l
(exclude-from . "Utesluta %#1P frn %#2M...")
(unsubscribe-failed . "\nDet gick inte. %#1P var kanske aldrig medlem i %#2M?\n")
(passivate-done . "Du r nu passiv medlem i %#1M.\n")
(You . "Du")
(could-not-create-conf . "Mtet \"%#1s\" kunde ej skapas.\n")
......@@ -1167,7 +1168,7 @@ Uppkopplad sedan %#8s%#9s")
(personal-comment-edit-aux . "Begr endast personliga svar")
(personal-comment-regexp . "Begr endast personliga svar")
(request-confirmation-aux . "Frfattaren har begrt lsbekrftelse")
(request-confirmation-aux . "%#1P har begrt lsbekrftelse")
(request-confirmation-edit-aux . "Begr bekrftelse om lsning")
(request-confirmation-regexp . "Begr bekrftelse om lsning")
(confirm-read-q . "Bekrfta lsning av inlgg %#1n? ")
......@@ -1231,9 +1232,16 @@ Inneh
(no-comments-q . "Frfattaren vill inte ha kommentarer. Kommentera nd? ")
(private-answer-q . "Frfattaren har bett om personliga svar. Skriv personligt svar? ")
(your-invited . "Du har bjudits in till %#1M av %#2P.\n")
(accept-invitation . "Vill du acceptera inbjudan nu? ")
(enter-passive . "Du r passiv medlem i %#1M.\n")
(your-invited . "%#2P har bjudit in dig till %#1M.
Genom att acceptera inbjudan fortstter du vara medlem i %#1M.
Du kan ven tacka nej, och d kommer du automatiskt att g ur mtet.
")
(accept-invitation . "Vill du acceptera inbjudan och fortstta vara medlem? ")
(enter-passive . "Du r passiv medlem i %#1M.
Du mste bli aktiv medlem fr att g till mtet.\n")
(convert-passive . "Vill du bli aktiv medlem i %#1M? ")
(bug-secret-mship . "Du r hemlig medlem i %#1M\n")
(invitation-mt-type . "inbjuden")
(passive-mt-type . "passiv")
......@@ -1255,7 +1263,7 @@ Inneh
(kom-slow-mode . "Lngsamma kommandon")
(kom-quick-mode . "Snabba kommandon")