]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix environment handling in tramp-handle-make-process
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 20 Jan 2021 17:51:52 +0000 (18:51 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 20 Jan 2021 17:51:52 +0000 (18:51 +0100)
* lisp/net/tramp.el (tramp-test-message): Add `tramp-suppress-trace' property.
(tramp-handle-make-process): Handle also 'tramp-remote-process-environment'.

lisp/net/tramp.el

index 2816c58fe7f4277c389fc041d0425666778842f8..7b34a7488221e1a9219312fb02ad488ea3e35252 100644 (file)
@@ -1990,6 +1990,8 @@ the resulting error message."
             (tramp-dissect-file-name default-directory) 0 fmt-string arguments)
     (apply #'message fmt-string arguments)))
 
+(put #'tramp-test-message 'tramp-suppress-trace t)
+
 ;; This function provides traces in case of errors not triggered by
 ;; Tramp functions.
 (defun tramp-signal-hook-function (error-symbol data)
@@ -3801,15 +3803,20 @@ It does not support `:stderr'."
                    (get-buffer-create buffer)
                  ;; BUFFER can be nil.  We use a temporary buffer.
                  (generate-new-buffer tramp-temp-buffer-name)))
-              ;; We use as environment the difference to toplevel
-              ;; `process-environment'.
               (env (mapcar
                     (lambda (elt)
-                      (unless
-                          (member
-                           elt (default-toplevel-value 'process-environment))
-                        (when (string-match-p "=" elt) elt)))
-                    process-environment))
+                      (when (string-match-p "=" elt) elt))
+                    tramp-remote-process-environment))
+              ;; We use as environment the difference to toplevel
+              ;; `process-environment'.
+              (env (dolist (elt process-environment env)
+                     (when
+                         (and
+                          (string-match-p "=" elt)
+                          (not
+                           (member
+                            elt (default-toplevel-value 'process-environment))))
+                       (setq env (cons elt env)))))
               (env (setenv-internal
                     env "INSIDE_EMACS"
                     (concat (or (getenv "INSIDE_EMACS") emacs-version)