如何设置 Emacs 服务器使用的端口?

发布于 2024-08-14 05:35:11 字数 211 浏览 5 评论 0原文

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

不管怎样,我有一个脚本可以复制服务器身份验证文件,但看起来端口每次都会改变。我们的 VPN 非常锁定,我需要告诉我们的系统管理员我想向哪些计算机开放哪些端口。

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

两人的回忆 2024-08-21 05:35:11

看来这个问题现在已经解决了。我使用的是 Emacs 24.3.1,现在有一个变量 server-port

Ch 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.

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

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.

柠栀 2024-08-21 05:35:11

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文