Commit de8c5f9d authored by Michael Albinus's avatar Michael Albinus

Remove XEmacs compatibility in Tramp

* doc/misc/tramp.texi: Replace flags by their hard coded name.
Remove unused flags and the enclosed alternative text for XEmacs.

* doc/misc/trampver.texi: Use "Tramp" CamelCase.  Rename "emacs"
and "xemacs" flags to "unified" and "separate".  Remove flags
"emacsgw", "emacsname", "emacsdir", "ftppackagename",
"emacsothername", "emacsotherdir" and "emacsotherfilename".
(trampver):
* lisp/net/trampver.el (tramp-version): Set to "2.3.0-pre".

* lisp/net/tramp.el (bkup-backup-directory-info)
(directory-sep-char, ls-lisp-use-insert-directory-program)
(outline-regexp, tramp-backup-directory-alist)
(tramp-default-method, tramp-shell-prompt-pattern, tramp-syntax)
(tramp-file-name-regexp-unified)
(tramp-file-name-regexp-separate)
(tramp-completion-file-name-regexp-unified)
(tramp-completion-file-name-regexp-separate, tramp-chunksize)
(tramp-get-method-parameter, tramp-find-method, tramp-find-user)
(tramp-debug-message, tramp-progress-reporter-update)
(with-tramp-progress-reporter)
(tramp-rfn-eshadow-setup-minibuffer)
(rfn-eshadow-setup-minibuffer-hook, tramp-unload-hook)
(tramp-rfn-eshadow-update-overlay)
(rfn-eshadow-update-overlay-hook, tramp-default-file-modes)
(tramp-file-name-for-operation)
(tramp-completion-file-name-handler)
(tramp-autoload-file-name-handler, tramp-completion-mode-p)
(tramp-handle-directory-files)
(tramp-handle-directory-files-and-attributes)
(tramp-handle-dired-uncache, tramp-handle-find-backup-file-name)
(tramp-handle-insert-file-contents, tramp-handle-load)
(tramp-handle-shell-command)
(tramp-handle-verify-visited-file-modtime)
(tramp-handle-file-notify-valid-p, tramp-accept-process-output)
(tramp-check-for-regexp, tramp-wait-for-regexp)
(tramp-send-string, tramp-mode-string-to-int)
(tramp-get-local-gid, tramp-check-cached-permissions)
(tramp-get-remote-tmpdir, tramp-make-tramp-temp-file)
(auto-save-file-name-transforms)
(tramp-handle-make-auto-save-file-name, tramp-read-passwd)
(tramp-clear-passwd, tramp-time-diff):
* lisp/net/tramp-adb.el (directory-listing-before-filename-regexp)
(directory-sep-char, tramp-adb-file-name-handler-alist)
(tramp-adb-parse-device-names)
(tramp-adb-handle-expand-file-name)
(tramp-adb-handle-file-truename, tramp-adb--gnu-switches-to-ash)
(tramp-adb-handle-file-local-copy)
(tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes)
(tramp-adb-handle-rename-file, tramp-adb-handle-process-file)
(tramp-adb-handle-shell-command)
(tramp-adb-handle-start-file-process, tramp-adb-get-device)
(tramp-adb-maybe-open-connection):
* lisp/net/tramp-cache.el (tramp-persistency-file-name)
(tramp-cache-print):
* lisp/net/tramp-cmds.el (tramp-cleanup-all-connections)
(tramp-bug, tramp-reporter-dump-variable)
(tramp-load-report-modules, tramp-append-tramp-buffers):
* lisp/net/tramp-compat.el (tramp-compat-funcall)
(tramp-advice-file-expand-wildcards)
(tramp-compat-temporary-file-directory)
(tramp-compat-make-temp-file, tramp-compat-copy-file)
(tramp-compat-delete-directory, )
(tramp-compat-process-running-p):
* lisp/net/tramp-ftp.el (tramp-methods) <ftp>:
(tramp-default-method-alist, tramp-foreign-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist)
(tramp-gvfs-do-copy-or-rename-file, tramp-gvfs-handle-copy-file)
(tramp-gvfs-handle-file-local-copy)
(tramp-gvfs-handle-file-name-all-completions)
(tramp-gvfs-handle-file-notify-add-watch)
(tramp-gvfs-monitor-file-process-filter)
(tramp-gvfs-handle-file-readable-p)
(tramp-gvfs-handle-rename-file, tramp-gvfs-handle-write-region)
(tramp-gvfs-file-name, tramp-gvfs-handler-askquestion)
(tramp-gvfs-maybe-open-connection)
(tramp-gvfs-parse-device-names):
* lisp/net/tramp-gw.el (tramp-gw-aux-proc-sentinel)
(tramp-gw-open-connection, tramp-gw-open-network-stream):
* lisp/net/tramp-sh.el (directory-sep-char)
(tramp-sh-file-name-handler-alist)
(tramp-sh-handle-file-truename)
(tramp-sh-handle-set-visited-file-modtime)
(tramp-sh-handle-verify-visited-file-modtime)
(tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times)
(tramp-sh-handle-file-acl)
(tramp-sh-handle-file-name-all-completions)
(tramp-sh-handle-copy-file, tramp-sh-handle-rename-file)
(tramp-do-copy-or-rename-file-directly)
(tramp-do-copy-or-rename-file-out-of-band)
(dired-compress-file-suffixes, dired-remove-file)
(tramp-sh-handle-dired-compress-file)
(tramp-sh-handle-insert-directory)
(tramp-sh-handle-expand-file-name)
(tramp-sh-handle-start-file-process)
(tramp-sh-handle-process-file, tramp-sh-handle-file-local-copy)
(tramp-sh-handle-write-region, tramp-sh-handle-vc-registered)
(tramp-sh-handle-file-notify-add-watch)
(tramp-sh-gvfs-monitor-dir-process-filter)
(tramp-sh-inotifywait-process-filter, tramp-maybe-send-script)
(tramp-find-executable)
(tramp-open-connection-setup-interactive-shell)
(tramp-find-inline-encoding, tramp-compute-multi-hops)
(tramp-maybe-open-connection, tramp-convert-file-attributes)
(tramp-get-remote-path, tramp-get-remote-touch):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist)
(tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file)
(tramp-smb-handle-delete-directory)
(tramp-smb-handle-directory-files, tramp-smb-handle-file-acl)
(tramp-smb-handle-make-directory-internal)
(tramp-smb-handle-process-file, tramp-smb-handle-rename-file)
(tramp-smb-handle-set-file-acl, tramp-smb-handle-set-file-modes)
(tramp-smb-handle-write-region, tramp-smb-get-file-entries)
(tramp-smb-get-cifs-capabilities)
(tramp-smb-maybe-open-connection):
* lisp/net/trampver.el (tramp-repository-get-version):
Remove XEmacs compat code.

