【问题标题】:How do I control emacs from a terminal?如何从终端控制 emacs?
【发布时间】:2012-12-22 06:46:11
【问题描述】:

我正在尝试使用在 Windows VM 中运行的 Dragon Naturally speak 在 OSX 上驱动 emacs。我不想在 VM 中运行 emacs,而是想驱动已经在 mac 端运行的 emacs(从存储库的 HEAD 构建)。因此,在浏览了 emacs lisp 手册之后,我想出了以下 lisp 的 sn-ps(当前在我解决问题时从暂存缓冲区运行):

;; This part is run from an emacsclient -t session
(defvar slave-frame last-event-frame)

;; and this is run in a GUI frame
(defadvice handle-switch-frame (after update-slave-redirect-advice activate)
  (unless (eq last-event-frame slave-frame)
    (redirect-frame-focus slave-frame last-event-frame)))

一切都很好。我在终端窗口中输入,显示缓冲区 A,我的输入出现在 GUI 框架中,忙于显示缓冲区 B。太好了。直到我执行C-x C-f 或任何其他需要迷你缓冲区的命令,此时我收到错误Terminal 1 is locked, cannot read from it

我在这里叫错了树,或者有没有办法让redirect-frame-focus 与使用迷你缓冲区的命令很好地配合?

【问题讨论】:

  • 使用TRAMP并通过共享编辑文件怎么样?
  • TRAMP 是许多问题的答案;我广泛使用它。我很确定这不是这个问题的答案。我想在 Windows 上花更少的时间,而不是更多。
  • 这里的主机和客户端是什么?
  • emacs --server 在主机操作系统(本例中为 OSX)上运行然后,在 Windows VM 中,我 ssh 到主机并运行 emacsclient -t

标签: emacs elisp


【解决方案1】:

码头,

您想要什么行为,重定向到 (Windows) 客户端上的 minibuffer 或服务器上的 minibuffer?另外,您使用的是什么版本/风格的 emacs?

【讨论】:

  • 我希望 emacs 相信在 Windows 端输入的所有内容实际上都是在服务器端输入的。而且我宁愿不必求助于 ascii2x。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-08-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-23
  • 1970-01-01
相关资源
最近更新 更多