(shell-command command output-buffer error-buffer))
(declare-function comint-output-filter "comint" (process string))
-(declare-function comint-term-environment "comint")
+(declare-function comint-term-environment "comint" ())
(defun shell-command (command &optional output-buffer error-buffer)
"Execute string COMMAND in inferior shell; display output, if any.
(with-current-buffer buffer
(shell-command-save-pos-or-erase)
(setq default-directory directory)
- (let ((process-environment
+ (require 'shell)
+ (let ((process-environment
(append
- (comint-term-environment)
(and (natnump async-shell-command-width)
(list
(format "COLUMNS=%d"
async-shell-command-width)))
+ (comint-term-environment)
process-environment)))
(setq proc
(start-process-shell-command "Shell" buffer command)))
(setq mode-line-process '(":%s"))
- (require 'shell) (shell-mode)
+ (shell-mode)
(set-process-sentinel proc #'shell-command-sentinel)
;; Use the comint filter for proper handling of
;; carriage motion (see comint-inhibit-carriage-motion).