aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2020-01-27 13:36:00 +0100
committerMichael Albinus2020-01-27 13:36:00 +0100
commit688e92426bfa2c5f21bd2ab7a1361c8febf2ca90 (patch)
treef92556c1a1bfb2f5810defc186f2281f5561ff45
parente1c93a02dd13039f7a9f4ccefddaa3e761a27a2e (diff)
downloademacs-688e92426bfa2c5f21bd2ab7a1361c8febf2ca90.tar.gz
emacs-688e92426bfa2c5f21bd2ab7a1361c8febf2ca90.zip
Fix Bug#39253
* lisp/net/tramp.el (tramp-handle-shell-command): Set `default-directory'.
-rw-r--r--lisp/net/tramp.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index e5bb094bbd5..131681a8fdc 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3618,6 +3618,7 @@ support symbolic links."
3618 (let* ((asynchronous (string-match-p "[ \t]*&[ \t]*\\'" command)) 3618 (let* ((asynchronous (string-match-p "[ \t]*&[ \t]*\\'" command))
3619 (command (substring command 0 asynchronous)) 3619 (command (substring command 0 asynchronous))
3620 current-buffer-p 3620 current-buffer-p
3621 (output-buffer-p output-buffer)
3621 (output-buffer 3622 (output-buffer
3622 (cond 3623 (cond
3623 ((bufferp output-buffer) output-buffer) 3624 ((bufferp output-buffer) output-buffer)
@@ -3635,6 +3636,7 @@ support symbolic links."
3635 ((stringp error-buffer) (get-buffer-create error-buffer)))) 3636 ((stringp error-buffer) (get-buffer-create error-buffer))))
3636 (bname (buffer-name output-buffer)) 3637 (bname (buffer-name output-buffer))
3637 (p (get-buffer-process output-buffer)) 3638 (p (get-buffer-process output-buffer))
3639 (dir default-directory)
3638 buffer) 3640 buffer)
3639 3641
3640 ;; The following code is taken from `shell-command', slightly 3642 ;; The following code is taken from `shell-command', slightly
@@ -3671,6 +3673,10 @@ support symbolic links."
3671 (rename-uniquely)) 3673 (rename-uniquely))
3672 (setq output-buffer (get-buffer-create bname))))) 3674 (setq output-buffer (get-buffer-create bname)))))
3673 3675
3676 (unless output-buffer-p
3677 (with-current-buffer output-buffer
3678 (setq default-directory dir)))
3679
3674 (setq buffer (if error-buffer 3680 (setq buffer (if error-buffer
3675 (with-parsed-tramp-file-name default-directory nil 3681 (with-parsed-tramp-file-name default-directory nil
3676 (list output-buffer 3682 (list output-buffer