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))
parents)))
(parent-authors (mapcar (lambda (p)
(text-stat->author (blocking-do 'get-text-stat p)))
parents))
(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."
wanted-rcpts)))
(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
text-no
......
......@@ -802,6 +802,19 @@ This is called at login and after prioritize and set-unread."
nil)))
(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
;; (("kom.lysator.liu.se" . "kom.lysator.liu.se")
;; ("LysKOM" . "kom.lysator.liu.se"))
(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)
server)
(setq lyskom-known-servers (lyskom-maybe-frob-completion-table lyskom-known-servers))
(while (null server)
(setq server (lyskom-completing-read (lyskom-format 'server-q)
(lyskom-maybe-frob-completion-table
known-servers)
nil nil
'lyskom-complete-server-name
nil t
(cons (or (getenv "KOMSERVER")
lyskom-default-server
kom-default-server
"") 0))))
(or (cdr (lyskom-string-assoc server known-servers))
(or (cdr (lyskom-string-assoc server lyskom-known-servers))
server)))
......
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