summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorNeil Jerram <neil@ossau.uklinux.net>2006-10-12 23:24:02 +0000
committerNeil Jerram <neil@ossau.uklinux.net>2006-10-12 23:24:02 +0000
commite2d23cc0f8ef473a8248b86d8928c70d3cb92873 (patch)
treed62a5675d2eaa8515156c797f5b96831f355e882 /emacs
parentc1ab3a6d6b490c73740419326b4e2b35f64cc0a3 (diff)
* gds.el (gds-run-debug-server): Use variable
gds-server-port-or-path instead of hardcoded 8333. (gds-server-port-or-path): New. * gds-server.el (gds-start-server): Change port arg to port-or-path, to support Unix domain sockets. * gds-client.scm (connect-to-gds): Try to connect by Unix domain socket if TCP connection fails. * gds-server.scm (run-server): Update to support listening on a Unix domain socket.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/ChangeLog9
-rw-r--r--emacs/gds-server.el17
-rw-r--r--emacs/gds.el9
3 files changed, 26 insertions, 9 deletions
diff --git a/emacs/ChangeLog b/emacs/ChangeLog
index 6786c2844..0303fb064 100644
--- a/emacs/ChangeLog
+++ b/emacs/ChangeLog
@@ -1,3 +1,12 @@
+2006-10-13 Neil Jerram <neil@ossau.uklinux.net>
+
+ * gds.el (gds-run-debug-server): Use variable
+ gds-server-port-or-path instead of hardcoded 8333.
+ (gds-server-port-or-path): New.
+
+ * gds-server.el (gds-start-server): Change port arg to
+ port-or-path, to support Unix domain sockets.
+
2006-08-18 Neil Jerram <neil@ossau.uklinux.net>
* gds-server.el (gds-start-server): Change "ossau" to "ice-9".
diff --git a/emacs/gds-server.el b/emacs/gds-server.el
index 722e613db..86defc07b 100644
--- a/emacs/gds-server.el
+++ b/emacs/gds-server.el
@@ -44,24 +44,25 @@
:group 'gds
:type '(choice (const :tag "nil" nil) directory))
-(defun gds-start-server (procname port protocol-handler &optional bufname)
- "Start a GDS server process called PROCNAME, listening on TCP port PORT.
-PROTOCOL-HANDLER should be a function that accepts and processes one
-protocol form. Optional arg BUFNAME specifies the name of the buffer
-that is used for process output\; if not specified the buffer name is
-the same as the process name."
+(defun gds-start-server (procname port-or-path protocol-handler &optional bufname)
+ "Start a GDS server process called PROCNAME, listening on TCP port
+or Unix domain socket PORT-OR-PATH. PROTOCOL-HANDLER should be a
+function that accepts and processes one protocol form. Optional arg
+BUFNAME specifies the name of the buffer that is used for process
+output; if not specified the buffer name is the same as the process
+name."
(with-current-buffer (get-buffer-create (or bufname procname))
(erase-buffer)
(let* ((code (format "(begin
%s
(use-modules (ice-9 gds-server))
- (run-server %d))"
+ (run-server %S))"
(if gds-scheme-directory
(concat "(set! %load-path (cons "
(format "%S" gds-scheme-directory)
" %load-path))")
"")
- port))
+ port-or-path))
(process-connection-type nil) ; use a pipe
(proc (start-process procname
(current-buffer)
diff --git a/emacs/gds.el b/emacs/gds.el
index 3ce4696b6..132b571a2 100644
--- a/emacs/gds.el
+++ b/emacs/gds.el
@@ -42,7 +42,9 @@
(interactive)
(if gds-debug-server (gds-kill-debug-server))
(setq gds-debug-server
- (gds-start-server "gds-debug" 8333 'gds-debug-protocol))
+ (gds-start-server "gds-debug"
+ gds-server-port-or-path
+ 'gds-debug-protocol))
(process-kill-without-query gds-debug-server))
(defun gds-kill-debug-server ()
@@ -602,6 +604,11 @@ you would add an element to this alist to transform
:type 'boolean
:group 'gds)
+(defcustom gds-server-port-or-path 8333
+ "TCP port number or Unix domain socket path for the server to listen on."
+ :group 'gds
+ :type '(choice (integer :tag "TCP port number")
+ (file :tag "Unix domain socket path")))
;;;; If requested, autostart the server after loading.