8

我使用 Emacs 完成大部分开发工作,我希望能够在家中连接到在我的办公室工作站上运行的 Emacs 服务器。我通过 VPN 连接到我的办公室网络,我认为这很安全。

无论如何,我有一个将服务器身份验证文件复制出来的脚本,但看起来端口每次都在变化。我们的 VPN 已被锁定,我需要告诉我们的系统管理员我想向哪些机器开放哪些端口。

有没有办法设置 Emacs 服务器监听的端口?

4

2 回答 2

5

看起来这个问题现在已经修复了。我正在使用 Emacs 24.3.1,现在有一个变量server-port

C-h v server-port RET

提供以下文档:

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.

所以(setq server-port 12345)你的 init 文件中的 a 应该可以解决问题。

于 2013-10-28T16:57:09.217 回答
1

有人在 2008 年 9 月发布了一个小补丁,允许将服务器端口自定义到 Emacs 错误列表中。但是,该补丁没有进入 Emacs 23.1,也没有出现在 CVS Emacs 中。你现在最好的选择可能是在server.el本地修补你的版本。

于 2009-12-12T00:53:48.510 回答