From c79b0b1c8ccfd0c134fd8ab138353d7843fc3be8 Mon Sep 17 00:00:00 2001
From: Peter Oliver
Date: Tue, 26 Oct 2010 00:40:07 -0700
Subject: [PATCH] Add server-port option. (Bug#854) * lisp/server.el
(server-port): New option. (server-start): Use server-port.
---
lisp/ChangeLog | 5 +++++
lisp/server.el | 11 ++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1293e4c8f9e..ef604bd4fef 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-26 Peter Oliver (tiny change)
+
+ * server.el (server-port): New option.
+ (server-start): Use server-port.
+
2010-10-26 Glenn Morris
* term/ns-win.el (ns-version-string): Remove unused declaration.
diff --git a/lisp/server.el b/lisp/server.el
index bc49087f464..463b01ccf09 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -112,6 +112,15 @@ If set, the server accepts remote connections; otherwise it is local."
:version "22.1")
(put 'server-host 'risky-local-variable t)
+(defcustom server-port nil
+ "The port number that the server process should listen on."
+ :group 'server
+ :risky t
+ :type '(choice
+ (string :tag "Port number")
+ (const :tag "Random" nil))
+ :version "24.1")
+
(defcustom server-auth-dir (locate-user-emacs-file "server/")
"Directory for server authentication files.
@@ -564,7 +573,7 @@ server or call `M-x server-force-delete' to forcibly disconnect it.")
;; The other args depend on the kind of socket used.
(if server-use-tcp
(list :family 'ipv4 ;; We're not ready for IPv6 yet
- :service t
+ :service (or server-port t)
:host (or server-host 'local)
:plist '(:authenticated nil))
(list :family 'local
--
2.39.5