From: Michael Albinus Date: Sat, 22 Nov 2014 11:37:04 +0000 (+0100) Subject: Propagate remote process environment. X-Git-Tag: emacs-25.0.90~2635^2~390 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cd22fd754b71ff64bbabd05bb6df2df8fa5a8915;p=emacs.git Propagate remote process environment. * net/tramp-sh.el (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file): Propagate `process-environment'. * vc/vc-hg.el (vc-hg-state): No special handling for remote files; Tramp propagates environment variables now. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 426543ce4f0..d3a9b64a478 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,10 +1,18 @@ +2014-11-22 Michael Albinus + + * net/tramp-sh.el (tramp-sh-handle-start-file-process) + (tramp-sh-handle-process-file): Propagate `process-environment'. + + * vc/vc-hg.el (vc-hg-state): No special handling for remote files; + Tramp propagates environment variables now. + 2014-11-22 Eric S. Raymond - * vc-filewise.el: New file to isolate code used only by the + * vc/vc-filewise.el: New file to isolate code used only by the file-oriented back ends (SCCS/RCS/CVS/SRC) which should not live in vc.el and certainly not in vc-hooks.el. - * vc-hooks.el, vc-rcs.el, vc-sccs.el: vc-name -> vc-master-name. + * vc/vc-hooks.el, vc-rcs.el, vc-sccs.el: vc-name -> vc-master-name. This is preaparatory to isolating all the 'master' functions used only by the file-oriented back ends. With this done first, the substantive diffs will be easier to read. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 6e46df254b2..8d7e046126c 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2835,16 +2835,27 @@ the result will be a local, non-Tramp, file name." (list (replace-match " \\\\\n" nil nil (cadr args)))) (setq i (+ i 250)))) (cdr args))) + ;; Use a human-friendly prompt, for example for `shell'. + (prompt (format "PS1=%s" + (format "%s %s" + (file-remote-p default-directory) + tramp-initial-end-of-output))) + ;; We use as environment the difference to toplevel + ;; `process-environment'. + env + (env + (dolist + (elt + (cons prompt (nreverse (copy-sequence process-environment))) + env) + (or (member elt (default-toplevel-value 'process-environment)) + (setq env (cons elt env))))) (command (when (stringp program) - (format "cd %s && exec %s env PS1=%s %s" + (format "cd %s && exec %s env %s %s" (tramp-shell-quote-argument localname) (if heredoc (format "<<'%s'" tramp-end-of-heredoc) "") - ;; Use a human-friendly prompt, for example for `shell'. - (tramp-shell-quote-argument - (format "%s %s" - (file-remote-p default-directory) - tramp-initial-end-of-output)) + (mapconcat 'tramp-shell-quote-argument env " ") (if heredoc (format "%s\n(\n%s\n)