[slime-cvs] CVS update: slime/slime.el

Luke Gorrie lgorrie at common-lisp.net
Wed Oct 22 19:04:52 UTC 2003


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv7722

Modified Files:
	slime.el 
Log Message:
(slime): With a prefix argument, prompt for the port number to use for
communication with Lisp. This is remembered for future connections.

Date: Wed Oct 22 15:04:51 2003
Author: lgorrie

Index: slime/slime.el
diff -u slime/slime.el:1.53 slime/slime.el:1.54
--- slime/slime.el:1.53	Wed Oct 22 13:48:11 2003
+++ slime/slime.el	Wed Oct 22 15:04:51 2003
@@ -534,13 +534,26 @@
   "Timer object for connection retries.")
 
 (defun slime ()
-  "Start an inferior^_superior Lisp and connect to its Swank server."
+  "Start an inferior^_superior Lisp and connect to its Swank server.
+With a prefix argument, prompt for the port number for Lisp
+communication. The port is remembered for future connections."
   (interactive)
+  (when current-prefix-arg
+    (slime-read-and-update-swank-port))
   (when (slime-connected-p)
     (slime-disconnect))
   (slime-maybe-start-lisp)
   (slime-connect "localhost" slime-swank-port))
 
+(defun slime-read-and-update-swank-port ()
+  "Prompt the user for the port number to use for Lisp communication."
+  (let* ((port-string (format "%S" slime-swank-port))
+         (new-port-string (read-from-minibuffer "SLIME Port: " port-string))
+         (new-port (read new-port-string)))
+    (if (integerp new-port)
+        (setq slime-swank-port new-port)
+      (error "Not a valid port: %S" new-port-string))))
+        
 (defun slime-maybe-start-lisp ()
   "Start an inferior lisp unless one is already running."
   (unless (get-buffer "*inferior-lisp*")





More information about the slime-cvs mailing list