等待comint模式缓冲区 [英] Waiting for comint-mode buffer

查看:205
本文介绍了等待comint模式缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用comint erlang-shell打开一个后台缓冲区,一旦启动,在emacs中运行一个函数(使用distel将其二进制文件发送到erlang节点)。

I'm trying to open a background buffer with a comint erlang-shell, and once it's up, run a call a function in emacs (using distel to send it's binaries to the erlang node).

ie:

...
(let ((args (append (list "-sname" node-name "-pa") path)))
    (get-buffer-create buffer-name)
    (apply #'make-comint-in-buffer node-name buffer-name "erl" nil args)
  (erl-check-backend (make-node-name node-name))
...

问题是当我打电话时,节点尚未启动(epmd没有注册名称),所以它失败了,我猜这是因为下级进程没有机会运行,有没有办法等到comint缓冲区完成安装?

The problem is that when I call distel, the node is not yet up (epmd has no registered names) so it fails. I'm guessing this is because the inferior process has not had the chance to run yet. Is there any way to wait until the comint-buffer has finished its setup?

我尝试接受过程输出缓冲过程的缓冲区作为参数发送到上面的函数,但只是挂起。

I tried accept-process-output on the buffer-process of the buffer sent in as argument to the function above, but that just hung.

任何帮助赞赏:)

托马斯

推荐答案

在Dave Love撰写的python.el中,使用了以下内容:

in python.el authored by Dave Love the following was used:

(while (progn
     (accept-process-output proc 5)
     (null python-preoutput-result)))

这篇关于等待comint模式缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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