]> git.eshelyaron.com Git - emacs.git/commitdiff
(shell-command): Set default directory for "*Shell
authorGerd Moellmann <gerd@gnu.org>
Tue, 25 Apr 2000 19:14:45 +0000 (19:14 +0000)
committerGerd Moellmann <gerd@gnu.org>
Tue, 25 Apr 2000 19:14:45 +0000 (19:14 +0000)
Command Output" buffer.

lisp/simple.el

index 9c79a009fbe11daafccfbcc80ebd80713550201f..78a40cdcee8473e018d5c923e7e09fff7b8fbe61 100644 (file)
@@ -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