aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net/tramp-sh.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net/tramp-sh.el')
-rw-r--r--lisp/net/tramp-sh.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 6e5b9d243fb..4ca1f651734 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2806,6 +2806,8 @@ the result will be a local, non-Tramp, file name."
2806;; We use BUFFER also as connection buffer during setup. Because of 2806;; We use BUFFER also as connection buffer during setup. Because of
2807;; this, its original contents must be saved, and restored once 2807;; this, its original contents must be saved, and restored once
2808;; connection has been setup. 2808;; connection has been setup.
2809;; The complete STDERR buffer is available only when the process has
2810;; terminated.
2809(defun tramp-sh-handle-make-process (&rest args) 2811(defun tramp-sh-handle-make-process (&rest args)
2810 "Like `make-process' for Tramp files. 2812 "Like `make-process' for Tramp files.
2811STDERR can also be a file name." 2813STDERR can also be a file name."
@@ -2855,6 +2857,8 @@ STDERR can also be a file name."
2855 (if (and (stringp stderr) (tramp-tramp-file-p stderr)) 2857 (if (and (stringp stderr) (tramp-tramp-file-p stderr))
2856 (tramp-unquote-file-local-name stderr) 2858 (tramp-unquote-file-local-name stderr)
2857 (tramp-make-tramp-temp-file v)))) 2859 (tramp-make-tramp-temp-file v))))
2860 (remote-tmpstderr
2861 (and tmpstderr (tramp-make-tramp-file-name v tmpstderr)))
2858 (program (car command)) 2862 (program (car command))
2859 (args (cdr command)) 2863 (args (cdr command))
2860 ;; When PROGRAM matches "*sh", and the first arg is 2864 ;; When PROGRAM matches "*sh", and the first arg is
@@ -2994,24 +2998,22 @@ STDERR can also be a file name."
2994 (add-function 2998 (add-function
2995 :after (process-sentinel p) 2999 :after (process-sentinel p)
2996 (lambda (_proc _msg) 3000 (lambda (_proc _msg)
2997 (rename-file 3001 (rename-file remote-tmpstderr stderr))))
2998 (tramp-make-tramp-file-name v tmpstderr) stderr))))
2999 ;; Provide error buffer. This shows only 3002 ;; Provide error buffer. This shows only
3000 ;; initial error messages; messages arriving 3003 ;; initial error messages; messages arriving
3001 ;; later on shall be inserted by `auto-revert'. 3004 ;; later on will be inserted when the process is
3002 ;; The temporary file will exist until the 3005 ;; deleted. The temporary file will exist until
3003 ;; process is deleted. 3006 ;; the process is deleted.
3004 (when (bufferp stderr) 3007 (when (bufferp stderr)
3005 (with-current-buffer stderr 3008 (with-current-buffer stderr
3006 (insert-file-contents 3009 (insert-file-contents remote-tmpstderr 'visit))
3007 (tramp-make-tramp-file-name v tmpstderr) 'visit)
3008 (auto-revert-mode))
3009 ;; Delete tmpstderr file. 3010 ;; Delete tmpstderr file.
3010 (add-function 3011 (add-function
3011 :after (process-sentinel p) 3012 :after (process-sentinel p)
3012 (lambda (_proc _msg) 3013 (lambda (_proc _msg)
3013 (delete-file 3014 (with-current-buffer stderr
3014 (tramp-make-tramp-file-name v tmpstderr))))) 3015 (insert-file-contents remote-tmpstderr 'visit))
3016 (delete-file remote-tmpstderr))))
3015 ;; Return process. 3017 ;; Return process.
3016 p))) 3018 p)))
3017 3019