Fork me on GitHub

Hello! Another newbie Emacs Lisp question. I'm trying to launch an external program from Emacs. I found async-shell-command, which seems to be doing what I want. But I just want my app launched, I don't want to see any more buffers. From the docstring, I think that should be possible. I've managed to evaluate display-buffer-alist, and got a lot of values. Do I need to imperatively change this in-place in order to do what I want? Or is there an equivalent to Clojure's binding? Or can I just pass in an argument and I've misread the docs? Any advice is appreciated! > You can configure `async-shell-command-buffer' to specify what to do > when the `*Async Shell Command*' buffer is already taken by another > running shell command. To run COMMAND without displaying the output > in a window you can configure `display-buffer-alist' to use the action > display-buffer-no-window' for the buffer *Async Shell Command*'.


I've got this now:

(defun teod/shell ()
  (async-shell-command "th-terminal"))
, but when I run it, I'm getting an empty *Async Shell Command* buffer that I'd like to avoid.


Do you want Emacs to control the lifecycle of the external process or do you just want a fire and forget process?


fire and forget please.


I mean, should the process shutdown when emacs is stopped?


If you want your process to live beyond Emacs, it may be simpler to start it outside Emacs.

Phil Shapiro15:03:52

I think start-process is what you want.

(start-process "test" "ls" nil)

πŸ‘ 3
πŸ’― 3
Phil Shapiro15:03:15

If you don’t want it to close when emacs exits, nohup might work.


call-process if you want to completely detach.

πŸ’― 3

Just want to say that I really appreciate the pointers, digging through docs and trying things out now :thumbsup:


(start-process "RUN" "RUN" "nohup" "th-terminal")
Seems promising. Trying to understand how to use call-process now.


I am no Elisp programmer myself, but I like to dig around when I see an interesting question. Thanks to you, I am also learning new things, πŸ™‚

πŸ˜„ 3
πŸ™Œ 6

With display-buffer-alist, you can hide (or control other aspects of) any buffers matching a specific RegEx. You can append to the alist your own RegEx and configs. alist is kind of like a hash map. This is one key-value pair for example,

("^\\*Command Line"
  (side . bottom)
  (size . 8)
  (window-width . 40)
  (window-height . 0.16)
   (ttl . 5)
   (quit . t)
   (select . ignore)
And the configs will apply to any buffer names matching the "^\\*Command Line" RegEx.

πŸ’― 3
πŸŽ‰ 3

Also seems to do what I want without going through nohup:

(call-process "th-terminal" nil 0)

πŸ‘ 3