Function: read-shell-command

read-shell-command is a byte-compiled function defined in simple.el.gz.

Signature

(read-shell-command PROMPT &optional INITIAL-CONTENTS HIST &rest ARGS)

Documentation

Read a shell command from the minibuffer.

The arguments are the same as the ones of read-from-minibuffer, except READ and KEYMAP are missing and HIST defaults to shell-command-history.

View in manual

Probably introduced at or before Emacs version 23.1.

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defun read-shell-command (prompt &optional initial-contents hist &rest args)
  "Read a shell command from the minibuffer.
The arguments are the same as the ones of `read-from-minibuffer',
except READ and KEYMAP are missing and HIST defaults
to `shell-command-history'."
  (require 'shell)
  (minibuffer-with-setup-hook
      (lambda ()
        (shell-completion-vars)
        (setq-local minibuffer-default-add-function
                    #'minibuffer-default-add-shell-commands))
    (apply #'read-from-minibuffer prompt initial-contents
	   minibuffer-local-shell-command-map
	   nil
	   (or hist 'shell-command-history)
	   args)))