From: Gerd Moellmann Date: Tue, 25 Apr 2000 19:14:45 +0000 (+0000) Subject: (shell-command): Set default directory for "*Shell X-Git-Tag: emacs-pretest-21.0.90~4146 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c2e303c840b81dd3538a3b1d9c54ef75fc423aca;p=emacs.git (shell-command): Set default directory for "*Shell Command Output" buffer. --- diff --git a/lisp/simple.el b/lisp/simple.el index 9c79a009fbe..78a40cdcee8 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1331,10 +1331,13 @@ specifies the value of ERROR-BUFFER." command))) ;; Clear the output buffer, then run the command with ;; output there. - (save-excursion - (set-buffer buffer) - (setq buffer-read-only nil) - (erase-buffer)) + (let ((directory default-directory)) + (save-excursion + (set-buffer buffer) + (setq buffer-read-only nil) + (if (not output-buffer) + (setq default-directory directory)) + (erase-buffer))) (setq exit-status (call-process-region start end shell-file-name nil (if error-file