在特定的主要模式下,如何使用 Emacs Lisp 在后台自动 运行 一个二进制文件?

How do I automatically run a binary in the background using Emacs Lisp when in a particular major mode?

当 Emacs 在 PureScript 模式下加载 .purs PureScript 文件时,我想在后台自动 运行 purescript language server 二进制文件。在我的 init.el 文件中使用 Emacs Lisp 是否有一种简单的方法可以做到这一点?

(defun my-program ()
  (message "Start to run my-program")
  ;; Replace with your binary.
  (shell-command "pwd"))
(add-hook 'purescript-mode-hook #'my-program)