问题标签 [emacsclient]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
4252 浏览

macos - 在 Mac OS X 上使用 GUI(来自 Dock)启动 Emacsclient

如何在 Mac OS X 上从 Dock(或者也可以从终端)使用 GUI 启动 Emacsclient?

EmacsWiki描述了如何使用 Automator 创建“Emacs from Dock”应用程序。它对我有用,但我不想启动 Emacs,而是启动 Emacsclient。所以,我尝试用/Applications/Emacs.app/Contents/MacOS/Emacs两者替换/Applications/Emacs.app/Contents/MacOS/bin/emacsclient/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -c但两者都不起作用。

0 投票
1 回答
292 浏览

docker - Magit无法连接到docker内的emacsclient?

我在 docker 内运行 emacs24.5.1(基本映像是 Ubuntu)。我通过 apt-get 安装了 emacs。此外,我通过 melpa 安装了 magit(magit 版本 magit-20170702.858),它很棒。但是,当我尝试提交某些内容时,magit 会遇到以下错误:

当我尝试手动启动 emacsclient 时,emacsclient 出现错误:

这表明这不是真正的 magit 错误,而是 emacsclient 错误,实际上它可能正在发生,因为我在 docker 中运行,尽管我对此不确定。

有没有人知道如何启动 emacsclient 或绕过 magit 中 emacsclient 的要求。曾经有一个插件模式可以绕过 magit 中的 emacsclient,但不久前它已被弃用并从 melpa 中删除,所以我不太热衷于尝试它。

更新 emacs --daemon在 docker 内开始时没有问题,但 magit commit 仍然不起作用,所以也许这毕竟不是 docker 问题?

0 投票
0 回答
363 浏览

emacs - emacs 客户端是如何工作的?

emacsclient 如何与 emacs server 通信?是通过某种套接字连接吗?如果是这样,是否有任何文档可供阅读有关该协议的信息?在哪里可以阅读 emacsclient 的源代码?

0 投票
1 回答
473 浏览

macos - 如何在 OS X 中通过双击打开一个 EMACS 文件,使用 `emacsclient` 命令?

我想通过双击打开在Finder中选择的 org-mode 文件。但是由于我在daemon-mode中使用 Emacs ,所以我想为此使用该emacsclient命令。

因此,主要想法是将命令包装emacsclient -c posixPathToFile在 AppleScript应用程序中以打开它。

我知道有些set命令是不需要的。让我们假设这个脚本被保存为Xemacs.app并且我将这个应用程序与始终打开的.org文件相关联。

通过双击文件无法使用此应用程序,而是如果我在 Finder 中选择文件,然后独立调用Xemacs.app。为什么 ?我对 AppleScript 没有足够的信心来弄清楚会发生什么。

所以解决方法是使用 Automator 服务

该服务保存为“在 Emacs 中打开”

现在选择一个文件并右键单击并调用服务>“在 Emacs 中打开”工作并打开该文件。

第一种方法有什么问题?

0 投票
2 回答
957 浏览

html - 如何使用 emacsclient -e "command" 将 .org 文件转换为 html?

我想使用emacsclient -e "command"将 org 模式文件转换为 html 文件,例如:

希望它将输出保存到 mynote.html 文件。
但我还不熟悉elisp。实际上,org-html-export-as-html有很多参数我不知道如何使用它。

0 投票
1 回答
735 浏览

emacs - 在终端中打开 emacsclient 有效,但不适用于 Automator

因此,当我尝试使用 Automator 服务打开新的 emacs(带有 spacemacs 的 GNU 版本 25.2)缓冲区时,我遇到了一些非常奇怪的行为。

在我的终端中,该命令emacsclient -a '' -c按预期工作,通过 emacsclient 打开一个新缓冲区。但是,当我在 Automator 中创建一个仅运行 ( /bin/bash) shell 脚本的服务时: emacsclient -a '' -c 我收到一条错误消息: The action “Run Shell Script” encountered an error: “emacsclient: could not get terminal name”

由于怀疑这是由于 Automator 没有使用某些默认PATH变量,我尝试了以下操作: PATH=/usr/local/bin:$PATH emacsclient -c 它产生了与以前相同的错误。

接下来我尝试 PATH=/usr/bin:/usr/local/bin export PATH; emacsclient -c 了它产生了一个不同的错误消息: The action “Run Shell Script” encountered an error: “emacsclient: invalid option -- c Try `emacsclient --help' for more information” 但是为什么我在我的终端中尝试那个脚本它也给出了一个类似的错误,这对我来说没有多大意义。

如果有人对如何解决此问题有任何建议,我将不胜感激。

0 投票
1 回答
1043 浏览

ubuntu - 如何在 emacs 27、ubuntu 18 上启动 emacsclient

emacsclient -a ''Ubuntu 18 上的 emacs 27相当于什么?我现在得到

没有启动 emacs 守护程序然后像以前那样再次连接的后备。这也适用于 ubuntu 16.04,所以我认为它与 Ubuntu 18.04 有关。

0 投票
0 回答
136 浏览

emacs - emacsclient,在终端中禁用美化符号模式?

prettify-symbols-mode当我在终端中使用 emacs 时,我试图禁用。原因是终端中的 unicode 支持不如 GUI 模式。所以它会导致编辑我的 R 脚本出现问题。

这是我想出的放入我的 emacs 配置的内容:

当我使用emacs -nw. 但它emacsclient在完成启动 emacs 守护程序后立即退出。

0 投票
1 回答
350 浏览

emacs - Centos 7.6 emacsclient 找不到套接字

我按照指示

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-unit_files

/etc/systemd/system/像这样创建一个emacs.service

然后我执行:

emacs.service 启动成功

但是,当我emacsclient -t在终端中运行时,它显示:

我发现如果我切换到 root 并emacsclient -t在终端中运行,它运行良好。

实际上,主机名是/tmp/emacs0/server,但我无法访问它,因为它的所有者是 root。

我试图在 emacs.service 中添加用户选项,就像这样

但是 systemctl 不能启动这个服务,总是失败。

我也尝试将 emacs.service 放在~/.config/systemd/user/

但是centos 7 不支持systemctl --user

系统信息:

任何意见,将不胜感激!

0 投票
1 回答
154 浏览

emacs - 使用 Emacs 的组织模式:我必须将导出放在哪里才能在 Emacs 守护程序中使用它?

从今天早上安装 CUDA 9 和 cudnn 7 之后,我一直在苦苦挣扎。我将 emacs 作为守护进程运行,zsh 作为我的默认 shell,我想使用 org-mode 来编写笔记本。

这是我的 .zshenv:

这是最小的笔记本:

问题是 emacs 不知道 LD_LIBRARY_PATH。它说KeyError。

你知道我可以把我的环境变量放在哪里,以便我的终端和 Emacs-As-A-Daemon 都能读取吗?我以为它在 .zshenv 和 .zprofile 中,但它们都没有在守护进程模式下工作......(因为是的,当我定期启动它时它正在工作)。

精度: os.environ 的内容显示它似乎只读取 .profile 文件...但是为什么呢?我的默认终端是 zsh,而不是 bash。我试图将我的导出放在 .zprofile 中,重新启动 emacs 的 systemd 守护程序,甚至重新启动,但没有任何效果。如果这是一个愚蠢的问题,对不起。