]> git.eshelyaron.com Git - emacs.git/commitdiff
Make stderr in Tramp's make-process more robust
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 17 Apr 2021 14:39:14 +0000 (16:39 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 17 Apr 2021 14:39:14 +0000 (16:39 +0200)
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Wrap about
error in inserting stderr file.

* lisp/net/tramp.el (tramp-handle-make-process): Fix docstring.

lisp/net/tramp-sh.el
lisp/net/tramp.el

index 651444b9e037e1af3ec7c4168cd467578a08b2aa..df64d13c41f040e629484a041acabcd74f35f981 100644 (file)
@@ -2923,15 +2923,19 @@ alternative implementation will be used."
                        ;; until the process is deleted.
                        (when (bufferp stderr)
                          (with-current-buffer stderr
-                           (insert-file-contents-literally remote-tmpstderr))
+                           ;; There's a mysterious error, see
+                           ;; <https://github.com/joaotavora/eglot/issues/662>.
+                           (ignore-errors
+                             (insert-file-contents-literally remote-tmpstderr)))
                          ;; Delete tmpstderr file.
                          (add-function
                           :after (process-sentinel p)
                           (lambda (_proc _msg)
                             (when (file-exists-p remote-tmpstderr)
                               (with-current-buffer stderr
-                                (insert-file-contents-literally
-                                 remote-tmpstderr nil nil nil 'replace))
+                                (ignore-errors
+                                  (insert-file-contents-literally
+                                   remote-tmpstderr nil nil nil 'replace)))
                               (delete-file remote-tmpstderr)))))
                        ;; Return process.
                        p)))
index 8da94ec9d9e4fdd2bf7a889644f88f7205feac75..a411aafa8755072ea0c1d9b71df5eb3bfa1d08c5 100644 (file)
@@ -3888,8 +3888,7 @@ substitution.  SPEC-LIST is a list of char/value pairs used for
         (or (not (stringp stderr)) (not (tramp-tramp-file-p stderr))))))
 
 (defun tramp-handle-make-process (&rest args)
-  "An alternative `make-process' implementation for Tramp files.
-It does not support `:stderr'."
+  "An alternative `make-process' implementation for Tramp files."
   (when args
     (with-parsed-tramp-file-name (expand-file-name default-directory) nil
       (let ((default-directory (tramp-compat-temporary-file-directory))