*** 'async-shell-command-width' defines the number of display columns
available for output of asynchronous shell commands.
++++
+*** Prompt for shell commands can now show the current directory.
+Customize 'shell-command-prompt-show-cwd' to enable it.
+
** Pcomplete
*** The 'pcomplete' command is now obsolete
:group 'shell
:version "27.1")
+(defcustom shell-command-prompt-show-cwd nil
+ "If non-nil, show current directory when prompting for a shell command.
+This affects `shell-command' and `async-shell-command'."
+ :type 'boolean
+ :group 'shell
+ :version "27.1")
+
(defcustom shell-command-dont-erase-buffer nil
"If non-nil, output buffer is not erased between shell commands.
Also, a non-nil value sets the point in the output buffer
a shell (with its need to quote arguments)."
(interactive
(list
- (read-shell-command "Async shell command: " nil nil
+ (read-shell-command (if shell-command-prompt-show-cwd
+ (format-message "Async shell command in `%s': "
+ (abbreviate-file-name
+ default-directory))
+ "Async shell command: ")
+ nil nil
(let ((filename
(cond
(buffer-file-name)
(interactive
(list
- (read-shell-command "Shell command: " nil nil
+ (read-shell-command (if shell-command-prompt-show-cwd
+ (format-message "Shell command in `%s': "
+ (abbreviate-file-name
+ default-directory))
+ "Shell command: ")
+ nil nil
(let ((filename
(cond
(buffer-file-name)