From c2e303c840b81dd3538a3b1d9c54ef75fc423aca Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 25 Apr 2000 19:14:45 +0000 Subject: [PATCH] (shell-command): Set default directory for "*Shell Command Output" buffer. --- lisp/simple.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 -- 2.39.5