+2012-07-05 Michael Albinus <michael.albinus@gmx.de>
+
+ Sync with Tramp 2.2.6-pre.
+
+ * net/tramp.el (tramp-drop-volume-letter): Provide an XEmacs
+ compatible declaration.
+
+ * net/tramp-cmds.el (tramp-append-tramp-buffers): Protect
+ `list-load-path-shadows' call.
+
+ * net/tramp-compat.el (top): Require packages, which aren't
+ autoloaded anymore for XEmacs. Protect call of
+ `tramp-file-name-handler' by `tramp-compat-funcall', pacifying the
+ compiler. Do not require tramp-util.el and tramp-vc.el anymore,
+ it hurts at least for SXEmacs.
+ (tramp-compat-temporary-file-directory): In XEmacs, there is no
+ standard-value for `temporary-file-directory'.
+
+ * net/tramp-sh.el (tramp-do-directory-files-and-attributes-with-stat):
+ Redirect stderr to /dev/null.
+ (tramp-sh-handle-write-region): uid and gid can be floats.
+ Reported by Russell Sim <russell.sim@gmail.com>.
+ (tramp-sh-handle-vc-registered): Hide errors.
+ (tramp-vc-file-name-handler): Use dummy results for `process-file'
+ and `start-file-process'.
+ (tramp-maybe-open-connection): Check also whether `non-essential'
+ is bound.
+
2012-07-04 Chong Yidong <cyd@gnu.org>
* xml.el (xml--parse-buffer): Use xml-syntax-table.
;; Dump load-path shadows.
(insert "\nload-path shadows:\n==================\n")
(ignore-errors
- (mapc (lambda (x) (when (string-match "tramp" x) (insert x "\n")))
- (split-string (list-load-path-shadows t) "\n")))
+ (mapc
+ (lambda (x) (when (string-match "tramp" x) (insert x "\n")))
+ (split-string (tramp-compat-funcall 'list-load-path-shadows t) "\n")))
;; Append buffers only when we are in message mode.
(when (and
;;; Code:
-(require 'tramp-loaddefs)
-
(eval-when-compile
;; Pacify byte-compiler.
(eval-and-compile
+ ;; Some packages must be required for XEmacs, because we compile
+ ;; with -no-autoloads.
+ (when (featurep 'xemacs)
+ (require 'cus-edit)
+ (require 'env)
+ (require 'executable)
+ (require 'outline)
+ (require 'passwd)
+ (require 'pp)
+ (require 'regexp-opt))
+
(require 'advice)
(require 'custom)
(require 'format-spec)
(require 'shell)
+ (require 'tramp-loaddefs)
+
;; As long as password.el is not part of (X)Emacs, it shouldn't be
;; mandatory.
(if (featurep 'xemacs)
(require 'timer))
;; We check whether `start-file-process' is bound.
- (unless (fboundp 'start-file-process)
+ ;; Note: we deactivate this. There are problems, at least in SXEmacs.
+ (unless t;(fboundp 'start-file-process)
;; tramp-util offers integration into other (X)Emacs packages like
;; compile.el, gud.el etc. Not necessary in Emacs 23.
(defalias 'file-remote-p
(lambda (file &optional identification connected)
(when (tramp-tramp-file-p file)
- (tramp-file-name-handler
+ (tramp-compat-funcall
+ 'tramp-file-name-handler
'file-remote-p file identification connected)))))
;; `process-file' does not exist in XEmacs.
(defalias 'set-file-times
(lambda (filename &optional time)
(when (tramp-tramp-file-p filename)
- (tramp-file-name-handler
- 'set-file-times filename time)))))
+ (tramp-compat-funcall
+ 'tramp-file-name-handler 'set-file-times filename time)))))
;; We currently use "[" and "]" in the filename format for IPv6
;; hosts of GNU Emacs. This means that Emacs wants to expand
For Emacs, this is the variable `temporary-file-directory', for XEmacs
this is the function `temp-directory'."
(let (file-name-handler-alist)
+ ;; We must return a local directory. If it is remote, we could
+ ;; run into an infloop.
(cond
- ;; We must return a local directory. If it is remote, we could
- ;; run into an infloop.
- ((boundp 'temporary-file-directory)
- (eval (car (get 'temporary-file-directory 'standard-value))))
+ ((and (boundp 'temporary-file-directory)
+ (eval (car (get 'temporary-file-directory 'standard-value)))))
((fboundp 'temp-directory) (tramp-compat-funcall 'temp-directory))
((let ((d (getenv "TEMP"))) (and d (file-directory-p d)))
(file-name-as-directory (getenv "TEMP")))
((or (null id-format) (eq id-format 'integer))
(file-attributes filename))
((tramp-tramp-file-p filename)
- (tramp-file-name-handler 'file-attributes filename id-format))
+ (tramp-compat-funcall
+ 'tramp-file-name-handler 'file-attributes filename id-format))
(t (condition-case nil
(tramp-compat-funcall 'file-attributes filename id-format)
(wrong-number-of-arguments (file-attributes filename))))))
;; "-"; this would confuse xargs. "ls -aQ" might be a solution,
;; but it does not work on all remote systems. Therefore, we
;; quote the filenames via sed.
- "cd %s; echo \"(\"; (%s -a | sed -e s/\\$/\\\"/g -e s/^/\\\"/g | xargs "
- "%s -c '(\"%%n\" (\"%%N\") %%h %s %s %%Xe0 %%Ye0 %%Ze0 %%se0 \"%%A\" t %%ie0 -1)'); "
- "echo \")\"")
+ "cd %s; echo \"(\"; (%s -a | sed -e s/\\$/\\\"/g -e s/^/\\\"/g | "
+ "xargs %s -c "
+ "'(\"%%n\" (\"%%N\") %%h %s %s %%Xe0 %%Ye0 %%Ze0 %%se0 \"%%A\" t %%ie0 -1)'"
+ " 2>/dev/null); echo \")\"")
(tramp-shell-quote-argument localname)
(tramp-get-ls-command vec)
(tramp-get-remote-stat vec)
(let (last-coding-system-used (need-chown t))
;; Set file modification time.
(when (or (eq visit t) (stringp visit))
- (let ((file-attr (file-attributes filename)))
+ (let ((file-attr (tramp-compat-file-attributes filename 'integer)))
(set-visited-file-modtime
;; We must pass modtime explicitly, because filename can
;; be different from (buffer-file-name), f.e. if
;; `file-precious-flag' is set.
(nth 5 file-attr))
- (when (and (eq (nth 2 file-attr) uid)
- (eq (nth 3 file-attr) gid))
+ (when (and (= (nth 2 file-attr) uid)
+ (= (nth 3 file-attr) gid))
(setq need-chown nil))))
;; Set the ownership.
`((,tramp-file-name-regexp . tramp-vc-file-name-handler))))
;; Here we collect only file names, which need an operation.
- (tramp-run-real-handler 'vc-registered (list file))
+ (ignore-errors (tramp-run-real-handler 'vc-registered (list file)))
(tramp-message v 10 "\n%s" tramp-vc-registered-file-names)
;; Send just one command, in order to fill the cache.
((and fn (memq operation '(file-exists-p file-readable-p)))
(add-to-list 'tramp-vc-registered-file-names localname 'append)
nil)
+ ;; `process-file' and `start-file-process' shall be ignored.
+ ((and fn (eq operation 'process-file) 0))
+ ((and fn (eq operation 'start-file-process) nil))
;; Tramp file name handlers like `expand-file-name'. They
;; must still work.
- (fn
- (save-match-data (apply (cdr fn) args)))
+ (fn (save-match-data (apply (cdr fn) args)))
;; Default file name handlers, we don't care.
(t (tramp-run-real-handler operation args)))))))
(tramp-get-buffer vec)
;; If `non-essential' is non-nil, don't reopen a new connection.
- (when non-essential
+ (when (and (boundp 'non-essential) (symbol-value 'non-essential))
(throw 'non-essential 'non-essential))
(tramp-with-progress-reporter
'identity))
+(if (featurep 'xemacs)
+ (defalias 'tramp-drop-volume-letter 'identity))
+
(defun tramp-cleanup (vec)
"Cleanup connection VEC, but keep the debug buffer."
(with-current-buffer (tramp-get-debug-buffer vec)