I want to use async-shell-command
to run a .bat
file on Windows.
Reading the function documentation it says:
(defun async-shell-command (command &optional output-buffer error-buffer)
"Execute string COMMAND asynchronously in background.
...
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*'.
Where I mark in bold what I want to achieve: run COMMAND without displaying the output.
So, I guess I need to configure display-buffer-alist
variable to use
display-buffer-no-window
action for *Async Shell Command*
buffer. It seems simple...
Checking the display-buffer-alist
documentation:
(defcustom display-buffer-alist nil
"Alist of conditional actions for `display-buffer'.
This is a list of elements (CONDITION . ACTION), where:
CONDITION is either a regexp matching buffer names, or a
function that takes two arguments - a buffer name and the
ACTION argument of `display-buffer' - and returns a boolean.
ACTION is a cons cell (FUNCTION . ALIST), where FUNCTION is a
function or a list of functions. Each such function should
accept two arguments: a buffer to display and an alist of the
same form as ALIST. See `display-buffer' for details.
Well... this is where my head starts to get lost on Emacs/Elisp ecosystem.
Should I do something like this (where I do not know what to put on ???):
(add-to-list 'display-buffer-alist '("*Async Shell Command*" . (display-buffer-no-window . ???)) )
Any help/hints will be appreciated.