* lisp/net/tramp-cmds.el (mml-mode, mml-insert-empty-tag)
(reporter-dump-variable): Declare functions.

* lisp/net/tramp.el (tramp-bkup-backup-directory-info)
(tramp-advice-minibuffer-electric-separator)
(tramp-advice-minibuffer-electric-tilde)
(tramp-handle-unhandled-file-name-directory):
* lisp/net/tramp-compat.el (tramp-compat-with-temp-message)
(tramp-compat-font-lock-add-keywords)
(tramp-compat-load, tramp-compat-number-sequence)
(tramp-compat-split-string, tramp-compat-delete-dups):
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-file-contents-literally):
Remove.

* lisp/net/tramp-sh.el (tramp-methods) <psftp>: This does not work
recursively.
parent 641a3472
This diff is collapsed.
......@@ -8,7 +8,7 @@
@c In the Tramp GIT, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number.
@set trampver 2.2.13.25.1
@set trampver 2.3.0-pre
@c Other flags from configuration
@set instprefix /usr/local
......@@ -16,54 +16,34 @@
@set infodir /usr/local/share/info
@c Formatting of the tramp program name consistent.
@set tramp @sc{tramp}
@set tramp @sc{Tramp}
@c Whether or not describe GVFS integration.
@ifclear noemacsgvfs
@set emacsgvfs
@end ifclear
@c Whether or not describe gateway methods.
@ifclear noemacsgw
@set emacsgw
@end ifclear
@c Some flags which make the text independent on the (X)Emacs flavor.
@c "emacs" resp "xemacs" are set in the Makefile. Default is "emacs".
@ifclear emacs
@ifclear xemacs
@set emacs
@c Some flags which define the remote file name syntax.
@ifclear unified
@ifclear separate
@set unified
@end ifclear
@end ifclear
@c Emacs values.
@ifset emacs
@set emacsname Emacs
@set emacsdir emacs
@set ftppackagename Ange-FTP
@ifset unified
@set prefix /
@set prefixhop
@set postfix :
@set postfixhop :
@set ipv6prefix [
@set ipv6postfix ]
@set emacsothername XEmacs
@set emacsotherdir xemacs
@set emacsotherfilename tramp-xemacs.html
@end ifset
@c XEmacs counterparts.
@ifset xemacs
@set emacsname XEmacs
@set emacsdir xemacs
@set ftppackagename EFS
@ifset separate
@set prefix /[
@set prefixhop [
@set postfix ]
@set postfixhop /
@set ipv6prefix
@set ipv6postfix
@set emacsothername Emacs
@set emacsotherdir emacs
@set emacsotherfilename tramp-emacs.html
@end ifset
......@@ -35,10 +35,6 @@
(require 'tramp)
;; Pacify byte-compiler.
(defvar directory-listing-before-filename-regexp)
(defvar directory-sep-char)
;;;###tramp-autoload
(defcustom tramp-adb-program "adb"
"Name of the Android Debug Bridge program."
......@@ -109,7 +105,6 @@ It is used for TCP/IP devices."
(directory-files . tramp-handle-directory-files)
(directory-files-and-attributes
. tramp-adb-handle-directory-files-and-attributes)
(dired-call-process . ignore)
(dired-compress-file . ignore)
(dired-uncache . tramp-handle-dired-uncache)
(expand-file-name . tramp-adb-handle-expand-file-name)
......@@ -162,7 +157,7 @@ It is used for TCP/IP devices."
(shell-command . tramp-adb-handle-shell-command)
(start-file-process . tramp-adb-handle-start-file-process)
(substitute-in-file-name . tramp-handle-substitute-in-file-name)
(unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory)
(unhandled-file-name-directory . ignore)
(vc-registered . ignore)
(verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
(write-region . tramp-adb-handle-write-region))
......@@ -199,7 +194,7 @@ pass to the OPERATION."
tramp-current-host nil nil))
result)
(tramp-message v 6 "%s" (mapconcat 'identity (process-command p) " "))
(tramp-compat-set-process-query-on-exit-flag p nil)
(set-process-query-on-exit-flag p nil)
(while (eq 'run (process-status p))
(accept-process-output p 0.1))
(accept-process-output p 0.1)
......@@ -213,7 +208,7 @@ pass to the OPERATION."
(lambda (elt)
(setcar
(cdr elt)
(tramp-compat-replace-regexp-in-string
(replace-regexp-in-string
":" tramp-prefix-port-format (car (cdr elt)))))
result)
result))))
......@@ -233,12 +228,9 @@ pass to the OPERATION."
(unless (tramp-run-real-handler 'file-name-absolute-p (list localname))
(setq localname (concat "/" localname)))
;; Do normal `expand-file-name' (this does "/./" and "/../").
;; We bind `directory-sep-char' here for XEmacs on Windows,
;; which would otherwise use backslash. `default-directory' is
;; bound, because on Windows there would be problems with UNC
;; shares or Cygwin mounts.
(let ((directory-sep-char ?/)
(default-directory (tramp-compat-temporary-file-directory)))
;; `default-directory' is bound, because on Windows there would
;; be problems with UNC shares or Cygwin mounts.
(let ((default-directory (tramp-compat-temporary-file-directory)))
(tramp-make-tramp-file-name
method user host
(tramp-drop-volume-letter
......@@ -261,8 +253,7 @@ pass to the OPERATION."
(with-tramp-file-property v localname "file-truename"
(let ((result nil)) ; result steps in reverse order
(tramp-message v 4 "Finding true name for `%s'" filename)
(let* ((directory-sep-char ?/)
(steps (tramp-compat-split-string localname "/"))
(let* ((steps (split-string localname "/" 'omit))
(localnamedir (tramp-run-real-handler
'file-name-as-directory (list localname)))
(is-dir (string= localname localnamedir))
......@@ -312,8 +303,7 @@ pass to the OPERATION."
"Symlink target `%s' on wrong host" symlink-target))
(setq symlink-target localname))
(setq steps
(append (tramp-compat-split-string
symlink-target "/")
(append (split-string symlink-target "/" 'omit)
steps)))
(t
;; It's a file.
......@@ -450,9 +440,8 @@ Convert (\"-al\") to (\"-a\" \"-l\"). Remove arguments like \"--dired\"."
(split-string
(apply 'concat
(mapcar (lambda (s)
(tramp-compat-replace-regexp-in-string
"\\(.\\)" " -\\1"
(tramp-compat-replace-regexp-in-string "^-" "" s)))
(replace-regexp-in-string
"\\(.\\)" " -\\1" (replace-regexp-in-string "^-" "" s)))
;; FIXME: Warning about removed switches (long and non-dash).
(delq nil
(mapcar
......@@ -585,8 +574,7 @@ Emacs dired can't find files."
v 'file-error "Cannot make local copy of file `%s'" filename))
(set-file-modes
tmpfile
(logior (or (file-modes filename) 0)
(tramp-compat-octal-to-decimal "0400"))))
(logior (or (file-modes filename) 0) (string-to-number "0400" 8))))
tmpfile)))
(defun tramp-adb-handle-file-writable-p (filename)
......@@ -631,8 +619,7 @@ But handle the case, if the \"test\" command is not available."
(copy-file filename tmpfile 'ok)
(set-file-modes
tmpfile
(logior (or (file-modes tmpfile) 0)
(tramp-compat-octal-to-decimal "0600"))))
(logior (or (file-modes tmpfile) 0) (string-to-number "0600" 8))))
(tramp-run-real-handler
'write-region
(list start end tmpfile append 'no-message lockname confirm))
......@@ -657,8 +644,7 @@ But handle the case, if the \"test\" command is not available."
(with-parsed-tramp-file-name filename nil
(tramp-flush-file-property v (file-name-directory localname))
(tramp-flush-file-property v localname)
(tramp-adb-send-command-and-check
v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname))))
(tramp-adb-send-command-and-check v (format "chmod %o %s" mode localname))))
(defun tramp-adb-handle-set-file-times (filename &optional time)
"Like `set-file-times' for Tramp files."
......@@ -736,10 +722,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(if (and t1 t2
(tramp-equal-remote filename newname)
(not (file-directory-p filename)))
(let ((l1 (tramp-file-name-handler
'file-remote-p filename 'localname))
(l2 (tramp-file-name-handler
'file-remote-p newname 'localname)))
(let ((l1 (file-remote-p filename 'localname))
(l2 (file-remote-p newname 'localname)))
(when (and (not ok-if-already-exists)
(file-exists-p newname))
(tramp-error v 'file-already-exists newname))
......@@ -755,7 +739,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
"Error renaming %s to %s" filename newname))
;; Rename by copy.
(copy-file filename newname ok-if-already-exists t t)
(copy-file
filename newname ok-if-already-exists 'keep-time 'preserve-uid-gid)
(delete-file filename))))))
(defun tramp-adb-handle-process-file
......@@ -856,12 +841,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
;; because the remote process could have changed them.
(when tmpinput (delete-file tmpinput))
;; `process-file-side-effects' has been introduced with GNU
;; Emacs 23.2. If set to nil, no remote file will be changed
;; by `program'. If it doesn't exist, we assume its default
;; value t.
(unless (and (boundp 'process-file-side-effects)
(not (symbol-value 'process-file-side-effects)))
(unless process-file-side-effects
(tramp-flush-directory-property v ""))
;; Return exit status.
......@@ -941,9 +921,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(current-buffer))))
;; There's some output, display it.
(when (with-current-buffer output-buffer (> (point-max) (point-min)))
(if (functionp 'display-message-or-buffer)
(tramp-compat-funcall 'display-message-or-buffer output-buffer)
(pop-to-buffer output-buffer))))))))
(display-message-or-buffer output-buffer)))))))
;; We use BUFFER also as connection buffer during setup. Because of
;; this, its original contents must be saved, and restored once
......@@ -1008,7 +986,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
;; process. We ignore errors, because the process
;; could have finished already.
(ignore-errors
(tramp-compat-set-process-query-on-exit-flag p t)
(set-process-query-on-exit-flag p t)
(set-marker (process-mark p) (point)))
;; Return process.
p))))
......@@ -1035,7 +1013,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
(host (tramp-file-name-host vec))
(port (tramp-file-name-port vec))
(devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
(tramp-compat-replace-regexp-in-string
(replace-regexp-in-string
tramp-prefix-port-format ":"
(cond ((member host devices) host)
;; This is the case when the host is connected to the default port.
......@@ -1051,7 +1029,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
(not (zerop (length host)))
(not (tramp-adb-execute-adb-command
vec "connect"
(tramp-compat-replace-regexp-in-string
(replace-regexp-in-string
tramp-prefix-port-format ":" host))))
;; When new device connected, running other adb command (e.g.
;; adb shell) immediately will fail. To get around this
......@@ -1205,7 +1183,7 @@ connection if a previous connection has died for some reason."
(unless (eq 'run (process-status p))
(tramp-error vec 'file-error "Terminated!"))
(tramp-set-connection-property p "vector" vec)
(tramp-compat-set-process-query-on-exit-flag p nil)
(set-process-query-on-exit-flag p nil)
;; Check whether the properties have been changed. If
;; yes, this is a strong indication that we must expire all
......@@ -1250,7 +1228,7 @@ connection if a previous connection has died for some reason."
;; Read the expression.
(goto-char (point-min))
(read (current-buffer)))
":" 'omit-nulls))))))))
":" 'omit))))))))
(add-hook 'tramp-unload-hook
(lambda ()
......
......@@ -75,25 +75,7 @@ details see the info pages."
(choice :tag " Value" sexp))))
(defcustom tramp-persistency-file-name
(cond
;; GNU Emacs.
((and (fboundp 'locate-user-emacs-file))
(expand-file-name (tramp-compat-funcall 'locate-user-emacs-file "tramp")))
((and (boundp 'user-emacs-directory)
(stringp (symbol-value 'user-emacs-directory))
(file-directory-p (symbol-value 'user-emacs-directory)))
(expand-file-name "tramp" (symbol-value 'user-emacs-directory)))
((and (not (featurep 'xemacs)) (file-directory-p "~/.emacs.d/"))
"~/.emacs.d/tramp")
;; XEmacs.
((and (boundp 'user-init-directory)
(stringp (symbol-value 'user-init-directory))
(file-directory-p (symbol-value 'user-init-directory)))
(expand-file-name "tramp" (symbol-value 'user-init-directory)))
((and (featurep 'xemacs) (file-directory-p "~/.xemacs/"))
"~/.xemacs/tramp")
;; For users without `~/.emacs.d/' or `~/.xemacs/'.
(t "~/.tramp"))
(expand-file-name (locate-user-emacs-file "tramp"))
"File which keeps connection history for Tramp connections."
:group 'tramp
:type 'file)
......@@ -307,19 +289,14 @@ KEY identifies the connection, it is either a process or a vector."
(maphash
(lambda (key value)
;; Remove text properties from KEY and VALUE.
;; `substring-no-properties' does not exist in XEmacs.
(when (functionp 'substring-no-properties)
(when (vectorp key)
(dotimes (i (length key))
(when (stringp (aref key i))
(aset key i
(tramp-compat-funcall
'substring-no-properties (aref key i))))))
(when (stringp key)
(setq key (tramp-compat-funcall 'substring-no-properties key)))
(when (stringp value)
(setq value
(tramp-compat-funcall 'substring-no-properties value))))
(when (vectorp key)
(dotimes (i (length key))
(when (stringp (aref key i))
(aset key i (substring-no-properties (aref key i))))))
(when (stringp key)
(setq key (substring-no-properties key)))
(when (stringp value)
(setq value (substring-no-properties value)))
;; Dump.
(let ((tmp (format
"(%s %s)"
......@@ -418,8 +395,8 @@ for all methods. Resulting data are derived from connection history."
;; When "emacs -Q" has been called, both variables are nil.
;; We do not load the persistency file then, in order to
;; have a clean test environment.
(or (and (boundp 'init-file-user) (symbol-value 'init-file-user))
(and (boundp 'site-run-file) (symbol-value 'site-run-file))))
(or init-file-user
site-run-file))
(condition-case err
(with-temp-buffer
(insert-file-contents tramp-persistency-file-name)
......
......@@ -31,6 +31,9 @@
(require 'tramp)
;; Pacify byte-compiler.
(declare-function mml-mode "mml")
(declare-function mml-insert-empty-tag "mml")
(declare-function reporter-dump-variable "reporter")
(defvar reporter-eval-buffer)
(defvar reporter-prompt-for-summary-p)
......@@ -128,7 +131,7 @@ This includes password cache, file cache, connection cache, buffers."
(setq tramp-locked nil)
;; Flush password cache.
(tramp-compat-funcall 'password-reset)
(password-reset)
;; Flush file and connection cache.
(clrhash tramp-cache-data)
......@@ -166,7 +169,6 @@ This includes password cache, file cache, connection cache, buffers."
(defun tramp-bug ()
"Submit a bug report to the Tramp developers."
(interactive)
(require 'reporter)
(catch 'dont-send
(let ((reporter-prompt-for-summary-p t))
(reporter-submit-bug-report
......@@ -185,7 +187,6 @@ This includes password cache, file cache, connection cache, buffers."
backup-by-copying-when-mismatch
backup-by-copying-when-privileged-mismatch
backup-directory-alist
bkup-backup-directory-info
password-cache
password-cache-expiry
remote-file-name-inhibit-cache
......@@ -194,8 +195,7 @@ This includes password cache, file cache, connection cache, buffers."
'tramp-load-report-modules ; pre-hook
'tramp-append-tramp-buffers ; post-hook
(tramp-compat-funcall
(if (functionp 'propertize) 'propertize 'progn)
(propertize
"\n" 'display "\
Enter your bug report in this message, including as much detail
as you possibly can about the problem, what you did to cause it
......@@ -243,7 +243,7 @@ buffer in your bug report.
(base64-encode-string (encode-coding-string val 'raw-text)))))))
;; Dump variable.
(tramp-compat-funcall 'reporter-dump-variable varsym mailbuf)
(reporter-dump-variable varsym mailbuf)
(unless (hash-table-p val)
;; Remove string quotation.
......@@ -264,15 +264,8 @@ buffer in your bug report.
(defun tramp-load-report-modules ()
"Load needed modules for reporting."
;; We load message.el and mml.el from Gnus.
(if (featurep 'xemacs)
(progn
(load "message" 'noerror)
(load "mml" 'noerror))
(require 'message nil 'noerror)
(require 'mml nil 'noerror))
(tramp-compat-funcall 'message-mode)
(tramp-compat-funcall 'mml-mode t))
(message-mode)
(mml-mode t))
(defun tramp-append-tramp-buffers ()
"Append Tramp buffers and buffer local variables into the bug report."
......@@ -303,7 +296,7 @@ buffer in your bug report.
;; Non-tramp variables of interest.
'(default-directory))
'string<))
(tramp-compat-funcall 'reporter-dump-variable varsym elbuf))
(reporter-dump-variable varsym elbuf))
(lisp-indent-line)
(insert ")\n"))
(insert-buffer-substring elbuf)))
......@@ -313,7 +306,7 @@ buffer in your bug report.
(ignore-errors
(mapc
(lambda (x) (when (string-match "tramp" x) (insert x "\n")))
(split-string (tramp-compat-funcall 'list-load-path-shadows t) "\n")))
(split-string (list-load-path-shadows t) "\n")))
;; Append buffers only when we are in message mode.
(when (and
......@@ -322,7 +315,7 @@ buffer in your bug report.
(symbol-value 'mml-mode))
(let ((tramp-buf-regexp "\\*\\(debug \\)?tramp/")
(buffer-list (tramp-compat-funcall 'tramp-list-tramp-buffers))
(buffer-list (tramp-list-tramp-buffers))
(curbuf (current-buffer)))
;; There is at least one Tramp buffer.
......@@ -364,13 +357,13 @@ the debug buffer(s).")
(kill-buffer nil)
(switch-to-buffer curbuf)
(goto-char (point-max))
(insert (tramp-compat-funcall 'propertize "\n" 'display "\n\
(insert (propertize "\n" 'display "\n\
This is a special notion of the `gnus/message' package. If you
use another mail agent (by copying the contents of this buffer)
please ensure that the buffers are attached to your email.\n\n"))
(dolist (buffer buffer-list)
(tramp-compat-funcall
'mml-insert-empty-tag 'part 'type "text/plain"
(mml-insert-empty-tag
'part 'type "text/plain"
'encoding "base64" 'disposition "attachment" 'buffer buffer
'description buffer))
(set-buffer-modified-p nil))
......
This diff is collapsed.
......@@ -39,15 +39,6 @@
(defvar ange-ftp-name-format)
;; Disable Ange-FTP from file-name-handler-alist.
;; To handle EFS, the following functions need to be dealt with:
;;
;; * dired-before-readin-hook contains efs-dired-before-readin
;; * file-name-handler-alist contains efs-file-handler-function
;; and efs-root-handler-function and efs-sifn-handler-function
;; * find-file-hooks contains efs-set-buffer-mode
;;
;; But it won't happen for EFS since the XEmacs maintainers
;; don't want to use a unified filename syntax.
(defun tramp-disable-ange-ftp ()
"Turn Ange-FTP off.
This is useful for unified remoting. See
......@@ -104,14 +95,15 @@ present for backward compatibility."
;; ... and add it to the method list.
;;;###tramp-autoload
(unless (featurep 'xemacs)
(add-to-list 'tramp-methods (cons tramp-ftp-method nil))
(add-to-list 'tramp-methods (cons tramp-ftp-method nil))
;; Add some defaults for `tramp-default-method-alist'.
(add-to-list 'tramp-default-method-alist
(list "\\`ftp\\." nil tramp-ftp-method))
(add-to-list 'tramp-default-method-alist
(list nil "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method)))
;; Add some defaults for `tramp-default-method-alist'.
;;;###tramp-autoload
(add-to-list 'tramp-default-method-alist
(list "\\`ftp\\." nil tramp-ftp-method))
;;;###tramp-autoload
(add-to-list 'tramp-default-method-alist
(list nil "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method))
;; Add completion function for FTP method.
;;;###tramp-autoload
......@@ -195,9 +187,8 @@ pass to the OPERATION."
tramp-ftp-method))
;;;###tramp-autoload
(unless (featurep 'xemacs)
(add-to-list 'tramp-foreign-file-name-handler-alist
(cons 'tramp-ftp-file-name-p 'tramp-ftp-file-name-handler)))
(add-to-list 'tramp-foreign-file-name-handler-alist
(cons 'tramp-ftp-file-name-p 'tramp-ftp-file-name-handler))
(add-hook 'tramp-unload-hook
(lambda ()
......
......@@ -422,7 +422,6 @@ Every entry is a list (NAME ADDRESS).")
(directory-files . tramp-handle-directory-files)
(directory-files-and-attributes
. tramp-handle-directory-files-and-attributes)
(dired-call-process . ignore)
(dired-compress-file . ignore)
(dired-uncache . tramp-handle-dired-uncache)
(expand-file-name . tramp-gvfs-handle-expand-file-name)
......@@ -474,7 +473,7 @@ Every entry is a list (NAME ADDRESS).")
(shell-command . ignore)
(start-file-process . ignore)
(substitute-in-file-name . tramp-handle-substitute-in-file-name)
(unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory)
(unhandled-file-name-directory . ignore)
(vc-registered . ignore)
(verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
(write-region . tramp-gvfs-handle-write-region))
......@@ -562,8 +561,7 @@ will be traced by Tramp with trace level 6."
(put 'with-tramp-dbus-call-method 'lisp-indent-function 2)
(put 'with-tramp-dbus-call-method 'edebug-form-spec '(form symbolp body))
(tramp-compat-font-lock-add-keywords
'emacs-lisp-mode '("\\<with-tramp-dbus-call-method\\>"))
(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-tramp-dbus-call-method\\>"))
(defvar tramp-gvfs-dbus-event-vector nil
"Current Tramp file name to be used, as vector.
......@@ -623,19 +621,19 @@ file names."
(and t2 (not (tramp-gvfs-file-name-p newname))))
;; We cannot copy or rename directly.
;; PRESERVE-EXTENDED-ATTRIBUTES has been introduced with
;; Emacs 24.1 (as PRESERVE-SELINUX-CONTEXT), and renamed
;; in Emacs 24.3.
(let ((tmpfile (tramp-compat-make-temp-file filename)))
(cond
(preserve-extended-attributes
(tramp-compat-funcall
(funcall
file-operation
filename tmpfile t keep-date preserve-uid-gid
preserve-extended-attributes))
(preserve-uid-gid
(tramp-compat-funcall
file-operation filename tmpfile t keep-date preserve-uid-gid))
(t
(tramp-compat-funcall
file-operation filename tmpfile t keep-date)))
(funcall
file-operation filename tmpfile t keep-date preserve-uid-gid)))
(rename-file tmpfile newname ok-if-already-exists))
;; Direct action.
......@@ -693,19 +691,18 @@ file names."
(tramp-gvfs-do-copy-or-rename-file
'copy filename newname ok-if-already-exists keep-date
preserve-uid-gid preserve-extended-attributes))
;; Compat section.
;; Compat section. PRESERVE-EXTENDED-ATTRIBUTES has been
;; introduced with Emacs 24.1 (as PRESERVE-SELINUX-CONTEXT), and
;; renamed in Emacs 24.3.
(preserve-extended-attributes
(tramp-run-real-handler
'copy-file
(list filename newname ok-if-already-exists keep-date
preserve-uid-gid preserve-extended-attributes)))
(preserve-uid-gid
(tramp-run-real-handler
'copy-file
(list filename newname ok-if-already-exists keep-date preserve-uid-gid)))
(t
(tramp-run-real-handler
'copy-file (list filename newname ok-if-already-exists keep-date)))))
'copy-file
(list filename newname ok-if-already-exists keep-date preserve-uid-gid)))))
(defun tramp-gvfs-handle-delete-directory (directory &optional recursive trash)
"Like `delete-directory' for Tramp files."
......@@ -923,7 +920,7 @@ file names."
(tramp-error
v 'file-error
"Cannot make local copy of non-existing file `%s'" filename))
(copy-file filename tmpfile t t)
(copy-file filename tmpfile 'ok-if-already-exists 'keep-time)
tmpfile)))
(defun tramp-gvfs-handle-file-name-all-completions (filename directory)
......@@ -960,7 +957,7 @@ file names."
(when cache-hit (list cache-hit))))
;; We cannot use a length of 0, because file properties
;; for "foo" and "foo/" are identical.
(tramp-compat-number-sequence (length filename) 1 -1)))))
(number-sequence (length filename) 1 -1)))))
;; Cache expired or no matching cache entry found so we need
;; to perform a remote operation.
......@@ -1024,9 +1021,9 @@ file names."
(tramp-message
v 6 "Run `%s', %S" (mapconcat 'identity (process-command p) " ") p)
(tramp-set-connection-property p "vector" v)
(tramp-compat-process-put p 'events events)
(tramp-compat-process-put p 'watch-name localname)
(tramp-compat-set-process-query-on-exit-flag p nil)
(process-put p 'events events)
(process-put p 'watch-name localname)
(set-process-query-on-exit-flag p nil)
(set-process-filter p 'tramp-gvfs-monitor-file-process-filter)
;; There might be an error if the monitor is not supported.
;; Give the filter a chance to read the output.
......@@ -1039,7 +1036,7 @@ file names."
(defun tramp-gvfs-monitor-file-process-filter (proc string)
"Read output from \"gvfs-monitor-file\" and add corresponding \
file-notify events."
(let* ((rest-string (tramp-compat-process-get proc 'rest-string))
(let* ((rest-string (process-get proc 'rest-string))
(dd (with-current-buffer (process-buffer proc) default-directory))
(ddu (regexp-quote (tramp-gvfs-url-file-name dd))))
(when rest-string
......@@ -1047,7 +1044,7 @@ file-notify events."
(tramp-message proc 6 "%S\n%s" proc string)
(setq string (concat rest-string string)
;; Attribute change is returned in unused wording.
string (tramp-compat-replace-regexp-in-string
string (replace-regexp-in-string
"ATTRIB CHANGED" "ATTRIBUTE_CHANGED" string))
(when (string-match "Monitoring not supported" string)
(delete-process proc))
......@@ -1060,7 +1057,7 @@ file-notify events."
string)
(let ((file (match-string 1 string))
(action (intern-soft
(tramp-compat-replace-regexp-in-string
(replace-regexp-in-string
"_" "-" (downcase (match-string 2 string))))))
(setq string (replace-match "" nil nil string))
;; File names are returned as URL paths. We must convert them.
......@@ -1079,12 +1076,12 @@ file-notify events."
;; Save rest of the string.
(when (zerop (length string)) (setq string nil))
(when string (tramp-message proc 10 "Rest string:\n%s" string))
(tramp-compat-process-put proc 'rest-string string)))
(process-put proc 'rest-string string)))
(defun tramp-gvfs-handle-file-readable-p (filename)
"Like `file-readable-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property v localname "file-executable-p"
(with-tramp-file-property v localname "file-readable-p"
(tramp-check-cached-permissions v ?r))))
(defun tramp-gvfs-handle-file-writable-p (filename)
......@@ -1125,7 +1122,8 @@ file-notify events."
(if (or (tramp-tramp-file-p filename)
(tramp-tramp-file-p newname))
(tramp-gvfs-do-copy-or-rename-file