Commit 75b45810 authored by David Byers's avatar David Byers
Browse files

Fix lossage when there is no default server.

Detailed changes:
> 	Fix ugliness when default server is unset:
> 	* startup.el (lyskom): New calling conventions for
> 	lyskom-read-server-name.
> 	(lyskom-read-server-name): New parameter list. Do not accept empty
> 	input. Use initial value and magic minibuffer instead of default
> 	value.
>
parent e1a17fd9
2005-02-14 David Byers <byers@lysator.liu.se>
Fix ugliness when default server is unset:
* startup.el (lyskom): New calling conventions for
lyskom-read-server-name.
(lyskom-read-server-name): New parameter list. Do not accept empty
input. Use initial value and magic minibuffer instead of default
value.
Fix bug 1511:
* commands1.el (lyskom-combine-username): Downcase hostnames.
......
......@@ -157,7 +157,7 @@
; From komtypes.el: nil
; From clienttypes.el: nil
; From startup.el:
(server-q . "LysKOM server? (%#1s) ")
(server-q . "LysKOM server? ")
(try-connect . "LysKOM elisp client version %#1s.\nAttempting to connect to %#2s.\n")
(too-old-server . "The server is too old for this version of the client.")
(connection-done . "Connection established. Server version is %#1s.\n\n")
......
......@@ -79,11 +79,7 @@ Optional arguments: HOST, USERNAME, PASSWORD and INVISIBLEP.
A numeric prefix argument sets the session priority. A prefix argument
of `C-u', on the other hand, logs in the session without notifying other
clients of the event. See lyskom-mode for details on lyskom."
(interactive (list (lyskom-read-server-name
(lyskom-format 'server-q
(or (getenv "KOMSERVER")
lyskom-default-server
kom-default-server)))
(interactive (list (lyskom-read-server-name)
nil
nil
(if current-prefix-arg
......@@ -790,7 +786,7 @@ This is called at login and after prioritize and set-unread."
nil)))
(defun lyskom-read-server-name (prompt)
(defun lyskom-read-server-name ()
"Read the name of a LysKOM server.
Copmpletion is done on the servers i kom-server-aliases and
kom-builtin-server-aliases. If an alias name is entered, the
......@@ -807,13 +803,18 @@ corresponding address is returned."
(append kom-server-aliases kom-builtin-server-aliases))))
(completion-ignore-case t)
server)
(setq server (lyskom-completing-read prompt
(lyskom-maybe-frob-completion-table
known-servers)
nil nil))
(while (null server)
(setq server (lyskom-completing-read (lyskom-format 'server-q)
(lyskom-maybe-frob-completion-table
known-servers)
nil nil
(cons (or (getenv "KOMSERVER")
lyskom-default-server
kom-default-server
"") 0))))
(or (cdr (lyskom-string-assoc server known-servers))
server)))
;;; ================================================================
;;; The LysKOM mode.
......
......@@ -175,7 +175,7 @@
;; From komtypes.el: nil
;; From clienttypes.el: nil
;; From startup.el:
(server-q . "LysKOM-server? (%#1s) ")
(server-q . "LysKOM-server? ")
(try-connect . "LysKOM elisp-klient version %#1s.\nFrsker koppla upp mot %#2s.\n")
(too-old-server . "Servern r fr gammal fr den hr versionen av klienten.")
(connection-done . "Uppkopplingen klar. Serverns versionsnummer r %#1s.\n\n")
......
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