2915 |
(let (status) |
(let (status) |
2916 |
(when (string-match "&[ \t]*\\'" command) |
(when (string-match "&[ \t]*\\'" command) |
2917 |
(error "Tramp doesn't grok asynchronous shell commands, yet")) |
(error "Tramp doesn't grok asynchronous shell commands, yet")) |
2918 |
(when error-buffer |
;; (when error-buffer |
2919 |
(error "Tramp doesn't grok optional third arg ERROR-BUFFER, yet")) |
;; (error "Tramp doesn't grok optional third arg ERROR-BUFFER, yet")) |
2920 |
(save-excursion |
(save-excursion |
2921 |
(tramp-barf-unless-okay |
(tramp-barf-unless-okay |
2922 |
multi-method method user host |
multi-method method user host |
2924 |
nil 'file-error |
nil 'file-error |
2925 |
"tramp-handle-shell-command: Couldn't `cd %s'" |
"tramp-handle-shell-command: Couldn't `cd %s'" |
2926 |
(tramp-shell-quote-argument localname)) |
(tramp-shell-quote-argument localname)) |
2927 |
(tramp-send-command multi-method method user host |
(tramp-send-command |
2928 |
(concat command "; tramp_old_status=$?")) |
multi-method method user host |
2929 |
|
(if error-buffer |
2930 |
|
(format "( %s ) 2>/tmp/tramp.$$.err; tramp_old_status=$?" |
2931 |
|
command) |
2932 |
|
(format "%s ;tramp_old_status=$?" command))) |
2933 |
;; This will break if the shell command prints "/////" |
;; This will break if the shell command prints "/////" |
2934 |
;; somewhere. Let's just hope for the best... |
;; somewhere. Let's just hope for the best... |
2935 |
(tramp-wait-for-output)) |
(tramp-wait-for-output)) |
2941 |
(setq output-buffer (current-buffer))) |
(setq output-buffer (current-buffer))) |
2942 |
(set-buffer output-buffer) |
(set-buffer output-buffer) |
2943 |
(insert-buffer (tramp-get-buffer multi-method method user host)) |
(insert-buffer (tramp-get-buffer multi-method method user host)) |
2944 |
|
(when error-buffer |
2945 |
|
(save-excursion |
2946 |
|
(unless (bufferp error-buffer) |
2947 |
|
(setq error-buffer (get-buffer-create error-buffer))) |
2948 |
|
(tramp-send-command |
2949 |
|
multi-method method user host |
2950 |
|
"cat /tmp/tramp.$$.err") |
2951 |
|
(tramp-wait-for-output) |
2952 |
|
(set-buffer error-buffer) |
2953 |
|
(insert-buffer (tramp-get-buffer multi-method method user host)) |
2954 |
|
(tramp-send-command-and-check |
2955 |
|
multi-method method user host "rm -f /tmp/tramp.$$.err"))) |
2956 |
(save-excursion |
(save-excursion |
2957 |
(tramp-send-command multi-method method user host "cd") |
(tramp-send-command multi-method method user host "cd") |
2958 |
(tramp-wait-for-output) |
(tramp-wait-for-output) |
3119 |
;; jka-compr. By let-binding inhibit-file-name-operation, we |
;; jka-compr. By let-binding inhibit-file-name-operation, we |
3120 |
;; propagate that care to the file-local-copy operation. |
;; propagate that care to the file-local-copy operation. |
3121 |
(let ((local-copy |
(let ((local-copy |
3122 |
(let ((inhibit-file-name-operation 'file-local-copy)) |
(let ((inhibit-file-name-operation |
3123 |
|
(when (eq inhibit-file-name-operation |
3124 |
|
'insert-file-contents) |
3125 |
|
'file-local-copy))) |
3126 |
(file-local-copy filename))) |
(file-local-copy filename))) |
3127 |
(coding-system-used nil) |
(coding-system-used nil) |
3128 |
(result nil)) |
(result nil)) |