[slime-devel] Patch: make slime-read-swank-port take an argument.

Peter Seibel peter at gigamonkeys.com
Wed Sep 1 03:55:56 UTC 2010


This patch changes slime-read-swank-port to take the file from which
to read the port as an argument since it seems like that might be a
handy function to have available so that after you've started a server
with (swank:start-server file ...) you can get the port easily.

-Peter

--- slime.el.orig	2010-08-31 20:49:39.000000000 -0700
+++ slime.el	2010-08-31 20:49:59.000000000 -0700
@@ -1366,7 +1366,7 @@
     (cond ((and (file-exists-p file)
                 (> (nth 7 (file-attributes file)) 0)) ; file size
            (slime-cancel-connect-retry-timer)
-           (let ((port (slime-read-swank-port))
+           (let ((port (slime-read-swank-port file))
                  (args (slime-inferior-lisp-args process)))
              (slime-delete-swank-port-file 'message)
              (let ((c (slime-connect slime-lisp-host port
@@ -1406,11 +1406,11 @@
     (cancel-timer slime-connect-retry-timer)
     (setq slime-connect-retry-timer nil)))

-(defun slime-read-swank-port ()
-  "Read the Swank server port number from the `slime-swank-port-file'."
+(defun slime-read-swank-port (file)
+  "Read the Swank server port number from `file'."
   (save-excursion
     (with-temp-buffer
-      (insert-file-contents (slime-swank-port-file))
+      (insert-file-contents file)
       (goto-char (point-min))
       (let ((port (read (current-buffer))))
         (assert (integerp port))


-- 
Peter Seibel
http://www.codequarterly.com/




More information about the slime-devel mailing list