diff --git a/lisp/simple.el b/lisp/simple.el index 3ac6b86381..20e22bf98f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3549,13 +3549,11 @@ shell-command (if async-shell-command-display-buffer (display-buffer buffer '(nil (allow-no-window . t))) (add-function :before (process-filter proc) (lambda (process _string) (let ((buf (process-buffer process))) - (when (and (zerop (buffer-size buf)) - (string= (buffer-name buf) - bname)) + (when (string= (buffer-name buf) bname) (display-buffer buf)))))))) ;; Otherwise, command is executed synchronously. (shell-command-on-region (point) (point) command output-buffer nil error-buffer)))))))