[slime-devel] Patch to allow local network address family

Gilaras Drakeson gilaras at gmail.com
Tue Oct 19 14:59:26 UTC 2010


Hi,

Below is a patch to allow local network address family (aka AF_UNIX, UNIX
domain sockets).  Note that `open-network-stream' just calls
`make-network-process'.

diff --git a/slime.el b/slime.el
index 8fc44ce..4afa883 100644
--- a/slime.el
+++ b/slime.el
@@ -1497,7 +1497,12 @@ first line of the file."
 (defun slime-net-connect (host port coding-system)
   "Establish a connection with a CL."
   (let* ((inhibit-quit nil)
-         (proc (open-network-stream "SLIME Lisp" nil host port))
+         (proc (if (and (stringp port) (eq ?/ (string-to-char port)))
+		   ;; consider a string starting with "/" a local service
+		   (make-network-process :name "SLIME Lisp" :buffer nil
+					 :service port :family 'local)
+		 (make-network-process :name "SLIME Lisp" :buffer nil
+				       :host host :service port)))
          (buffer (slime-make-net-buffer " *cl-connection*")))
     (push proc slime-net-processes)
     (set-process-buffer proc buffer)


AF_UNIX is beneficial in the sense that it can speedup communication
between emacs and the lisp process, and can avoid the need for
authentication (presence of ~/.slime-secret).

What do you think?

-- 
Gilaras Drakeson






More information about the slime-devel mailing list