Commit 2663602c authored by David Kågedal's avatar David Kågedal
Browse files

Diverse fixar.

parent 0ab5760e
No preview for this file type
......@@ -373,8 +373,7 @@ Returns t if it was possible, otherwise nil."
;; The conference is protected. Tell the user to contact
(let ((supervisorconf (blocking-do
'get-conf-stat
(conf-stat->supervisor conf-conf-stat)
conf-conf-stat)))
(conf-stat->supervisor conf-conf-stat))))
(if supervisorconf
(lyskom-format-insert 'is-read-protected-contact-supervisor
conf-conf-stat
......
......@@ -1319,23 +1319,24 @@ current conference to another session."
"Change type of a conference"
(interactive)
(lyskom-start-of-command 'kom-change-conf-type)
(let* ((conf-no (lyskom-read-conf-no
(lyskom-get-string 'what-conf-to-change)
'conf nil ""))
(open (j-or-n-p (lyskom-get-string 'anyone-member)))
(secret (if (not open) (j-or-n-p (lyskom-get-string 'secret-conf))))
(orig (j-or-n-p (lyskom-get-string 'comments-allowed))))
(cache-del-conf-stat conf-no)
(if (not (blocking-do 'set-conf-type
conf-no
(lyskom-create-conf-type (not open)
(not orig)
secret
nil)))
(progn (lyskom-insert-string 'nope)
(lyskom-format-insert 'error-code
(lyskom-get-error-text lyskom-errno)
lyskom-errno))))
(lyskom-end-of-command))
(unwind-protect
(let* ((conf-no (lyskom-read-conf-no
(lyskom-get-string 'what-conf-to-change)
'confs nil ""))
(open (j-or-n-p (lyskom-get-string 'anyone-member)))
(secret (if (not open) (j-or-n-p (lyskom-get-string 'secret-conf))))
(orig (j-or-n-p (lyskom-get-string 'comments-allowed))))
(cache-del-conf-stat conf-no)
(if (not (blocking-do 'set-conf-type
conf-no
(lyskom-create-conf-type (not open)
(not orig)
secret
nil)))
(progn (lyskom-insert-string 'nope)
(lyskom-format-insert 'error-code
(lyskom-get-error-text lyskom-errno)
lyskom-errno))))
(lyskom-end-of-command)))
......@@ -150,6 +150,11 @@ Logins is a list of conf-nos (only significant when PREDICATE is logins)."
(memq (conf-stat->conf-no cs) logins))))
;; +++ Where should this be put?
(defsubst listify-vector (vector)
"Turn VECTOR into a list"
(append vector nil))
(defun lyskom-read-conf-name-internal (string predicate all)
"The \"try-completion\" for the lyskom-read name.
STRING is the string to be matched.
......@@ -166,10 +171,10 @@ to conf-no translator."
(eq predicate 'logins)))
(list (if (not alllogins)
(blocking-do 'lookup-name string)))
(nos (append (conf-list->conf-nos list) nil))
(nos (listify-vector (conf-list->conf-nos list)))
(parlist (if (memq predicate '(pers confs))
(let ((nos nos)
(typs (append (conf-list->conf-types list) nil))
(typs (listify-vector (conf-list->conf-types list)))
res)
(while nos
(setq res (cons (cons (car nos) (car typs)) res))
......@@ -180,7 +185,7 @@ to conf-no translator."
(mapcar
(function (lambda (ele)
(who-info->pers-no ele)))
(append (blocking-do 'who-is-on) nil))))
(listify-vector (blocking-do 'who-is-on)))))
(mappedlist (cond
(alllogins
logins)
......@@ -276,8 +281,6 @@ to conf-no translator."
(cons string names)
names)))
((= (length mappedlist) 1)
t)
((= (length mappedlist) 0)
(if (string-match (lyskom-get-string 'person-or-conf-no-regexp)
string)
......@@ -289,13 +292,16 @@ to conf-no translator."
cs predicate logins)
t))))
(t ; No exact match
(lyskom-try-complete-partials
string
(mapcar (function (lambda (no)
(list (conf-stat->name
(blocking-do 'get-conf-stat no)))))
mappedlist))))))
(t ; Some matches, maybe exact?
(let ((strings (mapcar (function
(lambda (no)
(list (conf-stat->name
(blocking-do 'get-conf-stat no)))))
mappedlist)))
(if (and (= (length strings) 1)
(string= string (car (car strings))))
t ; Exact
(lyskom-try-complete-partials string strings)))))))
(defun lyskom-try-complete-partials (string alist)
......
......@@ -445,30 +445,13 @@ Entry to this mode runs lyskom-edit-mode-hook."
(let ((p (point)))
(save-excursion
(let* ((buffer (current-buffer))
(endhead (progn
(goto-char (point-min))
(or (re-search-forward
(regexp-quote
(if kom-emacs-knows-iso-8859-1
lyskom-header-separator
lyskom-swascii-header-separator))
nil t)
(re-search-forward
(regexp-quote
(if kom-emacs-knows-iso-8859-1
lyskom-swascii-header-separator
lyskom-header-separator))))
(point)))
(found (progn
(goto-char (point-min))
(or (re-search-forward "^K[^0-9]*\\([0-9]+\\)" endhead
t)
(re-search-forward "^Fot[^0-9]*\\([0-9]+\\)" endhead
t))))
(no (and found
(string-to-int (buffer-substring
(match-beginning 1)
(match-end 1))))))
(headers (cdr (lyskom-edit-parse-headers)))
(no nil))
(while headers
(if (or (eq (car headers) 'comm-to)
(eq (car headers) 'footn-to))
(setq no (car (cdr headers))
headers nil)))
(cond
(no
(goto-char p)
......
......@@ -194,7 +194,7 @@ Email-address:\n\nOther:\t")
(no-comment-to . "There is no commented article.\n")
(who-letter-to . "Send a letter to whom: ")
(has-motd . "%#1s has a note on the door:\n\n")
(has-motd . "%#1P has a note on the door:\n\n")
(motd-persist-q . "Send the letter? ")
(who-to-add . "Whom do you want to add: ")
......@@ -855,7 +855,7 @@ Error message: %#1s**************************************************")
(kom-filter-text "Filter contents")
(kom-list-filters "List filters")
(kom-show-user-area "Show user area")
(kom-change-conference-type "Change conference type")
(kom-change-conf-type "Change conference type")
)
"A list of LysKOM-commands recognized by the extended parser.")
......
......@@ -812,21 +812,21 @@ TYPE is one of RECPT, CC-RECPT COMM-TO COMM-IN FOOTN-TO or FOOTN-IN."
;;; Constructor:
(defsubst lyskom-create-privs (wheel
admin
statistic
create_pers
create_conf
change_name
flg7
flg8
flg9
flg10
flg11
flg12
flg13
flg14
flg15
flg16)
admin
statistic
create_pers
create_conf
change_name
flg7
flg8
flg9
flg10
flg11
flg12
flg13
flg14
flg15
flg16)
"Create a privs from all parameters."
(cons
'PRIVS
......
No preview for this file type
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