emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r116824: * net/tramp.el (tramp-methods): Add docs


From: Michael Albinus
Subject: [Emacs-diffs] emacs-24 r116824: * net/tramp.el (tramp-methods): Add docstring for `tramp-login-env'
Date: Fri, 21 Mar 2014 13:02:32 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116824
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: emacs-24
timestamp: Fri 2014-03-21 14:02:25 +0100
message:
  * net/tramp.el (tramp-methods): Add docstring for `tramp-login-env'
    and `tramp-copy-env'.
  
  * net/tramp-sh.el (tramp-methods) <sudo>: Add `tramp-login-env'.
    (tramp-maybe-open-connection): Handle `tramp-login-env'.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp-sh.el           trampsh.el-20100913133439-a1faifh29eqoi4nh-1
  lisp/net/tramp.el              tramp.el-20091113204419-o5vbwnq5f7feedwu-2427
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-03-21 07:19:21 +0000
+++ b/lisp/ChangeLog    2014-03-21 13:02:25 +0000
@@ -1,3 +1,11 @@
+2014-03-21  Michael Albinus  <address@hidden>
+
+       * net/tramp.el (tramp-methods): Add docstring for `tramp-login-env'
+       and `tramp-copy-env'.
+
+       * net/tramp-sh.el (tramp-methods) <sudo>: Add `tramp-login-env'.
+       (tramp-maybe-open-connection): Handle `tramp-login-env'.
+
 2014-03-21  Glenn Morris  <address@hidden>
 
        * electric.el (electric-indent-post-self-insert-function): Add doc.

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2014-03-17 09:28:47 +0000
+++ b/lisp/net/tramp-sh.el      2014-03-21 13:02:25 +0000
@@ -227,6 +227,8 @@
   '("sudo"
     (tramp-login-program        "sudo")
     (tramp-login-args           (("-u" "%u") ("-s") ("-H") ("-p" "Password:")))
+    ;; Local $SHELL could be a nasty one, like zsh or fish.  Let's override it.
+    (tramp-login-env            (("SHELL") ("/bin/sh")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
     (tramp-connection-timeout   10)))
@@ -4492,6 +4494,9 @@
                         (login-args
                          (tramp-get-method-parameter
                           l-method 'tramp-login-args))
+                        (login-env
+                         (tramp-get-method-parameter
+                          l-method 'tramp-login-env))
                         (async-args
                          (tramp-get-method-parameter
                           l-method 'tramp-async-args))
@@ -4549,6 +4554,24 @@
                          tramp-current-user   (or g-user   l-user)
                          tramp-current-host   (or g-host   l-host))
 
+                   ;; Add login environment.
+                   (when login-env
+                     (setq
+                      login-env
+                      (mapcar
+                       (lambda (x)
+                         (setq x (mapcar (lambda (y) (format-spec y spec)) x))
+                         (unless (member "" x) (mapconcat 'identity x " ")))
+                       login-env))
+                     (while login-env
+                       (setq command
+                             (format
+                              "%s=%s %s"
+                              (pop login-env)
+                              (tramp-shell-quote-argument (pop login-env))
+                              command)))
+                     (setq command (concat "env " command)))
+
                    ;; Replace `login-args' place holders.
                    (setq
                     l-host (or l-host "")

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2014-03-17 09:28:47 +0000
+++ b/lisp/net/tramp.el 2014-03-21 13:02:25 +0000
@@ -230,6 +230,9 @@
     `tramp-make-tramp-temp-file'.  \"%k\" indicates the keep-date
     parameter of a program, if exists.  \"%c\" adds additional
     `tramp-ssh-controlmaster-options' options for the first hop.
+  * `tramp-login-env'
+     A list of environment variables and their values, which will
+     be set when calling `tramp-login-program'.
   * `tramp-async-args'
     When an asynchronous process is started, we know already that
     the connection works.  Therefore, we can pass additional
@@ -242,6 +245,9 @@
   * `tramp-copy-args'
     This specifies the list of parameters to pass to the above mentioned
     program, the hints for `tramp-login-args' also apply here.
+  * `tramp-copy-env'
+     A list of environment variables and their values, which will
+     be set when calling `tramp-copy-program'.
   * `tramp-copy-keep-date'
     This specifies whether the copying program when the preserves the
     timestamp of the original file.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]