(tramp-shell-quote-argument localname))))))
;; We handle also the local part, because there doesn't exist
- ;; `set-file-uid-gid'. On W32 "chown" might not work.
- (let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
- (gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
- (tramp-call-process
- nil "chown" nil nil nil
- (format "%d:%d" uid gid) (tramp-shell-quote-argument filename))))))
+ ;; `set-file-uid-gid'. On W32 "chown" might not work. We add a
+ ;; timeout for this.
+ (with-timeout (5 nil)
+ (let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
+ (gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
+ (tramp-call-process
+ nil "chown" nil nil nil
+ (format "%d:%d" uid gid) (tramp-shell-quote-argument filename)))))))
(defun tramp-remote-selinux-p (vec)
"Check, whether SELINUX is enabled on the remote host."
(let ((tramp-verbose 0))
(setq vec-or-proc
(tramp-get-connection-property vec-or-proc "vector" nil))))
+ ;; Append connection buffer for error messages.
+ (when (= level 1)
+ (let ((tramp-verbose 0))
+ (with-current-buffer (tramp-get-connection-buffer vec-or-proc)
+ (setq fmt-string (concat fmt-string "\n%s")
+ arguments (append arguments (list (buffer-string)))))))
;; Do it.
(when (vectorp vec-or-proc)
(apply 'tramp-debug-message
(file-exists-p tramp-auto-save-directory))
(make-directory tramp-auto-save-directory t))
- (let ((auto-save-file-name-transforms
- (if (null tramp-auto-save-directory) auto-save-file-name-transforms))
+ (let ((system-type 'not-windows)
+ (auto-save-file-name-transforms
+ (if (and (null tramp-auto-save-directory)
+ (boundp 'auto-save-file-name-transforms))
+ (symbol-value 'auto-save-file-name-transforms)))
(buffer-file-name
(if (null tramp-auto-save-directory)
buffer-file-name
(defun tramp-repository-get-version ()
"Try to return as a string the repository revision of the Tramp sources."
- (let ((dir (funcall 'locate-dominating-file (locate-library "tramp") ".git")))
- (when dir
- (with-temp-buffer
- (let ((default-directory (file-name-as-directory dir)))
- (and (zerop
- (ignore-errors
- (call-process "git" nil '(t nil) nil "rev-parse" "HEAD")))
- (not (zerop (buffer-size)))
- (replace-regexp-in-string "\n" "" (buffer-string))))))))
+ (unless (featurep 'xemacs)
+ (let ((dir
+ (funcall 'locate-dominating-file (locate-library "tramp") ".git")))
+ (when dir
+ (with-temp-buffer
+ (let ((default-directory (file-name-as-directory dir)))
+ (and (zerop
+ (ignore-errors
+ (call-process "git" nil '(t nil) nil "rev-parse" "HEAD")))
+ (not (zerop (buffer-size)))
+ (replace-regexp-in-string "\n" "" (buffer-string)))))))))
;; Check for (X)Emacs version.
(let ((x (if (or (>= emacs-major-version 22)