Commit 3b2b455e authored by David Byers's avatar David Byers
Browse files

Fixed bug 818

parent f634a5dc
2007-07-11 <David Byers@GULAG>
Fix bug 818:
* startup.el (lyskom-read-server-name): Use programmed completion.
(lyskom-complete-server-name): Programmed completion function for
server names.
Fix bug 1308:
* commands1.el (lyskom-get-recipients-from-misc-list): Rewrote
ugly code recursive code to pretty pointer manipulating code.
Added optional GET-TYPES argument.
......@@ -4105,9 +4105,6 @@ longer a comment to move-from, but a comment to move-to."
(mapcar (lambda (p)
(lyskom-text-recipients (blocking-do 'get-text-stat p) t))
(parent-authors (mapcar (lambda (p)
(text-stat->author (blocking-do 'get-text-stat p)))
(proposed-rcpts nil))
;; Parent recipients live on in this text
......@@ -4256,6 +4253,7 @@ If TO-TEXT is nil, then just remove TEXT-NO as comment to FROM-TEXT."
(when (and (= 1 (length a))
(= 1 (length b))
(null (cdr (assq (car (car a)) wanted-rcpts)))
(not (eq (car (car a)) (car (car b))))
(j-or-n-p (lyskom-format 'move-conf-as-rcpt-q
......@@ -802,6 +802,19 @@ This is called at login and after prioritize and set-unread."
(defvar lyskom-known-servers)
(defun lyskom-complete-server-name (string pred flag)
"Programmed completion function for lyskom-read-server-name."
(cond ((null flag) ; try-completion
(or (try-completion string lyskom-known-servers) string))
((eq flag 'lambda) ; test-completion
(cond ((assoc string lyskom-known-servers) t)
((try-completion string lyskom-known-servers) nil)
(t t)))
((eq flag 't) ; all-completions
(or (all-completions string lyskom-known-servers)
(list string)))))
(defun lyskom-read-server-name ()
"Read the name of a LysKOM server.
Copmpletion is done on the servers i kom-server-aliases and
......@@ -810,25 +823,26 @@ corresponding address is returned."
;; Create a completion table like
;; (("" . "")
;; ("LysKOM" . ""))
(let ((known-servers
(append (mapcar (function (lambda (pair)
(cons (car pair) (car pair))))
(let ((lyskom-known-servers
(append (mapcar (lambda (pair)
(cons (car pair) (car pair)))
(append kom-server-aliases kom-builtin-server-aliases))
(mapcar (function (lambda (pair)
(cons (cdr pair) (car pair))))
(mapcar (lambda (pair)
(cons (cdr pair) (car pair)))
(append kom-server-aliases kom-builtin-server-aliases))))
(completion-ignore-case t)
(setq lyskom-known-servers (lyskom-maybe-frob-completion-table lyskom-known-servers))
(while (null server)
(setq server (lyskom-completing-read (lyskom-format 'server-q)
nil nil
nil t
(cons (or (getenv "KOMSERVER")
"") 0))))
(or (cdr (lyskom-string-assoc server known-servers))
(or (cdr (lyskom-string-assoc server lyskom-known-servers))
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