问题标签 [comint-mode]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
emacs - 从 comint-redirect-send-command 返回结果
我想在 comint 启动的进程完成后读取缓冲区的输出。
此 sexp 在运行 comint 进程的缓冲区中进行评估。output-buffer-name
一旦过程完成,我想阅读所有文本。
我已尝试应用发布到此问题的解决方案:在 emacs lisp中通过在进程启动命令下方添加此解决方案:
此消息不会出现在 中*Messages*
。
输出缓冲区文本中没有提示,但我可以编写一个函数,t
根据完整的输出文本在输出完成时返回。
如何对缓冲区完成/更改做出反应,或者如何强制 comint 同步运行此功能。
源代码comint-redirect-send-command-to-process
在第 3717 行
shell - Silently send command to comint without printing prompt
I want to send a command to a comint shell-mode
without it printing an additional prompt. I'm trying to use the comint-redirect-*
API, but I am still getting an additional prompt. What would be an easy way to either avoid the prompt printing altogether, or to track back and delete it?
My redirect,
Example of a call in a shell-hook,
But, the comint shell then prints the following (notice the double prompt)
Not directly relevant, but to show it is printing twice, the prompt here is set as
emacs - 避免在comint模式下意外执行
有时在comint模式下,该点位于缓冲区中的任何位置,我按Return
错了。这会将文本点发送到底层进程,这可能非常危险。通常,此文本包含许多行,并且无论偶然与否,其中之一可能是有效命令。
有没有办法告诉 comintReturn
除了最后一个输入之外不要执行任何操作?
emacs - Emacs shell-mode:防止 RET 从任何地方发送输入
正如文档所说,RET 将comint-send-input
在 shell 模式下的任何地方。问题是,如果您错误地在任何行上按了 Enter 键并且您不在提示符下,它将执行整个随机文本,直到下一个提示符为止。我怎样才能防止这种情况发生?如果点击Enter
提示之外的任何地方都会将您发送到底部的新提示,那就太好了。
emacs - Emacs shell 缓冲区(comint 模式)中的长输出行导致“正则表达式匹配器中的堆栈溢出”
有时,某些进程会在 Emacs shell 缓冲区中输出很长的一行(例如,一个多 KB 的 Java 类路径)。这经常导致“正则表达式匹配器中的堆栈溢出”错误,使整个 Emacs 会话无响应。哪个正则表达式导致了这种情况?
emacs - 如何在 Emacs 中为我的自定义 comint 模式添加自动完成功能?
我正在为旧的命令行工具编写一个 comint 模式。我想为其添加基本的自动完成功能。
假设我有以下工具使用的关键字列表:
如何根据此列表将自动完成添加到我的模式?
到目前为止我发现了什么: 我知道在 shell.el 或 comint.el 中有这样的例子,但我没有很好地理解代码来回答这个基本问题。我确实明白我可以用 my-keywords 构建一个正则表达式列表,如下所示:
除此之外,我收集到我可以使用 pcomplete 或 company,或两者兼而有之——实际上我对任何解决方案都很好,但我该怎么做呢?