>From 8016742cfd1d59cf3082afeb1cf77b9a12b9b251 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Wed, 10 May 2023 19:41:05 -0300 Subject: [PATCH 1/1] Handle current-prefix-arg in async-shell-command. * lisp/simple.el (async-shell-command): Properly handle current-prefix-arg. When called interactively, defaults to nil, otherwise, check if it's not a number before passing to `shell-command'. --- lisp/simple.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index 58517dd81f9..ba832581955 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4499,10 +4499,12 @@ async-shell-command ((eq major-mode 'dired-mode) (dired-get-filename nil t))))) (and filename (file-relative-name filename)))) - current-prefix-arg + nil shell-command-default-error-buffer)) (unless (string-match "&[ \t]*\\'" command) (setq command (concat command " &"))) + (when (and output-buffer (numberp output-buffer)) + (error "Invalid output buffer")) (shell-command command output-buffer error-buffer)) (declare-function comint-output-filter "comint" (process string)) -- 2.34.1