Subject: bug#854: Server port customisation

From: Peter Oliver <[email-masked]>
Date: Sat, 23 Oct 2010 13:31:36 +0100 (BST)

Here is an updated patch against bzr trunk.

-- 
Peter Oliver

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: [email-masked]
# target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/
# testament_sha1: b9c0513f2324b358b13e0b456298c9682cd9bb60
# timestamp: 2010-10-23 13:27:38 +0100
# source_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/
# base_revision_id: [email-masked]
# 
# Begin patch
=== modified file 'lisp/server.el'
--- lisp/server.el	2010-10-08 10:14:47 +0000
+++ lisp/server.el	2010-10-23 12:19:21 +0000
@@ -112,6 +112,15 @@
   :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
+  :type '(choice
+          (string :tag "Port number")
+          (const :tag "Random" nil))
+  :version "22.1")
+(put 'server-port 'risky-local-variable t)
+
 (defcustom server-auth-dir (locate-user-emacs-file "server/")
   "Directory for server authentication files.
 
@@ -564,7 +573,7 @@
 		       ;; 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

# Begin bundle