如何在 emacs lisp 中启动一个在 emacs lisp 程序结束后继续运行的进程?我正在编写一个实用程序脚本,该脚本应该启动交互式 GUI 程序并退出。
提前致谢。
编辑:我想我正在寻找与此 C++ 代码等效的 emacs lisp。
#include <cstdlib>
#include <sys/types.h>
#include <unistd.h>
int main() {
using namespace std;
pid_t p = fork();
if (p == 0) {
// child process
execl("process_to_run", "process_to_run", nullptr);
} else {
// stuff for parent to do
}
return 0;
}
最佳答案
它可能无法完全回答您的问题,但以下包使一些内容与您想要的非常相似:https://bitbucket.org/jpkotta/openwith/overview
它基本上使用外部程序(例如 okular、gimp...)打开一个文件,并且
"wraps commands in nohup on Unix so launched processes will not exit if Emacs exits."
我不知道它的实现细节,但你可以尝试阅读他们的代码。对我有用。
关于emacs - 在 emacs lisp 中启动进程,该进程在 lisp 程序结束后继续,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11252061/