如何从终端控制emacs? [英] How do I control emacs from a terminal?

查看:117
本文介绍了如何从终端控制emacs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用在Windows VM中运行的Dragon Naturally Speaking来驱动OSX上的emac。而不是在虚拟机中运行emacs,我想驱动一个已经在Mac上运行的emacs(从存储库的HEAD构建)。所以,在通过emacs lisp手册狩猎之后,我想出了以下Lisp片段(目前正在从工作的东西出来,从暂存缓冲区运行):

I'm trying to drive emacs on OSX using Dragon Naturally Speaking running inside a Windows VM. Rather than running emacs in the VM, I'd like to drive an emacs (built from the HEAD of the repository) already running on the mac side of things. So, after a hunt through the emacs lisp manual I came up with the following snippets of lisp (currently running from the scratch buffer while I work stuff out):

;; 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框架中,忙碌的dsplaying缓冲区B.很好。直到我做 Cx Cf 或任何其他需要minibuffer的命令,此时我得到错误终端1被锁定,不能从它读取

And all is well. I type into the terminal window, displaying buffer A and my typing appears in the GUI frame busily dsplaying buffer B. Great. Until I do C-x C-f or any other command that needs the minibuffer, at which point I get the error Terminal 1 is locked, cannot read from it.

我在这里骂了错树,还是有办法使 redirect-frame-focus 使用minibuffer的命令工作得很好?

I'm I barking up the wrong tree here, or is there a way to make redirect-frame-focus work nicely with commands that use the minibuffer?

推荐答案

Piers,

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

What behavior do you want, redirection to a minibuffer on the (Windows) client or a minibuffer on the server? Also, what version/flavor of emacs are you using?

这篇关于如何从终端控制emacs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