How can I control emacs from the terminal?

I am trying to run emacs on OSX using Dragon Naturally Speaking running inside a Windows virtual machine. Instead of running emacs in a virtual machine, I would like to run emacs (built from the HEAD repository) already running on the Mac side. So, after a hunt in the emacs lisp manual, I came up with the following lisp snippets (currently executed from a zero buffer at runtime):

;; 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 everything's good. I enter into the terminal window, displaying buffer A, and my typing appears in the GUI of the GUI. Until I execute C-x C-for any other command that needs a minibuffer, at this moment I get an error Terminal 1 is locked, cannot read from it.

Am I barking the wrong tree here or is there a way to make redirect-frame-focusbeautiful work with teams using the minibuffer?

+1
source share
1 answer

Pierce

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

0
source

Source: https://habr.com/ru/post/1523610/


All Articles