我怎样才能从 elisp 中 运行 我自己的 shell?

How can I run my own shell from elisp?

我在python写了一个简单的shell,用nuitka编译。 我的shell是一些简单的命令,比如"say string"、"braille string"、"stop"等。 此程序使用 python accessible_output 程序包与 windows 中的屏幕 reader 进行通信。 好的,这在正常的 shell 或从 windows 执行它时效果很好。 现在,我想从 emacs 中 运行 这个程序,例如 emacs 中的正常 shell。 我尝试了一些功能,"start-process","shell-command",但是我不会写命令。 我的程序显示一个提示符,例如 python 解释器,我可以在其中输入命令。 Elisp 能够 运行 python shells,mysql shells,但我无法 运行 我自己的 shell. 求助!

看看它在 nodejs-repl 中是如何完成的https://github.com/abicky/nodejs-repl.el/blob/develop/nodejs-repl.el(见第 308 行)

在python-mode.el中,有问题的部分是

(with-current-buffer
(apply #'make-comint-in-buffer executable py-buffer-name executable nil (split-string-and-unquote args))

有关详细信息,请参阅 make-comint-in-buffer 的文档字符串。

Emacs 有许多不同的方式与外部程序交互。根据您的文字,我怀疑您需要查看 emacs 手册和 elisp 参考手册中的 comint。 Comint 是缓冲区功能中的低级通用 shell(这是 shell 模式使用的)。

阅读您 post 的字里行间,我还建议您看一下 emacspeak。和 speechd.el,两者都是将语音添加到 emacs 的包。 Speechd.el 是一个简单的框架,使用语音调度程序,而 emacspeak 功能非常丰富。 emacspeak 包使用与硬件或软件语音服务器通信的 Tcl 脚本。它还有一个用 python 编写的 mac 版本,它与 OSX 可访问性(画外音)子系统通信。查看这些包的工作原理可能会给您提供很好的示例,说明如何让您的包做您想做的事。

从 emacs shell 缓冲区中启动脚本怎么样?

M-x shell RET /path/to/my/script RET