emacs - 在 emacs lisp 中启动进程,该进程在 lisp 程序结束后继续

标签 emacs elisp

如何在 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/

相关文章:

html - 是否有用于生成 HTML 的 Emacs Lisp 库?

email - 在 Emacs 程序中发送电子邮件

emacs - 如何为特定模式设置 Emacs 填充列?

Emacs rgrep 自定义

emacs - 如何在Emacs的org-mode下使公式变大?

Emacs + Mac OSX和更改默认字体

emacs - 从交互函数内部调用kill-rectangle

Emacs:如何为非标准文件扩展名使用主要模式

Lisp 表达式评估为列表,不理解它是如何工作的

emacs - Emacs中的forms-mode,它的用途是什么,有人用过吗?