I use Emacs to do most of my development work, I'd like to be able to connect to the Emacs server running on my office workstation from home. I connect to my office network over a VPN, I think this is mostly safe.
Anyway, I have a script that copies the server authentication file out, but it looks like the port changes every time. Our VPN is pretty locked down, I need to tell our sysadmin 开发者_如何学运维what ports I want open to which machines.
Is there a way to set the port that the Emacs server listens on?
Looks like this is now fixed. I'm using Emacs 24.3.1 and there is now a variable server-port
:
C-h v server-port
RET
gives the following documentation:
Documentation:
The port number that the server process should listen on.
This variable only takes effect when the Emacs server is using
TCP instead of local sockets. A nil value means to use a random
port number.
You can customize this variable.
This variable was introduced, or its default value was changed, in
version 24.1 of Emacs.
so a (setq server-port 12345)
in your init file should do the trick.
Someone posted a small patch to allow customizing the server port to the Emacs Bugs list in September 2008. However, the patch didn't make it into Emacs 23.1 nor does it appear in CVS Emacs as of yet. Your best bet for now might be to patch your version of server.el
locally.
精彩评论