How do I control emacs from a terminal?

左心房为你撑大大i 提交于 2019-12-06 14:27:59

问题


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)))

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.

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?


回答1:


Piers,

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?



来源:https://stackoverflow.com/questions/14000710/how-do-i-control-emacs-from-a-terminal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!