Function: dired-shell-command

dired-shell-command is a byte-compiled function defined in dired-aux.el.gz.

Signature

(dired-shell-command CMD)

Documentation

Run CMD, and check for output.

On error, pop up the log buffer. Return the result of process-file - zero for success.

Source Code

;; Defined in /usr/src/emacs/lisp/dired-aux.el.gz
(defun dired-shell-command (cmd)
  "Run CMD, and check for output.
On error, pop up the log buffer.
Return the result of `process-file' - zero for success."
  (let ((out-buffer " *dired-check-process output*")
        (dir default-directory))
    (with-current-buffer (get-buffer-create out-buffer)
      (erase-buffer)
      (let ((default-directory dir) res)
        (with-connection-local-variables
         (setq res (process-file
                    shell-file-name
                    nil
                    t
                    nil
                    shell-command-switch
                    cmd))
         (dired-uncache dir)
         (unless (zerop res)
           (pop-to-buffer out-buffer))
         res)))))