[英]emacs compilation: call a script in background
I have a script (let's call it ding
) which plays a sound in the background (essentially just calls paplay <file> &
). 我有一个脚本(我们称其为
ding
),该脚本在后台播放声音(实际上只是调用paplay <file> &
)。 I wish to call this from emacs after I finish compiling something, like so: 我希望在完成编译后从emacs调用它,如下所示:
Mx compile
, make && ding
Mx compile
, make && ding
Unfortunately because paplay
is called in the background, nothing happens (no sound is played). 不幸的是,因为在后台调用了
paplay
,所以什么也没发生(没有声音播放)。 If I remove the &
from ding
, the sound is played just fine. 如果我从
ding
删除&
,声音会很好地播放。
Why does this happen, and is there a way to get a script to execute in the background in compilation mode (without making it a foreground job)? 为什么会发生这种情况,有没有办法让脚本在编译模式下在后台执行(而不使其成为前台工作)?
Emacs will close the commands' output when the commands finish, and chances are paplay
doesn't like that. 当命令完成时,Emacs将关闭命令的输出,并且有可能
paplay
不喜欢这样。 Try nohup paplay ... &
尝试
nohup paplay ... &
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.