【问题标题】:Opening emacsclient in terminal works but won't work with Automator在终端中打开 emacsclient 有效,但不适用于 Automator
【发布时间】:2018-03-02 23:59:39
【问题描述】:

因此,当我尝试使用 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” 但是,为什么我在终端中尝试该脚本,它也给出了类似的错误,这对我来说没有多大意义。

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

【问题讨论】:

    标签: emacs terminal automator spacemacs emacsclient


    【解决方案1】:

    问题是 shell 脚本在 /usr/bin 中运行旧版本的 emacsclient,您需要在 Emacs.app/Contents/MacOS/bin/emacsclient 中运行那个。删除 PATH 行,您可以使用此处列出的解决方案在 automator Running a macOS service for open with emacs failed with "emacsclient: could not get terminal name mac" 中运行 emacsclient@

    【讨论】:

      猜你喜欢
      • 2016-02-09
      • 2015-01-21
      • 1970-01-01
      • 1970-01-01
      • 2020-08-03
      • 2020-01-13
      • 1970-01-01
      • 2018-12-03
      • 2016-05-23
      相关资源
      最近更新 更多