emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Server port


From: Leo
Subject: Re: Server port
Date: Sun, 24 Oct 2010 03:29:35 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.4)

On 2010-10-24 02:44 +0800, Peter Oliver wrote:
> Can this now be applied?  I have posted an updated patch to
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=854

I also proposed this in private email to Juanma but was turned down due
to security concern. This is what I used locally:

commit 014a288ac84b11453334397c77f439071fa138f2
Date:   Fri Aug 20 16:47:03 2010 +0100

    Make port number of emacs server customisable

        Modified lisp/server.el
diff --git a/lisp/server.el b/lisp/server.el
index 7e2c35a..50d08b0 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -112,6 +112,14 @@ If set, the server accepts remote connections; otherwise 
it is local."
   :version "22.1")
 (put 'server-host 'risky-local-variable t)
 
+(defcustom server-port t
+  "TCP socket port for the server process.
+If t use a random port number."
+  :group 'server
+  :type '(choice (const :tag "Random" t)
+                (integer :tag "Port" 10007))
+  :version "24.1")
+
 (defcustom server-auth-dir (locate-user-emacs-file "server/")
   "Directory for server authentication files.
 
@@ -561,7 +569,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 server-port
                                 :host (or server-host "127.0.0.1") ;; See 
bug#6781
                                 :plist '(:authenticated nil))
                         (list :family 'local


Leo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]