diff options
| author | Paul Eggert | 2011-09-04 12:06:14 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-09-04 12:06:14 -0700 |
| commit | 7ab3acf4ad7166a3ae8998a8a43ad59f852879ea (patch) | |
| tree | c9a6695284780c252080d954569a5481498f7d57 | |
| parent | 806add1d2f7810f51a2e1c9a6e107413815f13cd (diff) | |
| parent | f5e29b9b70a5b6493d13c912e27ecf3bffc97716 (diff) | |
| download | emacs-7ab3acf4ad7166a3ae8998a8a43ad59f852879ea.tar.gz emacs-7ab3acf4ad7166a3ae8998a8a43ad59f852879ea.zip | |
Merge from trunk.
| -rw-r--r-- | doc/emacs/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/emacs/basic.texi | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 172 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 94 |
5 files changed, 174 insertions, 116 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 2407d7dd18f..56958417300 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-09-04 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * basic.texi (Inserting Text): Add index entries. (Bug#9433) | ||
| 4 | |||
| 1 | 2011-08-29 Chong Yidong <cyd@stupidchicken.com> | 5 | 2011-08-29 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 6 | ||
| 3 | * modes.texi (Choosing Modes): auto-mode-case-fold is now t. | 7 | * modes.texi (Choosing Modes): auto-mode-case-fold is now t. |
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index edf07859e52..b06391f004c 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi | |||
| @@ -101,7 +101,9 @@ character to insert (@pxref{Arguments}). | |||
| 101 | 101 | ||
| 102 | @findex ucs-insert | 102 | @findex ucs-insert |
| 103 | @kindex C-x 8 RET | 103 | @kindex C-x 8 RET |
| 104 | @cindex Unicode | 104 | @cindex Unicode characters, inserting |
| 105 | @cindex insert Unicode character | ||
| 106 | @cindex characters, inserting by name or code-point | ||
| 105 | Instead of @kbd{C-q}, you can use @kbd{C-x 8 @key{RET}} | 107 | Instead of @kbd{C-q}, you can use @kbd{C-x 8 @key{RET}} |
| 106 | (@code{ucs-insert}) to insert a character based on its Unicode name or | 108 | (@code{ucs-insert}) to insert a character based on its Unicode name or |
| 107 | code-point. This command prompts for a character to insert, using | 109 | code-point. This command prompts for a character to insert, using |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1d943ccaf0..5e6a6d9108a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2011-09-04 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (top): Require 'shell. Use `tramp-unload-hook' but | ||
| 4 | `tramp-cache-unload-hook' where appropriate. | ||
| 5 | (tramp-methods): Rename `tramp-remote-sh' to | ||
| 6 | `tramp-remote-shell'. Add `tramp-remote-shell-args'. | ||
| 7 | (tramp-handle-shell-command): New defun, moved from tramp-sh.el. | ||
| 8 | |||
| 9 | * net/tramp-sh.el (top): Don't require 'shell. | ||
| 10 | (tramp-methods): Add `tramp-remote-shell' and | ||
| 11 | `tramp-remote-shell-args' entries. | ||
| 12 | (tramp-sh-file-name-handler-alist): Use `tramp-handle-shell-command'. | ||
| 13 | (tramp-sh-handle-shell-command): Remove. | ||
| 14 | (tramp-find-shell, tramp-open-connection-setup-interactive-shell): | ||
| 15 | Use `tramp-remote-shell'. | ||
| 16 | |||
| 1 | 2011-09-03 Chong Yidong <cyd@stupidchicken.com> | 17 | 2011-09-03 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 18 | ||
| 3 | * mail/sendmail.el (sendmail-query-once-function): Deleted. | 19 | * mail/sendmail.el (sendmail-query-once-function): Deleted. |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 428bd6422d8..1fa358e9277 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | 28 | ||
| 29 | (eval-when-compile (require 'cl)) ; ignore-errors | 29 | (eval-when-compile (require 'cl)) ; ignore-errors |
| 30 | (require 'tramp) | 30 | (require 'tramp) |
| 31 | (require 'shell) | ||
| 32 | 31 | ||
| 33 | ;; Pacify byte-compiler. The function is needed on XEmacs only. I'm | 32 | ;; Pacify byte-compiler. The function is needed on XEmacs only. I'm |
| 34 | ;; not sure at all that this is the right way to do it, but let's hope | 33 | ;; not sure at all that this is the right way to do it, but let's hope |
| @@ -91,7 +90,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 91 | '("rcp" | 90 | '("rcp" |
| 92 | (tramp-login-program "rsh") | 91 | (tramp-login-program "rsh") |
| 93 | (tramp-login-args (("%h") ("-l" "%u"))) | 92 | (tramp-login-args (("%h") ("-l" "%u"))) |
| 94 | (tramp-remote-sh "/bin/sh") | 93 | (tramp-remote-shell "/bin/sh") |
| 94 | (tramp-remote-shell-args ("-c")) | ||
| 95 | (tramp-copy-program "rcp") | 95 | (tramp-copy-program "rcp") |
| 96 | (tramp-copy-args (("-p" "%k") ("-r"))) | 96 | (tramp-copy-args (("-p" "%k") ("-r"))) |
| 97 | (tramp-copy-keep-date t) | 97 | (tramp-copy-keep-date t) |
| @@ -101,7 +101,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 101 | '("remcp" | 101 | '("remcp" |
| 102 | (tramp-login-program "remsh") | 102 | (tramp-login-program "remsh") |
| 103 | (tramp-login-args (("%h") ("-l" "%u"))) | 103 | (tramp-login-args (("%h") ("-l" "%u"))) |
| 104 | (tramp-remote-sh "/bin/sh") | 104 | (tramp-remote-shell "/bin/sh") |
| 105 | (tramp-remote-shell-args ("-c")) | ||
| 105 | (tramp-copy-program "rcp") | 106 | (tramp-copy-program "rcp") |
| 106 | (tramp-copy-args (("-p" "%k"))) | 107 | (tramp-copy-args (("-p" "%k"))) |
| 107 | (tramp-copy-keep-date t))) | 108 | (tramp-copy-keep-date t))) |
| @@ -111,7 +112,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 111 | (tramp-login-program "ssh") | 112 | (tramp-login-program "ssh") |
| 112 | (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) | 113 | (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) |
| 113 | (tramp-async-args (("-q"))) | 114 | (tramp-async-args (("-q"))) |
| 114 | (tramp-remote-sh "/bin/sh") | 115 | (tramp-remote-shell "/bin/sh") |
| 116 | (tramp-remote-shell-args ("-c")) | ||
| 115 | (tramp-copy-program "scp") | 117 | (tramp-copy-program "scp") |
| 116 | (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) | 118 | (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) |
| 117 | (tramp-copy-keep-date t) | 119 | (tramp-copy-keep-date t) |
| @@ -127,7 +129,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 127 | (tramp-login-args (("-l" "%u") ("-p" "%p") | 129 | (tramp-login-args (("-l" "%u") ("-p" "%p") |
| 128 | ("-1") ("-e" "none") ("%h"))) | 130 | ("-1") ("-e" "none") ("%h"))) |
| 129 | (tramp-async-args (("-q"))) | 131 | (tramp-async-args (("-q"))) |
| 130 | (tramp-remote-sh "/bin/sh") | 132 | (tramp-remote-shell "/bin/sh") |
| 133 | (tramp-remote-shell-args ("-c")) | ||
| 131 | (tramp-copy-program "scp") | 134 | (tramp-copy-program "scp") |
| 132 | (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) | 135 | (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) |
| 133 | (tramp-copy-keep-date t) | 136 | (tramp-copy-keep-date t) |
| @@ -143,7 +146,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 143 | (tramp-login-args (("-l" "%u") ("-p" "%p") | 146 | (tramp-login-args (("-l" "%u") ("-p" "%p") |
| 144 | ("-2") ("-e" "none") ("%h"))) | 147 | ("-2") ("-e" "none") ("%h"))) |
| 145 | (tramp-async-args (("-q"))) | 148 | (tramp-async-args (("-q"))) |
| 146 | (tramp-remote-sh "/bin/sh") | 149 | (tramp-remote-shell "/bin/sh") |
| 150 | (tramp-remote-shell-args ("-c")) | ||
| 147 | (tramp-copy-program "scp") | 151 | (tramp-copy-program "scp") |
| 148 | (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) | 152 | (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) |
| 149 | (tramp-copy-keep-date t) | 153 | (tramp-copy-keep-date t) |
| @@ -161,7 +165,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 161 | ("-o" "ControlMaster=yes") | 165 | ("-o" "ControlMaster=yes") |
| 162 | ("-e" "none") ("%h"))) | 166 | ("-e" "none") ("%h"))) |
| 163 | (tramp-async-args (("-q"))) | 167 | (tramp-async-args (("-q"))) |
| 164 | (tramp-remote-sh "/bin/sh") | 168 | (tramp-remote-shell "/bin/sh") |
| 169 | (tramp-remote-shell-args ("-c")) | ||
| 165 | (tramp-copy-program "scp") | 170 | (tramp-copy-program "scp") |
| 166 | (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r") | 171 | (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r") |
| 167 | ("-o" "ControlPath=%t.%%r@%%h:%%p") | 172 | ("-o" "ControlPath=%t.%%r@%%h:%%p") |
| @@ -180,7 +185,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 180 | ("-e" "none") ("-t" "-t") | 185 | ("-e" "none") ("-t" "-t") |
| 181 | ("%h") ("/bin/sh"))) | 186 | ("%h") ("/bin/sh"))) |
| 182 | (tramp-async-args (("-q"))) | 187 | (tramp-async-args (("-q"))) |
| 183 | (tramp-remote-sh "/bin/sh") | 188 | (tramp-remote-shell "/bin/sh") |
| 189 | (tramp-remote-shell-args ("-c")) | ||
| 184 | (tramp-copy-program "scp") | 190 | (tramp-copy-program "scp") |
| 185 | (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) | 191 | (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) |
| 186 | (tramp-copy-keep-date t) | 192 | (tramp-copy-keep-date t) |
| @@ -195,7 +201,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 195 | (tramp-login-program "ssh") | 201 | (tramp-login-program "ssh") |
| 196 | (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) | 202 | (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) |
| 197 | (tramp-async-args (("-q"))) | 203 | (tramp-async-args (("-q"))) |
| 198 | (tramp-remote-sh "/bin/sh") | 204 | (tramp-remote-shell "/bin/sh") |
| 205 | (tramp-remote-shell-args ("-c")) | ||
| 199 | (tramp-copy-program "sftp"))) | 206 | (tramp-copy-program "sftp"))) |
| 200 | ;;;###tramp-autoload | 207 | ;;;###tramp-autoload |
| 201 | (add-to-list 'tramp-methods | 208 | (add-to-list 'tramp-methods |
| @@ -203,7 +210,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 203 | (tramp-login-program "ssh") | 210 | (tramp-login-program "ssh") |
| 204 | (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) | 211 | (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) |
| 205 | (tramp-async-args (("-q"))) | 212 | (tramp-async-args (("-q"))) |
| 206 | (tramp-remote-sh "/bin/sh") | 213 | (tramp-remote-shell "/bin/sh") |
| 214 | (tramp-remote-shell-args ("-c")) | ||
| 207 | (tramp-copy-program "rsync") | 215 | (tramp-copy-program "rsync") |
| 208 | (tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r"))) | 216 | (tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r"))) |
| 209 | (tramp-copy-keep-date t) | 217 | (tramp-copy-keep-date t) |
| @@ -218,7 +226,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 218 | ("-o" "ControlMaster=yes") | 226 | ("-o" "ControlMaster=yes") |
| 219 | ("-e" "none") ("%h"))) | 227 | ("-e" "none") ("%h"))) |
| 220 | (tramp-async-args (("-q"))) | 228 | (tramp-async-args (("-q"))) |
| 221 | (tramp-remote-sh "/bin/sh") | 229 | (tramp-remote-shell "/bin/sh") |
| 230 | (tramp-remote-shell-args ("-c")) | ||
| 222 | (tramp-copy-program "rsync") | 231 | (tramp-copy-program "rsync") |
| 223 | (tramp-copy-args (("-t" "%k") ("-r"))) | 232 | (tramp-copy-args (("-t" "%k") ("-r"))) |
| 224 | (tramp-copy-env (("RSYNC_RSH") | 233 | (tramp-copy-env (("RSYNC_RSH") |
| @@ -234,20 +243,23 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 234 | '("rsh" | 243 | '("rsh" |
| 235 | (tramp-login-program "rsh") | 244 | (tramp-login-program "rsh") |
| 236 | (tramp-login-args (("%h") ("-l" "%u"))) | 245 | (tramp-login-args (("%h") ("-l" "%u"))) |
| 237 | (tramp-remote-sh "/bin/sh"))) | 246 | (tramp-remote-shell "/bin/sh") |
| 247 | (tramp-remote-shell-args ("-c")))) | ||
| 238 | ;;;###tramp-autoload | 248 | ;;;###tramp-autoload |
| 239 | (add-to-list 'tramp-methods | 249 | (add-to-list 'tramp-methods |
| 240 | '("remsh" | 250 | '("remsh" |
| 241 | (tramp-login-program "remsh") | 251 | (tramp-login-program "remsh") |
| 242 | (tramp-login-args (("%h") ("-l" "%u"))) | 252 | (tramp-login-args (("%h") ("-l" "%u"))) |
| 243 | (tramp-remote-sh "/bin/sh"))) | 253 | (tramp-remote-shell "/bin/sh") |
| 254 | (tramp-remote-shell-args ("-c")))) | ||
| 244 | ;;;###tramp-autoload | 255 | ;;;###tramp-autoload |
| 245 | (add-to-list 'tramp-methods | 256 | (add-to-list 'tramp-methods |
| 246 | '("ssh" | 257 | '("ssh" |
| 247 | (tramp-login-program "ssh") | 258 | (tramp-login-program "ssh") |
| 248 | (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) | 259 | (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) |
| 249 | (tramp-async-args (("-q"))) | 260 | (tramp-async-args (("-q"))) |
| 250 | (tramp-remote-sh "/bin/sh") | 261 | (tramp-remote-shell "/bin/sh") |
| 262 | (tramp-remote-shell-args ("-c")) | ||
| 251 | (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") | 263 | (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") |
| 252 | ("-o" "UserKnownHostsFile=/dev/null") | 264 | ("-o" "UserKnownHostsFile=/dev/null") |
| 253 | ("-o" "StrictHostKeyChecking=no"))) | 265 | ("-o" "StrictHostKeyChecking=no"))) |
| @@ -259,7 +271,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 259 | (tramp-login-args (("-l" "%u") ("-p" "%p") | 271 | (tramp-login-args (("-l" "%u") ("-p" "%p") |
| 260 | ("-1") ("-e" "none") ("%h"))) | 272 | ("-1") ("-e" "none") ("%h"))) |
| 261 | (tramp-async-args (("-q"))) | 273 | (tramp-async-args (("-q"))) |
| 262 | (tramp-remote-sh "/bin/sh") | 274 | (tramp-remote-shell "/bin/sh") |
| 275 | (tramp-remote-shell-args ("-c")) | ||
| 263 | (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") | 276 | (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") |
| 264 | ("-o" "UserKnownHostsFile=/dev/null") | 277 | ("-o" "UserKnownHostsFile=/dev/null") |
| 265 | ("-o" "StrictHostKeyChecking=no"))) | 278 | ("-o" "StrictHostKeyChecking=no"))) |
| @@ -271,7 +284,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 271 | (tramp-login-args (("-l" "%u") ("-p" "%p") | 284 | (tramp-login-args (("-l" "%u") ("-p" "%p") |
| 272 | ("-2") ("-e" "none") ("%h"))) | 285 | ("-2") ("-e" "none") ("%h"))) |
| 273 | (tramp-async-args (("-q"))) | 286 | (tramp-async-args (("-q"))) |
| 274 | (tramp-remote-sh "/bin/sh") | 287 | (tramp-remote-shell "/bin/sh") |
| 288 | (tramp-remote-shell-args ("-c")) | ||
| 275 | (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") | 289 | (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") |
| 276 | ("-o" "UserKnownHostsFile=/dev/null") | 290 | ("-o" "UserKnownHostsFile=/dev/null") |
| 277 | ("-o" "StrictHostKeyChecking=no"))) | 291 | ("-o" "StrictHostKeyChecking=no"))) |
| @@ -284,7 +298,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 284 | ("-e" "none") ("-t" "-t") | 298 | ("-e" "none") ("-t" "-t") |
| 285 | ("%h") ("/bin/sh"))) | 299 | ("%h") ("/bin/sh"))) |
| 286 | (tramp-async-args (("-q"))) | 300 | (tramp-async-args (("-q"))) |
| 287 | (tramp-remote-sh "/bin/sh") | 301 | (tramp-remote-shell "/bin/sh") |
| 302 | (tramp-remote-shell-args ("-c")) | ||
| 288 | (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") | 303 | (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") |
| 289 | ("-o" "UserKnownHostsFile=/dev/null") | 304 | ("-o" "UserKnownHostsFile=/dev/null") |
| 290 | ("-o" "StrictHostKeyChecking=no"))) | 305 | ("-o" "StrictHostKeyChecking=no"))) |
| @@ -294,38 +309,44 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 294 | '("telnet" | 309 | '("telnet" |
| 295 | (tramp-login-program "telnet") | 310 | (tramp-login-program "telnet") |
| 296 | (tramp-login-args (("%h") ("%p"))) | 311 | (tramp-login-args (("%h") ("%p"))) |
| 297 | (tramp-remote-sh "/bin/sh") | 312 | (tramp-remote-shell "/bin/sh") |
| 313 | (tramp-remote-shell-args ("-c")) | ||
| 298 | (tramp-default-port 23))) | 314 | (tramp-default-port 23))) |
| 299 | ;;;###tramp-autoload | 315 | ;;;###tramp-autoload |
| 300 | (add-to-list 'tramp-methods | 316 | (add-to-list 'tramp-methods |
| 301 | '("su" | 317 | '("su" |
| 302 | (tramp-login-program "su") | 318 | (tramp-login-program "su") |
| 303 | (tramp-login-args (("-") ("%u"))) | 319 | (tramp-login-args (("-") ("%u"))) |
| 304 | (tramp-remote-sh "/bin/sh"))) | 320 | (tramp-remote-shell "/bin/sh") |
| 321 | (tramp-remote-shell-args ("-c")))) | ||
| 305 | ;;;###tramp-autoload | 322 | ;;;###tramp-autoload |
| 306 | (add-to-list 'tramp-methods | 323 | (add-to-list 'tramp-methods |
| 307 | '("sudo" | 324 | '("sudo" |
| 308 | (tramp-login-program "sudo") | 325 | (tramp-login-program "sudo") |
| 309 | (tramp-login-args (("-u" "%u") ("-s") ("-H") ("-p" "Password:"))) | 326 | (tramp-login-args (("-u" "%u") ("-s") ("-H") ("-p" "Password:"))) |
| 310 | (tramp-remote-sh "/bin/sh"))) | 327 | (tramp-remote-shell "/bin/sh") |
| 328 | (tramp-remote-shell-args ("-c")))) | ||
| 311 | ;;;###tramp-autoload | 329 | ;;;###tramp-autoload |
| 312 | (add-to-list 'tramp-methods | 330 | (add-to-list 'tramp-methods |
| 313 | '("ksu" | 331 | '("ksu" |
| 314 | (tramp-login-program "ksu") | 332 | (tramp-login-program "ksu") |
| 315 | (tramp-login-args (("%u") ("-q"))) | 333 | (tramp-login-args (("%u") ("-q"))) |
| 316 | (tramp-remote-sh "/bin/sh"))) | 334 | (tramp-remote-shell "/bin/sh") |
| 335 | (tramp-remote-shell-args ("-c")))) | ||
| 317 | ;;;###tramp-autoload | 336 | ;;;###tramp-autoload |
| 318 | (add-to-list 'tramp-methods | 337 | (add-to-list 'tramp-methods |
| 319 | '("krlogin" | 338 | '("krlogin" |
| 320 | (tramp-login-program "krlogin") | 339 | (tramp-login-program "krlogin") |
| 321 | (tramp-login-args (("%h") ("-l" "%u") ("-x"))) | 340 | (tramp-login-args (("%h") ("-l" "%u") ("-x"))) |
| 322 | (tramp-remote-sh "/bin/sh"))) | 341 | (tramp-remote-shell "/bin/sh") |
| 342 | (tramp-remote-shell-args ("-c")))) | ||
| 323 | ;;;###tramp-autoload | 343 | ;;;###tramp-autoload |
| 324 | (add-to-list 'tramp-methods | 344 | (add-to-list 'tramp-methods |
| 325 | '("plink" | 345 | '("plink" |
| 326 | (tramp-login-program "plink") | 346 | (tramp-login-program "plink") |
| 327 | (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) | 347 | (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) |
| 328 | (tramp-remote-sh "/bin/sh") | 348 | (tramp-remote-shell "/bin/sh") |
| 349 | (tramp-remote-shell-args ("-c")) | ||
| 329 | (tramp-password-end-of-line "xy") ;see docstring for "xy" | 350 | (tramp-password-end-of-line "xy") ;see docstring for "xy" |
| 330 | (tramp-default-port 22))) | 351 | (tramp-default-port 22))) |
| 331 | ;;;###tramp-autoload | 352 | ;;;###tramp-autoload |
| @@ -333,7 +354,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 333 | '("plink1" | 354 | '("plink1" |
| 334 | (tramp-login-program "plink") | 355 | (tramp-login-program "plink") |
| 335 | (tramp-login-args (("-l" "%u") ("-P" "%p") ("-1" "-ssh") ("%h"))) | 356 | (tramp-login-args (("-l" "%u") ("-P" "%p") ("-1" "-ssh") ("%h"))) |
| 336 | (tramp-remote-sh "/bin/sh") | 357 | (tramp-remote-shell "/bin/sh") |
| 358 | (tramp-remote-shell-args ("-c")) | ||
| 337 | (tramp-password-end-of-line "xy") ;see docstring for "xy" | 359 | (tramp-password-end-of-line "xy") ;see docstring for "xy" |
| 338 | (tramp-default-port 22))) | 360 | (tramp-default-port 22))) |
| 339 | ;;;###tramp-autoload | 361 | ;;;###tramp-autoload |
| @@ -348,13 +370,15 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 348 | tramp-terminal-type | 370 | tramp-terminal-type |
| 349 | tramp-initial-end-of-output)) | 371 | tramp-initial-end-of-output)) |
| 350 | ("/bin/sh"))) | 372 | ("/bin/sh"))) |
| 351 | (tramp-remote-sh "/bin/sh"))) | 373 | (tramp-remote-shell "/bin/sh") |
| 374 | (tramp-remote-shell-args ("-c")))) | ||
| 352 | ;;;###tramp-autoload | 375 | ;;;###tramp-autoload |
| 353 | (add-to-list 'tramp-methods | 376 | (add-to-list 'tramp-methods |
| 354 | '("pscp" | 377 | '("pscp" |
| 355 | (tramp-login-program "plink") | 378 | (tramp-login-program "plink") |
| 356 | (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) | 379 | (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) |
| 357 | (tramp-remote-sh "/bin/sh") | 380 | (tramp-remote-shell "/bin/sh") |
| 381 | (tramp-remote-shell-args ("-c")) | ||
| 358 | (tramp-copy-program "pscp") | 382 | (tramp-copy-program "pscp") |
| 359 | (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k") | 383 | (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k") |
| 360 | ("-q") ("-r"))) | 384 | ("-q") ("-r"))) |
| @@ -367,7 +391,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 367 | '("psftp" | 391 | '("psftp" |
| 368 | (tramp-login-program "plink") | 392 | (tramp-login-program "plink") |
| 369 | (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) | 393 | (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) |
| 370 | (tramp-remote-sh "/bin/sh") | 394 | (tramp-remote-shell "/bin/sh") |
| 395 | (tramp-remote-shell-args ("-c")) | ||
| 371 | (tramp-copy-program "pscp") | 396 | (tramp-copy-program "pscp") |
| 372 | (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k") | 397 | (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k") |
| 373 | ("-q") ("-r"))) | 398 | ("-q") ("-r"))) |
| @@ -379,7 +404,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 379 | '("fcp" | 404 | '("fcp" |
| 380 | (tramp-login-program "fsh") | 405 | (tramp-login-program "fsh") |
| 381 | (tramp-login-args (("%h") ("-l" "%u") ("sh" "-i"))) | 406 | (tramp-login-args (("%h") ("-l" "%u") ("sh" "-i"))) |
| 382 | (tramp-remote-sh "/bin/sh -i") | 407 | (tramp-remote-shell "/bin/sh") |
| 408 | (tramp-remote-shell-args ("-i") ("-c")) | ||
| 383 | (tramp-copy-program "fcp") | 409 | (tramp-copy-program "fcp") |
| 384 | (tramp-copy-args (("-p" "%k"))) | 410 | (tramp-copy-args (("-p" "%k"))) |
| 385 | (tramp-copy-keep-date t))) | 411 | (tramp-copy-keep-date t))) |
| @@ -942,7 +968,7 @@ This is used to map a mode number to a permission string.") | |||
| 942 | (executable-find . tramp-sh-handle-executable-find) | 968 | (executable-find . tramp-sh-handle-executable-find) |
| 943 | (start-file-process . tramp-sh-handle-start-file-process) | 969 | (start-file-process . tramp-sh-handle-start-file-process) |
| 944 | (process-file . tramp-sh-handle-process-file) | 970 | (process-file . tramp-sh-handle-process-file) |
| 945 | (shell-command . tramp-sh-handle-shell-command) | 971 | (shell-command . tramp-handle-shell-command) |
| 946 | (insert-directory . tramp-sh-handle-insert-directory) | 972 | (insert-directory . tramp-sh-handle-insert-directory) |
| 947 | (expand-file-name . tramp-sh-handle-expand-file-name) | 973 | (expand-file-name . tramp-sh-handle-expand-file-name) |
| 948 | (substitute-in-file-name . tramp-handle-substitute-in-file-name) | 974 | (substitute-in-file-name . tramp-handle-substitute-in-file-name) |
| @@ -2853,7 +2879,7 @@ the result will be a local, non-Tramp, filename." | |||
| 2853 | ;; `process-file-side-effects' has been introduced with GNU | 2879 | ;; `process-file-side-effects' has been introduced with GNU |
| 2854 | ;; Emacs 23.2. If set to `nil', no remote file will be changed | 2880 | ;; Emacs 23.2. If set to `nil', no remote file will be changed |
| 2855 | ;; by `program'. If it doesn't exist, we assume its default | 2881 | ;; by `program'. If it doesn't exist, we assume its default |
| 2856 | ;; value 't'. | 2882 | ;; value `t'. |
| 2857 | (unless (and (boundp 'process-file-side-effects) | 2883 | (unless (and (boundp 'process-file-side-effects) |
| 2858 | (not (symbol-value 'process-file-side-effects))) | 2884 | (not (symbol-value 'process-file-side-effects))) |
| 2859 | (tramp-flush-directory-property v "")) | 2885 | (tramp-flush-directory-property v "")) |
| @@ -2873,87 +2899,6 @@ the result will be a local, non-Tramp, filename." | |||
| 2873 | (apply 'call-process program tmpfile buffer display args) | 2899 | (apply 'call-process program tmpfile buffer display args) |
| 2874 | (delete-file tmpfile)))) | 2900 | (delete-file tmpfile)))) |
| 2875 | 2901 | ||
| 2876 | (defun tramp-sh-handle-shell-command | ||
| 2877 | (command &optional output-buffer error-buffer) | ||
| 2878 | "Like `shell-command' for Tramp files." | ||
| 2879 | (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command)) | ||
| 2880 | ;; We cannot use `shell-file-name' and `shell-command-switch', | ||
| 2881 | ;; they are variables of the local host. | ||
| 2882 | (args (list | ||
| 2883 | (tramp-get-method-parameter | ||
| 2884 | (tramp-file-name-method | ||
| 2885 | (tramp-dissect-file-name default-directory)) | ||
| 2886 | 'tramp-remote-sh) | ||
| 2887 | "-c" (substring command 0 asynchronous))) | ||
| 2888 | current-buffer-p | ||
| 2889 | (output-buffer | ||
| 2890 | (cond | ||
| 2891 | ((bufferp output-buffer) output-buffer) | ||
| 2892 | ((stringp output-buffer) (get-buffer-create output-buffer)) | ||
| 2893 | (output-buffer | ||
| 2894 | (setq current-buffer-p t) | ||
| 2895 | (current-buffer)) | ||
| 2896 | (t (get-buffer-create | ||
| 2897 | (if asynchronous | ||
| 2898 | "*Async Shell Command*" | ||
| 2899 | "*Shell Command Output*"))))) | ||
| 2900 | (error-buffer | ||
| 2901 | (cond | ||
| 2902 | ((bufferp error-buffer) error-buffer) | ||
| 2903 | ((stringp error-buffer) (get-buffer-create error-buffer)))) | ||
| 2904 | (buffer | ||
| 2905 | (if (and (not asynchronous) error-buffer) | ||
| 2906 | (with-parsed-tramp-file-name default-directory nil | ||
| 2907 | (list output-buffer (tramp-make-tramp-temp-file v))) | ||
| 2908 | output-buffer)) | ||
| 2909 | (p (get-buffer-process output-buffer))) | ||
| 2910 | |||
| 2911 | ;; Check whether there is another process running. Tramp does not | ||
| 2912 | ;; support 2 (asynchronous) processes in parallel. | ||
| 2913 | (when p | ||
| 2914 | (if (yes-or-no-p "A command is running. Kill it? ") | ||
| 2915 | (ignore-errors (kill-process p)) | ||
| 2916 | (error "Shell command in progress"))) | ||
| 2917 | |||
| 2918 | (if current-buffer-p | ||
| 2919 | (progn | ||
| 2920 | (barf-if-buffer-read-only) | ||
| 2921 | (push-mark nil t)) | ||
| 2922 | (with-current-buffer output-buffer | ||
| 2923 | (setq buffer-read-only nil) | ||
| 2924 | (erase-buffer))) | ||
| 2925 | |||
| 2926 | (if (and (not current-buffer-p) (integerp asynchronous)) | ||
| 2927 | (prog1 | ||
| 2928 | ;; Run the process. | ||
| 2929 | (apply 'start-file-process "*Async Shell*" buffer args) | ||
| 2930 | ;; Display output. | ||
| 2931 | (pop-to-buffer output-buffer) | ||
| 2932 | (setq mode-line-process '(":%s")) | ||
| 2933 | (shell-mode)) | ||
| 2934 | |||
| 2935 | (prog1 | ||
| 2936 | ;; Run the process. | ||
| 2937 | (apply 'process-file (car args) nil buffer nil (cdr args)) | ||
| 2938 | ;; Insert error messages if they were separated. | ||
| 2939 | (when (listp buffer) | ||
| 2940 | (with-current-buffer error-buffer | ||
| 2941 | (insert-file-contents (cadr buffer))) | ||
| 2942 | (delete-file (cadr buffer))) | ||
| 2943 | (if current-buffer-p | ||
| 2944 | ;; This is like exchange-point-and-mark, but doesn't | ||
| 2945 | ;; activate the mark. It is cleaner to avoid activation, | ||
| 2946 | ;; even though the command loop would deactivate the mark | ||
| 2947 | ;; because we inserted text. | ||
| 2948 | (goto-char (prog1 (mark t) | ||
| 2949 | (set-marker (mark-marker) (point) | ||
| 2950 | (current-buffer)))) | ||
| 2951 | ;; There's some output, display it. | ||
| 2952 | (when (with-current-buffer output-buffer (> (point-max) (point-min))) | ||
| 2953 | (if (functionp 'display-message-or-buffer) | ||
| 2954 | (tramp-compat-funcall 'display-message-or-buffer output-buffer) | ||
| 2955 | (pop-to-buffer output-buffer)))))))) | ||
| 2956 | |||
| 2957 | (defun tramp-sh-handle-file-local-copy (filename) | 2902 | (defun tramp-sh-handle-file-local-copy (filename) |
| 2958 | "Like `file-local-copy' for Tramp files." | 2903 | "Like `file-local-copy' for Tramp files." |
| 2959 | (with-parsed-tramp-file-name filename nil | 2904 | (with-parsed-tramp-file-name filename nil |
| @@ -3680,7 +3625,7 @@ file exists and nonzero exit status otherwise." | |||
| 3680 | (tramp-set-connection-property | 3625 | (tramp-set-connection-property |
| 3681 | vec "remote-shell" | 3626 | vec "remote-shell" |
| 3682 | (tramp-get-method-parameter | 3627 | (tramp-get-method-parameter |
| 3683 | (tramp-file-name-method vec) 'tramp-remote-sh))))))))) | 3628 | (tramp-file-name-method vec) 'tramp-remote-shell))))))))) |
| 3684 | 3629 | ||
| 3685 | ;; Utility functions. | 3630 | ;; Utility functions. |
| 3686 | 3631 | ||
| @@ -3716,7 +3661,8 @@ process to set up. VEC specifies the connection." | |||
| 3716 | ;; discarded as well. | 3661 | ;; discarded as well. |
| 3717 | (tramp-open-shell | 3662 | (tramp-open-shell |
| 3718 | vec | 3663 | vec |
| 3719 | (tramp-get-method-parameter (tramp-file-name-method vec) 'tramp-remote-sh)) | 3664 | (tramp-get-method-parameter |
| 3665 | (tramp-file-name-method vec) 'tramp-remote-shell)) | ||
| 3720 | 3666 | ||
| 3721 | ;; Disable echo. | 3667 | ;; Disable echo. |
| 3722 | (tramp-message vec 5 "Setting up remote shell environment") | 3668 | (tramp-message vec 5 "Setting up remote shell environment") |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 274bc72391b..6475ea42ec8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | ;;; Code: | 58 | ;;; Code: |
| 59 | 59 | ||
| 60 | (require 'tramp-compat) | 60 | (require 'tramp-compat) |
| 61 | (require 'shell) | ||
| 61 | 62 | ||
| 62 | ;;; User Customizable Internal Variables: | 63 | ;;; User Customizable Internal Variables: |
| 63 | 64 | ||
| @@ -190,13 +191,16 @@ See the variable `tramp-encoding-shell' for more information." | |||
| 190 | This is a list of entries of the form (NAME PARAM1 PARAM2 ...). | 191 | This is a list of entries of the form (NAME PARAM1 PARAM2 ...). |
| 191 | Each NAME stands for a remote access method. Each PARAM is a | 192 | Each NAME stands for a remote access method. Each PARAM is a |
| 192 | pair of the form (KEY VALUE). The following KEYs are defined: | 193 | pair of the form (KEY VALUE). The following KEYs are defined: |
| 193 | * `tramp-remote-sh' | 194 | * `tramp-remote-shell' |
| 194 | This specifies the Bourne shell to use on the remote host. This | 195 | This specifies the Bourne shell to use on the remote host. This |
| 195 | MUST be a Bourne-like shell. It is normally not necessary to set | 196 | MUST be a Bourne-like shell. It is normally not necessary to set |
| 196 | this to any value other than \"/bin/sh\": Tramp wants to use a shell | 197 | this to any value other than \"/bin/sh\": Tramp wants to use a shell |
| 197 | which groks tilde expansion, but it can search for it. Also note | 198 | which groks tilde expansion, but it can search for it. Also note |
| 198 | that \"/bin/sh\" exists on all Unixen, this might not be true for | 199 | that \"/bin/sh\" exists on all Unixen, this might not be true for |
| 199 | the value that you decide to use. You Have Been Warned. | 200 | the value that you decide to use. You Have Been Warned. |
| 201 | * `tramp-remote-shell-args' | ||
| 202 | For implementation of `shell-command', this specifies the | ||
| 203 | argument to let `tramp-remote-shell' run a command. | ||
| 200 | * `tramp-login-program' | 204 | * `tramp-login-program' |
| 201 | This specifies the name of the program to use for logging in to the | 205 | This specifies the name of the program to use for logging in to the |
| 202 | remote host. This may be the name of rsh or a workalike program, | 206 | remote host. This may be the name of rsh or a workalike program, |
| @@ -2959,6 +2963,92 @@ User is always nil." | |||
| 2959 | (delete-file local-copy))))) | 2963 | (delete-file local-copy))))) |
| 2960 | t))) | 2964 | t))) |
| 2961 | 2965 | ||
| 2966 | (defun tramp-handle-shell-command | ||
| 2967 | (command &optional output-buffer error-buffer) | ||
| 2968 | "Like `shell-command' for Tramp files." | ||
| 2969 | (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command)) | ||
| 2970 | ;; We cannot use `shell-file-name' and `shell-command-switch', | ||
| 2971 | ;; they are variables of the local host. | ||
| 2972 | (args (append | ||
| 2973 | (cons | ||
| 2974 | (tramp-get-method-parameter | ||
| 2975 | (tramp-file-name-method | ||
| 2976 | (tramp-dissect-file-name default-directory)) | ||
| 2977 | 'tramp-remote-shell) | ||
| 2978 | (tramp-get-method-parameter | ||
| 2979 | (tramp-file-name-method | ||
| 2980 | (tramp-dissect-file-name default-directory)) | ||
| 2981 | 'tramp-remote-shell-args)) | ||
| 2982 | (list (substring command 0 asynchronous)))) | ||
| 2983 | current-buffer-p | ||
| 2984 | (output-buffer | ||
| 2985 | (cond | ||
| 2986 | ((bufferp output-buffer) output-buffer) | ||
| 2987 | ((stringp output-buffer) (get-buffer-create output-buffer)) | ||
| 2988 | (output-buffer | ||
| 2989 | (setq current-buffer-p t) | ||
| 2990 | (current-buffer)) | ||
| 2991 | (t (get-buffer-create | ||
| 2992 | (if asynchronous | ||
| 2993 | "*Async Shell Command*" | ||
| 2994 | "*Shell Command Output*"))))) | ||
| 2995 | (error-buffer | ||
| 2996 | (cond | ||
| 2997 | ((bufferp error-buffer) error-buffer) | ||
| 2998 | ((stringp error-buffer) (get-buffer-create error-buffer)))) | ||
| 2999 | (buffer | ||
| 3000 | (if (and (not asynchronous) error-buffer) | ||
| 3001 | (with-parsed-tramp-file-name default-directory nil | ||
| 3002 | (list output-buffer (tramp-make-tramp-temp-file v))) | ||
| 3003 | output-buffer)) | ||
| 3004 | (p (get-buffer-process output-buffer))) | ||
| 3005 | |||
| 3006 | ;; Check whether there is another process running. Tramp does not | ||
| 3007 | ;; support 2 (asynchronous) processes in parallel. | ||
| 3008 | (when p | ||
| 3009 | (if (yes-or-no-p "A command is running. Kill it? ") | ||
| 3010 | (ignore-errors (kill-process p)) | ||
| 3011 | (error "Shell command in progress"))) | ||
| 3012 | |||
| 3013 | (if current-buffer-p | ||
| 3014 | (progn | ||
| 3015 | (barf-if-buffer-read-only) | ||
| 3016 | (push-mark nil t)) | ||
| 3017 | (with-current-buffer output-buffer | ||
| 3018 | (setq buffer-read-only nil) | ||
| 3019 | (erase-buffer))) | ||
| 3020 | |||
| 3021 | (if (and (not current-buffer-p) (integerp asynchronous)) | ||
| 3022 | (prog1 | ||
| 3023 | ;; Run the process. | ||
| 3024 | (apply 'start-file-process "*Async Shell*" buffer args) | ||
| 3025 | ;; Display output. | ||
| 3026 | (pop-to-buffer output-buffer) | ||
| 3027 | (setq mode-line-process '(":%s")) | ||
| 3028 | (shell-mode)) | ||
| 3029 | |||
| 3030 | (prog1 | ||
| 3031 | ;; Run the process. | ||
| 3032 | (apply 'process-file (car args) nil buffer nil (cdr args)) | ||
| 3033 | ;; Insert error messages if they were separated. | ||
| 3034 | (when (listp buffer) | ||
| 3035 | (with-current-buffer error-buffer | ||
| 3036 | (insert-file-contents (cadr buffer))) | ||
| 3037 | (delete-file (cadr buffer))) | ||
| 3038 | (if current-buffer-p | ||
| 3039 | ;; This is like exchange-point-and-mark, but doesn't | ||
| 3040 | ;; activate the mark. It is cleaner to avoid activation, | ||
| 3041 | ;; even though the command loop would deactivate the mark | ||
| 3042 | ;; because we inserted text. | ||
| 3043 | (goto-char (prog1 (mark t) | ||
| 3044 | (set-marker (mark-marker) (point) | ||
| 3045 | (current-buffer)))) | ||
| 3046 | ;; There's some output, display it. | ||
| 3047 | (when (with-current-buffer output-buffer (> (point-max) (point-min))) | ||
| 3048 | (if (functionp 'display-message-or-buffer) | ||
| 3049 | (tramp-compat-funcall 'display-message-or-buffer output-buffer) | ||
| 3050 | (pop-to-buffer output-buffer)))))))) | ||
| 3051 | |||
| 2962 | (defun tramp-handle-substitute-in-file-name (filename) | 3052 | (defun tramp-handle-substitute-in-file-name (filename) |
| 2963 | "Like `substitute-in-file-name' for Tramp files. | 3053 | "Like `substitute-in-file-name' for Tramp files. |
| 2964 | \"//\" and \"/~\" substitute only in the local filename part. | 3054 | \"//\" and \"/~\" substitute only in the local filename part. |
| @@ -3477,7 +3567,7 @@ Return the local name of the temporary file." | |||
| 3477 | (ignore-errors (delete-file tramp-temp-buffer-file-name)))) | 3567 | (ignore-errors (delete-file tramp-temp-buffer-file-name)))) |
| 3478 | 3568 | ||
| 3479 | (add-hook 'kill-buffer-hook 'tramp-delete-temp-file-function) | 3569 | (add-hook 'kill-buffer-hook 'tramp-delete-temp-file-function) |
| 3480 | (add-hook 'tramp-cache-unload-hook | 3570 | (add-hook 'tramp-unload-hook |
| 3481 | (lambda () | 3571 | (lambda () |
| 3482 | (remove-hook 'kill-buffer-hook | 3572 | (remove-hook 'kill-buffer-hook |
| 3483 | 'tramp-delete-temp-file-function))) | 3573 | 'tramp-delete-temp-file-function))) |