emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master de8c5f9: Remove XEmacs compatibility in Tramp


From: Michael Albinus
Subject: [Emacs-diffs] master de8c5f9: Remove XEmacs compatibility in Tramp
Date: Thu, 14 Jan 2016 13:12:25 +0000

branch: master
commit de8c5f9db50a22ef5640bb83c0c7c755b78be895
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    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.
---
 doc/misc/tramp.texi      |  639 +++++++++++++---------------------------------
 doc/misc/trampver.texi   |   36 +--
 lisp/net/tramp-adb.el    |   70 ++----
 lisp/net/tramp-cache.el  |   45 +---
 lisp/net/tramp-cmds.el   |   35 +--
 lisp/net/tramp-compat.el |  499 +++++------------------------------
 lisp/net/tramp-ftp.el    |   29 +--
 lisp/net/tramp-gvfs.el   |   64 +++---
 lisp/net/tramp-gw.el     |   10 +-
 lisp/net/tramp-sh.el     |  324 +++++++----------------
 lisp/net/tramp-smb.el    |   68 ++---
 lisp/net/tramp.el        |  647 ++++++++++++----------------------------------
 lisp/net/trampver.el     |   47 ++--
 13 files changed, 665 insertions(+), 1848 deletions(-)

diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index eafd238..447498a 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -82,10 +82,10 @@ copy and modify this GNU manual.''
 @end copying
 
 @c Entries for @command{install-info} to use
address@hidden @value{emacsname} network features
address@hidden Emacs network features
 @direntry
 * TRAMP: (tramp).               Transparent Remote Access, Multiple Protocol
-                                  @value{emacsname} remote file access via ssh 
and scp.
+                                  Emacs remote file access via ssh and scp.
 @end direntry
 
 @titlepage
@@ -104,34 +104,20 @@ copy and modify this GNU manual.''
 @top @value{tramp} version @value{trampver} User Manual
 
 This file documents @value{tramp} version @value{trampver}, a remote file
-editing package for @value{emacsname}.
+editing package for Emacs.
 
 @value{tramp} stands for ``Transparent Remote (file) Access, Multiple
 Protocol''.  This package provides remote file editing, similar to
address@hidden
+Ange FTP.
 
-The difference is that @value{ftppackagename} uses FTP to transfer
-files between the local and the remote host, whereas @value{tramp} uses a
-combination of @command{rsh} and @command{rcp} or other work-alike
-programs, such as @command{ssh}/@command{scp}.
+The difference is that Ange FTP uses FTP to transfer files between the
+local and the remote host, whereas @value{tramp} uses a combination of
address@hidden and @command{rcp} or other work-alike programs, such as
address@hidden/@command{scp}.
 
 You can find the latest version of this document on the web at
 @uref{http://www.gnu.org/software/tramp/}.
 
address@hidden Pointer to the other Emacs flavor is necessary only in case of
address@hidden standalone installation.
address@hidden installchapter
-The manual has been generated for @value{emacsname}.
address@hidden
-If you want to read the info pages for @value{emacsothername}, you
-should read in @ref{Installation} how to create them.
address@hidden ifinfo
address@hidden
-If you're using the other Emacs flavor, you should read the
address@hidden@value{emacsotherfilename}, @value{emacsothername}} pages.
address@hidden ifhtml
address@hidden ifset
-
 @ifhtml
 The latest release of @value{tramp} is available for
 @uref{ftp://ftp.gnu.org/gnu/tramp/, download}, or you may see
@@ -168,7 +154,7 @@ For the end user:
 * Obtaining Tramp::             How to obtain @value{tramp}.
 * History::                     History of @value{tramp}.
 @ifset installchapter
-* Installation::                Installing @value{tramp} with your 
@value{emacsname}.
+* Installation::                Installing @value{tramp} with your Emacs.
 @end ifset
 * Configuration::               Configuring @value{tramp} for use.
 * Usage::                       An overview of the operation of @value{tramp}.
@@ -181,7 +167,6 @@ For the developer:
                                 How file names, directories and localnames
                                   are mangled and managed.
 * Traces and Profiles::         How to Customize Traces.
-* Issues::                      Debatable Issues and What Was Decided.
 
 * GNU Free Documentation License:: The license for this documentation.
 * Function Index::              @value{tramp} functions.
@@ -192,7 +177,7 @@ For the developer:
  --- The Detailed Node Listing ---
 @c
 @ifset installchapter
-Installing @value{tramp} with your @value{emacsname}
+Installing @value{tramp} with your Emacs
 
 * Installation parameters::     Parameters in order to control installation.
 * Load paths::                  How to plug-in @value{tramp} into your 
environment.
@@ -204,12 +189,8 @@ Configuring @value{tramp} for use
 * Connection types::            Types of connections to remote hosts.
 * Inline methods::              Inline methods.
 * External methods::            External methods.
address@hidden emacsgvfs
 * GVFS based methods::          GVFS based external methods.
address@hidden ifset
address@hidden emacsgw
 * Gateway methods::             Gateway methods.
address@hidden ifset
 * Default Method::              Selecting a default method.
 * Default User::                Selecting a default user.
 * Default Host::                Selecting a default host.
@@ -231,15 +212,13 @@ Using @value{tramp}
 * File name Syntax::            @value{tramp} file name conventions.
 * File name completion::        File name completion.
 * Ad-hoc multi-hops::           Declaring multiple hops in the file name.
-* Remote processes::            Integration with other @value{emacsname} 
packages.
+* Remote processes::            Integration with other Emacs packages.
 * Cleanup remote connections::  Cleanup remote connections.
 
 How file names, directories and localnames are mangled and managed
 
 * Localname deconstruction::    Breaking a localname into its components.
address@hidden emacs
 * External packages::           Integration with external Lisp packages.
address@hidden ifset
 
 @end detailmenu
 @end menu
@@ -250,10 +229,9 @@ How file names, directories and localnames are mangled and 
managed
 @cindex overview
 
 @value{tramp} is for transparently accessing remote files from within
address@hidden  @value{tramp} enables an easy, convenient, and
-consistent interface to remote files as if they are local files.
address@hidden's transparency extends to editing, version control, and
address@hidden
+Emacs.  @value{tramp} enables an easy, convenient, and consistent
+interface to remote files as if they are local files.  @value{tramp}'s
+transparency extends to editing, version control, and @code{dired}.
 
 @value{tramp} can access remote hosts using any number of access
 methods, such as @command{rsh}, @command{rlogin}, @command{telnet},
@@ -276,7 +254,7 @@ and transparent access.
 @value{tramp} temporarily transfers a remote file's contents to the
 local host editing and related operations.  @value{tramp} can also
 transfer files between hosts using standard Emacs interfaces, a
-benefit of direct integration of @value{tramp} in @value{emacsname}.
+benefit of direct integration of @value{tramp} in Emacs.
 
 @value{tramp} can transfer files using any number of available host
 programs for remote files, such as @command{rcp}, @command{scp},
@@ -310,8 +288,7 @@ first time connection to that host, here's what happens:
 @value{tramp} invokes @samp{telnet @var{host}} or @samp{rsh @var{host}
 -l @var{user}} and establishes an external process to connect to the
 remote host.  @value{tramp} communicates with the process through an
address@hidden buffer, which also shows output from the remote
-host.
+Emacs buffer, which also shows output from the remote host.
 
 @item
 The remote host may prompt for a login name (for @command{telnet}, for
@@ -389,7 +366,7 @@ behind the scenes when you open a file with @value{tramp}.
 
 @c For the end user
 @node Obtaining Tramp
address@hidden Obtaining Tramp.
address@hidden Obtaining @value{tramp}
 @cindex obtaining Tramp
 
 @value{tramp} is included as part of Emacs (since Emacs version 22.1).
@@ -411,7 +388,7 @@ navigation bar at the top.
 Another way is to follow the terminal session below:
 
 @example
-] @strong{cd ~/@value{emacsdir}}
+] @strong{cd ~/emacs}
 ] @strong{git clone git://git.savannah.gnu.org/tramp.git}
 @end example
 
@@ -431,14 +408,14 @@ Tramp developers:
 @end example
 
 @noindent
-After one of the above commands, @file{~/@value{emacsdir}/tramp} will
+After one of the above commands, @file{~/emacs/tramp} will
 containing the latest version of @value{tramp}.
 
 @noindent
 To fetch updates from the repository, use git pull:
 
 @example
-] @strong{cd ~/@value{emacsdir}/tramp}
+] @strong{cd ~/emacs/tramp}
 ] @strong{git pull}
 @end example
 
@@ -447,7 +424,7 @@ Run @command{autoconf} as follows to generate an up-to-date
 @file{configure} script:
 
 @example
-] @strong{cd ~/@value{emacsdir}/tramp}
+] @strong{cd ~/emacs/tramp}
 ] @strong{autoconf}
 @end example
 
@@ -467,23 +444,16 @@ for version control.
 April 2000 was the first time when multi-hop methods were added.  In
 July 2002, @value{tramp} unified file names with address@hidden  In July
 2004, proxy hosts replaced multi-hop methods.  Running commands on
-remote hosts was introduced in December 2005.
address@hidden emacsgw
-Support for gateways since April 2007.
address@hidden ifset
+remote hosts was introduced in December 2005.  Support for gateways
+since April 2007.
 @ifset emacsgvfs
 GVFS integration started in February 2009.
 @end ifset
address@hidden emacs
-Remote commands on Windows hosts since September 2011.
address@hidden ifset
-Ad-hoc multi-hop methods (with a changed syntax) re-enabled in November
-2011.
+Remote commands on Windows hosts since September 2011.  Ad-hoc
+multi-hop methods (with a changed syntax) re-enabled in November 2011.
 
 In November 2012, added Juergen Hoetzel's @file{tramp-adb.el}.
 
-In December 2001, XEmacs package repository adds @value{tramp}.
-
 
 @c Installation chapter is necessary only in case of standalone
 @c installation.  Text taken from trampinst.texi.
@@ -510,8 +480,8 @@ defaults to one of several other options, see 
(@pxref{Connection
 types}).
 
 @strong{Note} that some user options and variables described in these
-examples are not auto loaded by @value{emacsname}.  All examples
-require @value{tramp} is installed and loaded:
+examples are not auto loaded by Emacs.  All examples require
address@hidden is installed and loaded:
 
 @lisp
 (require 'tramp)
@@ -522,12 +492,8 @@ require @value{tramp} is installed and loaded:
 * Connection types::            Types of connections to remote hosts.
 * Inline methods::              Inline methods.
 * External methods::            External methods.
address@hidden emacsgvfs
 * GVFS based methods::          GVFS based external methods.
address@hidden ifset
address@hidden emacsgw
 * Gateway methods::             Gateway methods.
address@hidden ifset
 * Default Method::              Selecting a default method.
                                   Here we also try to help those who
                                   don't have the foggiest which method
@@ -592,7 +558,7 @@ Inline methods use the same login connection to transfer 
file
 contents.  Inline methods are quick and easy for small files.  They
 depend on the availability of suitable encoding and decoding programs
 on the remote host.  For local source and destination, @value{tramp}
-may use built-in equivalents of such programs in @value{emacsname}.
+may use built-in equivalents of such programs in Emacs.
 
 Inline methods can work in situations where an external transfer
 program is unavailable.  Inline methods also work when transferring
@@ -870,12 +836,8 @@ decode programs.
 @cindex ftp method
 
 When @value{tramp} uses @option{ftp}, it forwards requests to whatever
-ftp program is specified by @value{ftppackagename}.  This external
-program must be capable of servicing requests from @value{tramp}.
-
address@hidden xemacs
-This method works only for unified file names, see @ref{Issues}.
address@hidden ifset
+ftp program is specified by Ange FTP.  This external program must be
+capable of servicing requests from @value{tramp}.
 
 
 @item @address@hidden
@@ -883,8 +845,8 @@ This method works only for unified file names, see 
@ref{Issues}.
 @cindex smb method
 
 This is another non-native @value{tramp} method.  @command{smbclient}
-connects to any server supporting the SMB/CIFS protocol, such as MS Windows and
-Samba running on GNU/Linux.  Tests show this @value{tramp} method
+connects to any host with SMB/CIFS protocol, such as MS Windows and
+Samba Servers running on Unixes.  Tests show this @value{tramp} method
 works with MS Windows NT, MS Windows 2000, MS Windows XP, MS Windows
 Vista, and MS Windows 7.
 
@@ -938,9 +900,9 @@ uses the anonymous user (without prompting for password).  
This
 behavior is unlike other @value{tramp} methods, where local user name
 is substituted.
 
address@hidden method is unavailable if @value{emacsname} is run under a
-local user authentication context in MS Windows.  However such users
-can still access remote files using UNC file names instead of @value{tramp}:
address@hidden method is unavailable if Emacs is run under a local user
+authentication context in MS Windows.  However such users can still
+access remote files using UNC file names instead of @value{tramp}:
 
 @example
 //melancholia/daniel$$/.emacs
@@ -965,7 +927,7 @@ or the absolute path set in the variable 
@var{tramp-adb-program}.
 @value{tramp} connects to Android devices with @option{adb} only when
 the custom option @option{tramp-adb-connect-if-not-connected} is not
 @code{nil}.  Otherwise, the connection must be established outside
address@hidden
+Emacs.
 
 @value{tramp} does not require a host name part of the remote file
 name when a single Android device is connected to @command{adb}.
@@ -973,13 +935,13 @@ name when a single Android device is connected to 
@command{adb}.
 name.  @command{adb devices} shows available host names.
 
 @option{adb} method normally does not need user name to authenticate
-on the Android device because it runs under the @command{adbd}
+on the Andriod device because it runs under the @command{adbd}
 process.  But when a user name is specified, however, @value{tramp}
 applies an @command{su} in the syntax.  When authentication does not
 succeed, especially on un-rooted Android devices, @value{tramp}
 displays login errors.
 
-For Android devices connected through TCP/IP, a port number can be
+For Andriod devices connected through TCP/IP, a port number can be
 specified using @file{device#42} host name syntax or @value{tramp} can
 use the default value as declared in @command{adb} command.  Port
 numbers are not applicable to Android devices connected through address@hidden
@@ -999,9 +961,9 @@ GVFS is the virtual file system for the Gnome Desktop,
 mounted locally through FUSE and @value{tramp} uses this locally
 mounted directory internally.
 
address@hidden uses the D-Bus mechanism to communicate with address@hidden
address@hidden must have the message bus system, D-Bus integration
-active, @pxref{Top, , D-Bus, dbus}.
+Emacs uses the D-Bus mechanism to communicate with address@hidden  Emacs must
+have the message bus system, D-Bus integration active, @pxref{Top, ,
+D-Bus, dbus}.
 
 @table @asis
 @item @option{afp}
@@ -1060,7 +1022,6 @@ include are: @option{ftp} and @option{smb}.
 @end ifset
 
 
address@hidden emacsgw
 @node Gateway methods
 @section Gateway methods
 @cindex methods, gateway
@@ -1105,7 +1066,6 @@ The default port number for the socks server is 
@option{1080}, if not
 specified otherwise.
 
 @end table
address@hidden ifset
 
 
 @node Default Method
@@ -1229,9 +1189,9 @@ See the documentation for the variable 
@code{tramp-default-user-alist}
 for more details.
 
 A Caution: @value{tramp} will override any default user specified in
-the configuration files outside @value{emacsname}, such as
address@hidden/.ssh/config}.  To stop @value{tramp} from applying the default
-value, set the corresponding alist entry to nil:
+the configuration files outside Emacs, such as @file{~/.ssh/config}.
+To stop @value{tramp} from applying the default value, set the
+corresponding alist entry to nil:
 
 @lisp
 (add-to-list 'tramp-default-user-alist
@@ -1254,9 +1214,9 @@ for catch-all or most often used login.
 @vindex tramp-default-host-alist
 
 When host name is omitted, @value{tramp} substitutes the value from
-the @code{tramp-default-host} variable.  It is initially populated with
-the local hostname where @value{emacsname} is running.  Both the
-default user and default host can be overridden as follows:
+the @code{tramp-default-host} variable.  It is initially populated
+with the local hostname where Emacs is running.  Both the default user
+and default host can be overridden as follows:
 
 @lisp
 (setq tramp-default-user "john"
@@ -1266,10 +1226,8 @@ default user and default host can be overridden as 
follows:
 With both defaults set, @address@hidden, , ,}} will connect
 @value{tramp} to John's home directory on target.
 
address@hidden emacs
 @strong{Note} @samp{/::} won't work, because @samp{/:} is the prefix
 for quoted file names.
address@hidden ifset
 
 Instead of a single default host, @code{tramp-default-host-alist}
 allows multiple default host values based on access method or user
@@ -1308,13 +1266,8 @@ regular expression which always matches.
 @var{proxy} is a literal @value{tramp} file name whose local name part
 is ignored, and the method and user name parts are optional.
 
address@hidden emacsgw
 The method must be an inline or gateway method (@pxref{Inline
 methods}, @pxref{Gateway methods}).
address@hidden ifset
address@hidden emacsgw
-The method must be an inline method (@pxref{Inline methods}).
address@hidden ifclear
 If @var{proxy} is @code{nil}, no additional hop is required reaching
 @var{user}@@@var{host}.
 
@@ -1378,7 +1331,6 @@ local one, first connect via @command{ssh}, and then apply
 The above configuration allows @value{tramp} connection as @samp{root}
 to remote Ubuntu hosts.
 
address@hidden emacsgw
 @code{tramp-default-proxies-alist} is also used for passing through
 firewalls or proxy servers.
 
@@ -1399,7 +1351,6 @@ discussion of ethical issues.}  Then the configuration is:
 @end lisp
 
 Gateway methods in a multiple hop chain can be declared only as the first hop.
address@hidden ifset
 @end defopt
 
 Passing through hops involves dealing with restricted shells, such as
@@ -1598,9 +1549,8 @@ the same user or host name independent of the access 
method.
 
 @code{password-cache-expiry} sets the duration (in seconds) the
 passwords are remembered.  Passwords are never saved permanently nor
-can they extend beyond the lifetime of the current @value{emacsname}
-session.  Set @code{password-cache-expiry} to @code{nil} to disable
-expiration.
+can they extend beyond the lifetime of the current Emacs session.  Set
address@hidden to @code{nil} to disable expiration.
 
 @vindex password-cache
 
@@ -1608,8 +1558,8 @@ Set @code{password-cache} to @code{nil} to disable 
password caching.
 
 @strong{Implementation Note}: password caching depends on
 @file{password-cache.el} package.  @value{tramp} activates password
-caching only if @value{tramp} can discover, while @value{emacsname} is
-loading, the package through @code{load-path}.
+caching only if @value{tramp} can discover, while Emacs is loading,
+the package through @code{load-path}.
 
 @ifset installchapter
 @file{password.el} is available from No Gnus or from the @value{tramp}
@@ -1626,17 +1576,12 @@ For faster initial connection times, @value{tramp} 
stores previous
 connection properties in a file specified by the variable
 @code{tramp-persistency-file-name}.
 
-The default file name for @code{tramp-persistency-file-name} is:
address@hidden emacs
+The default file name for @code{tramp-persistency-file-name} is
 @file{~/.emacs.d/tramp}.
address@hidden ifset
address@hidden xemacs
address@hidden/.xemacs/tramp}.
address@hidden ifset
 
address@hidden reads this file during @value{emacsname} startup, and
-writes to it when exiting @value{emacsname}.  Delete this file for
address@hidden to recreate a new one on next @value{emacsname} startup.
address@hidden reads this file during Emacs startup, and writes to it
+when exiting Emacs.  Delete this file for @value{tramp} to recreate a
+new one on next Emacs startup.
 
 Set @code{tramp-persistency-file-name} to @code{nil} to disable
 storing connections persistently.
@@ -1754,8 +1699,8 @@ preserves the path value, which can be used to update
 
 When remote search paths are changed, local @value{tramp} caches must
 be recomputed.  To force @value{tramp} to recompute afresh, exit
address@hidden, remove the persistent file (@pxref{Connection
-caching}), and restart @value{emacsname}.
+Emacs, remove the persistent file (@pxref{Connection caching}), and
+restart Emacs.
 
 
 @node Remote shell setup
@@ -1926,9 +1871,7 @@ fi
 @end example
 
 @ifinfo
address@hidden emacs
address@hidden Shell, , , @value{emacsdir}}.
address@hidden ifset
address@hidden Shell, , , emacs}.
 @end ifinfo
 
 @item @command{busybox} / @command{nc}
@@ -1965,7 +1908,7 @@ where @samp{192.168.0.1} is the remote host IP address
 
 @value{tramp} uses the @option{adb} method to access Android
 devices.  Android devices provide a restricted shell access through an
-USB connection.  The local host must have the Android SDK installed.
+USB connection.  The local host must have Andriod SDK installed.
 
 Applications such as @code{SSHDroid} that run @command{sshd} process
 on the Android device can accept any @option{ssh}-based methods
@@ -2034,61 +1977,34 @@ Open a remote connection with a more concise command 
@kbd{C-x C-f
 @section Auto-save and Backup configuration
 @cindex auto-save
 @cindex backup
address@hidden emacs
 @vindex backup-directory-alist
address@hidden ifset
address@hidden xemacs
address@hidden bkup-backup-directory-info
address@hidden ifset
 
 To avoid @value{tramp} from saving backup files owned by root to
 locations accessible to others, default backup settings in
address@hidden emacs
address@hidden
address@hidden ifset
address@hidden xemacs
address@hidden
address@hidden ifset
-have to be altered.
-
-Here's a scenario where files could be inadvertently
-exposed.  @value{emacsname} by default writes backup files to the same
-directory as the original files unless changed to another location,
-such as @file{~/.emacs.d/backups/}.  Such a directory will also be used
-by default by @value{tramp} when using, say, a restricted file
address@hidden@trampfn{su, root, localhost, /etc/secretfile}}.  The backup file
-of the secretfile is now owned by the user logged in from tramp and
-not root.
-
-When
address@hidden emacs
address@hidden
address@hidden ifset
address@hidden xemacs
address@hidden
address@hidden ifset
-is @code{nil} (the default), such problems do not occur.
address@hidden have to be altered.
+
+Here's a scenario where files could be inadvertently exposed.  Emacs
+by default writes backup files to the same directory as the original
+files unless changed to another location, such as
address@hidden/.emacs.d/backups/}.  Such a directory will also be used by
+default by @value{tramp} when using, say, a restricted file
address@hidden@trampfn{su, root, localhost, /etc/secretfile}}.  The backup
+file of the secretfile is now owned by the user logged in from tramp
+and not root.
+
+When @code{backup-directory-alist} is @code{nil} (the default), such
+problems do not occur.
 
 To ``turns off'' the backup feature for @value{tramp} files and stop
 @value{tramp} from saving to the backup directory, use this:
 
address@hidden emacs
 @lisp
 (add-to-list 'backup-directory-alist
              (cons tramp-file-name-regexp nil))
 @end lisp
address@hidden ifset
address@hidden xemacs
address@hidden
-(require 'backup-dir)
-(add-to-list 'bkup-backup-directory-info
-             (list tramp-file-name-regexp ""))
address@hidden lisp
address@hidden ifset
 
address@hidden emacs
 @noindent
-Disabling backups can be targeted to just the @option{su} and
+Disabling backups can be targetted to just @option{su} and
 @option{sudo} methods:
 
 @lisp
@@ -2100,26 +2016,13 @@ Disabling backups can be targeted to just the 
@option{su} and
                 (when (stringp method)
                   (member method '("su" "sudo"))))))))
 @end lisp
address@hidden ifset
 
 Another option is to create better backup file naming with user and
 host names prefixed to the file name.  For example, transforming
 @file{/etc/secretfile} to
 @file{~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile}, set the
address@hidden variable
address@hidden emacs
address@hidden
address@hidden ifset
address@hidden xemacs
address@hidden
address@hidden ifset
-from the existing variable
address@hidden emacs
address@hidden
address@hidden ifset
address@hidden xemacs
address@hidden
address@hidden ifset
address@hidden variable @code{tramp-backup-directory-alist} from the
+existing variable @code{backup-directory-alist}.
 
 Then @value{tramp} backs up to a file name that is transformed with a
 prefix consisting of the DIRECTORY name.  This file name prefixing
@@ -2128,53 +2031,30 @@ happens only when the DIRECTORY is an absolute local 
file name.
 @noindent
 Example:
 
address@hidden emacs
 @lisp
 (add-to-list 'backup-directory-alist
              (cons "." "~/.emacs.d/backups/"))
 (setq tramp-backup-directory-alist backup-directory-alist)
 @end lisp
address@hidden ifset
address@hidden xemacs
address@hidden
-(require 'backup-dir)
-(add-to-list 'bkup-backup-directory-info
-             (list "." "~/.emacs.d/backups/" 'full-path))
-(setq tramp-bkup-backup-directory-info bkup-backup-directory-info)
address@hidden lisp
address@hidden ifset
 
 @noindent
 The backup file name of @address@hidden, root, localhost,
-/etc/secretfile}} would be
address@hidden emacs
address@hidden@trampfn{su, root, localhost,
+/etc/secretfile}} would be @address@hidden, root, localhost,
 ~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}}
address@hidden ifset
address@hidden xemacs
address@hidden@trampfn{su, root, localhost,
-~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}}
address@hidden ifset
 
 Just as for backup files, similar issues of file naming affect
-auto-saving @value{tramp} files.
address@hidden emacs
-Auto-saved files are saved in the directory specified by the variable
+auto-saving @value{tramp} files.  Auto-saved files are saved in the
+directory specified by the variable
 @code{auto-save-file-name-transforms}.  By default this is set to the
 local temporary directory.  But in some versions of Debian GNU/Linux,
-this points to the source directory where the @value{emacsname} was
-compiled.   Reset such values to a valid directory.
+this points to the source directory where the Emacs was compiled.
+Reset such values to a valid directory.
 
 Set @code{auto-save-file-name-transforms} to @code{nil} to save
 auto-saved files to the same directory as the original file.
 
 Alternatively, set the variable @code{tramp-auto-save-directory} to
 direct all auto saves to that location.
address@hidden ifset
address@hidden xemacs
address@hidden can also be used here instead of other
-locations specified above.
address@hidden ifset
 
 @node Windows setup hints
 @section Issues with Cygwin ssh
@@ -2185,9 +2065,9 @@ This section is incomplete.  Please share your solutions.
 @cindex method sshx with Cygwin
 @cindex sshx method with Cygwin
 
-Cygwin's @command{ssh} works only with a Cygwin version of
address@hidden  To check for compatibility: type @kbd{M-x eshell}, and
-start @kbd{ssh test.host}.  Incompatibilities trigger this message:
+Cygwin's @command{ssh} works only with a Cygwin version of Emacs.  To
+check for compatibility: type @kbd{M-x eshell}, and start @kbd{ssh
+test.host}.  Incompatbilities trigger this message:
 
 @example
 Pseudo-terminal will not be allocated because stdin is not a terminal.
@@ -2201,7 +2081,7 @@ Some older versions of Cygwin's @command{ssh} work with 
the
 @cindex method scpx with Cygwin
 @cindex scpx method with Cygwin
 
-When using the @option{scpx} access method, @value{emacsname} may call
+When using the @option{scpx} access method, Emacs may call
 @command{scp} with Windows file naming, such as @code{c:/foo}.  But
 the version of @command{scp} that is installed with Cygwin does not
 know about Windows file naming, which causes it to incorrectly look
@@ -2211,18 +2091,17 @@ A workaround: write a wrapper script for @option{scp} 
to convert
 Windows file names to Cygwin file names.
 
 @cindex Cygwin and ssh-agent
address@hidden SSH_AUTH_SOCK and @value{emacsname} on Windows
address@hidden SSH_AUTH_SOCK and Emacs on Windows
 
 When using the @command{ssh-agent} on Windows for password-less
 interaction, @option{ssh} methods depend on the environment variable
address@hidden  But this variable is not set when
address@hidden is started from a Desktop shortcut and
-authentication fails.
address@hidden  But this variable is not set when Emacs is
+started from a Desktop shortcut and authentication fails.
 
 One workaround is to use a Windows based SSH Agent, such as
 Pageant.  It is part of the Putty Suite of tools.
 
-The fallback is to start @value{emacsname} from a shell.
+The fallback is to start Emacs from a shell.
 
 
 @node Usage
@@ -2233,27 +2112,24 @@ The fallback is to start @value{emacsname} from a shell.
 they are local.  However, @value{tramp} employs a formalized remote
 file naming syntax to perform its functions transparently.  This
 syntax consists of many parts specifying access methods,
-authentication, host names, and file names.
address@hidden emacs
address@hidden uses a similar syntax.
address@hidden ifset
+authentication, host names, and file names.  Ange FTP uses a similar
+syntax.
 
 @cindex type-ahead
 
-Unlike opening local files in @value{emacsname}, which are
-instantaneous, opening remote files in @value{tramp} is slower at
-first.  Sometimes there is a noticeable delay before the prompts for
-passwords or authentication appear in the minibuffer.  Hitting
address@hidden@key{RET}} or other keys during this gap will be processed by
address@hidden  This type-ahead facility is a feature of
address@hidden that may cause missed prompts when using
+Unlike opening local files in Emacs, which are instantaneous, opening
+remote files in @value{tramp} is slower at first.  Sometimes there is
+a noticable delay before the prompts for passwords or authentication
+appear in the minibuffer.  Hitting @address@hidden or other keys
+during this gap will be processed by Emacs.  This type-ahead facility
+is a feature of Emacs that may cause missed prompts when using
 @value{tramp}.
 
 @menu
 * File name Syntax::            @value{tramp} file name conventions.
 * File name completion::        File name completion.
 * Ad-hoc multi-hops::           Declaring multiple hops in the file name.
-* Remote processes::            Integration with other @value{emacsname} 
packages.
+* Remote processes::            Integration with other Emacs packages.
 * Cleanup remote connections::  Cleanup remote connections.
 @end menu
 
@@ -2291,11 +2167,9 @@ For the file @file{/etc/squid.conf} on the host 
@code{melancholia}.
 
 @var{host} can take IPv4 or IPv6 address, as in @address@hidden, ,
 127.0.0.1, .emacs}} or @address@hidden, ,
address@hidden::address@hidden, .emacs}}.
address@hidden emacs
-For syntactical reasons, IPv6 addresses must be embedded in square
-brackets @address@hidden and @address@hidden
address@hidden ifset
address@hidden::address@hidden, .emacs}}.  For syntactical
+reasons, IPv6 addresses must be embedded in square brackets
address@hidden@value{ipv6prefix}} and @address@hidden
 
 By default, @value{tramp} will use the current local user name as the
 remote user name for log in to the remote host.  Specifying a different
@@ -2312,17 +2186,10 @@ name using the proper syntax will override this default 
behavior:
 Specify other file access methods (@pxref{Inline methods},
 @pxref{External methods}) as part of the file name.
 
address@hidden emacs
 Method name comes before user name, as in
 @address@hidden@address@hidden (Note the trailing
-colon).
address@hidden ifset
address@hidden xemacs
-This is done by replacing the initial @address@hidden with
address@hidden@address@hidden@value{postfixhop}} (Note the trailing
-slash!).
address@hidden ifset
-The syntax specifications for user, host, and file do not change.
+colon).  The syntax specificaton for user, host, and file do not
+change.
 
 To connect to the host @code{melancholia} as @code{daniel}, using
 @option{ssh} method for @file{.emacs} in @code{daniel}'s home
@@ -2343,13 +2210,11 @@ name.  For example: @address@hidden, daniel, 
melancholia#42,
 
 @value{tramp} can complete the following @value{tramp} file name
 components: method names, user names, host names, and file names
-located on remote hosts.
address@hidden emacs
-Enable this by activating partial completion in @file{.emacs}.
+located on remote hosts.  Enable this by activating partial completion
+in @file{.emacs}.
 @ifinfo
address@hidden Options, , , @value{emacsdir}}.
address@hidden Options, , , emacs}.
 @end ifinfo
address@hidden ifset
 
 For example, type @kbd{C-x C-f @value{prefix}t @key{TAB}},
 @value{tramp} completion choices show up as
@@ -2357,24 +2222,17 @@ For example, type @kbd{C-x C-f @value{prefix}t 
@key{TAB}},
 @example
 @c @multitable address@hidden, , melancholia.danann.net,}} address@hidden, , 
192.168.0.1,}}
 @multitable @columnfractions .5 .5
address@hidden emacs
 @item @address@hidden @tab tmp/
 @item @address@hidden @tab
address@hidden ifset
address@hidden xemacs
address@hidden @address@hidden @tab @address@hidden
address@hidden ifset
 @end multitable
 @end example
 
address@hidden@address@hidden
-is a possible completion for the respective method,
address@hidden emacs
address@hidden/} stands for the directory @file{/tmp} on your local host,
address@hidden ifset
-and @address@hidden@value{postfix}}
-might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts}
-file (when using @option{ssh} as default method).
address@hidden@address@hidden is a possible
+completion for the respective method, @samp{tmp/} stands for the
+directory @file{/tmp} on your local host, and
address@hidden@address@hidden might be a host
address@hidden has detected in your @file{~/.ssh/known_hosts} file
+(when using @option{ssh} as default method).
 
 Type @kbd{e @key{TAB}} for the minibuffer completion to
 @address@hidden@value{postfixhop}}.  Typing @address@hidden
@@ -2400,21 +2258,18 @@ persistently (@pxref{Connection caching}) will be 
included in the
 completion lists.
 
 After remote host name completion comes completion of file names on
-the remote host.  It works the same as with local host file completion,
-except that killing with double-slash @file{//} kills only the file
-name part of the @value{tramp} file name syntax.
address@hidden emacs
-A triple-slash stands for the default behavior.
address@hidden ifset
+the remote host.  It works the same as on loal host file completion
+except when killing with double-slash @file{//} kills only the file
+name part of the @value{tramp} file name syntax.  A triple-slash
+stands for the default behavior.
 @ifinfo
address@hidden File, , , @value{emacsdir}}.
address@hidden File, , , emacs}.
 @end ifinfo
 
 @noindent
 Example:
 
 @example
address@hidden emacs
 @kbd{C-x C-f @trampfn{telnet, , melancholia, /usr/local/bin//etc} @key{TAB}}
      @print{} @trampfn{telnet, , melancholia, /etc}
 
@@ -2423,22 +2278,13 @@ Example:
 
 @kbd{C-x C-f @trampfn{telnet, , melancholia, /usr/local/bin///etc} @key{TAB}}
      @print{} /etc
address@hidden ifset
-
address@hidden xemacs
address@hidden C-f @trampfn{telnet, , melancholia, /usr/local/bin//}}
-     @print{} @trampfn{telnet, , melancholia, /}
-
address@hidden C-f @trampfn{telnet, , melancholia, //}}
-     @print{} /
address@hidden ifset
 @end example
 
 During file name completion, remote directory contents are re-read
 regularly to account for any changes in the filesystem that may affect
 the completion candidates.  Such re-reads can account for changes to
-the file system by applications outside @value{emacsname}
-(@pxref{Connection caching}).
+the file system by applications outside Emacs (@pxref{Connection
+caching}).
 
 @defopt tramp-completion-reread-directory-timeout
 @vindex tramp-completion-reread-directory-timeout
@@ -2473,15 +2319,15 @@ Proxies can take patterns @code{%h} or @code{%u}.
 
 @value{tramp} adds the ad-hoc definitions on the fly to
 @code{tramp-default-proxies-alist} and is available for re-use during
-that @value{emacsname} session.  Subsequent @value{tramp} connections
-to the same remote host can then use the shortcut form:
address@hidden@trampfn{ssh, you, remotehost, /path}}.
+that Emacs session.  Subsequent @value{tramp} connections to the same
+remote host can then use the shortcut form: @address@hidden, you,
+remotehost, /path}}.
 
 @defopt tramp-save-ad-hoc-proxies
 @vindex tramp-save-ad-hoc-proxies
 For ad-hoc definitions to be saved automatically in
address@hidden for future @value{emacsname}
-sessions, set @option{tramp-save-ad-hoc-proxies}.
address@hidden for future Emacs sessions, set
address@hidden
 
 @lisp
 (setq tramp-save-ad-hoc-proxies t)
@@ -2490,14 +2336,13 @@ sessions, set @option{tramp-save-ad-hoc-proxies}.
 
 
 @node Remote processes
address@hidden Integration with other @value{emacsname} packages
address@hidden Integration with other Emacs packages
 @cindex compile
 @cindex recompile
 
 @value{tramp} supports starting new running processes on the remote
-host for discovering remote file names.  @value{emacsname} packages on
-the remote host need no specific modifications for @value{tramp}'s
-use.
+host for discovering remote file names.  Emacs packages on the remote
+host need no specific modifications for @value{tramp}'s use.
 
 This type of integration does not work with the @option{ftp} method,
 and does not support the pty association as specified in
@@ -2580,8 +2425,8 @@ them as follows:
 This works only for environment variables not already set in the
 @code{process-environment}.
 
-For integrating other @value{emacsname} packages so @value{tramp} can
-execute remotely, please file a bug report.  @xref{Bug Reports}.
+For integrating other Emacs packages so @value{tramp} can execute
+remotely, please file a bug report.  @xref{Bug Reports}.
 
 
 @subsection Running remote programs that create local X11 windows
@@ -2616,11 +2461,9 @@ when using @value{tramp} between two hosts with 
different operating
 systems, such as @samp{windows-nt} and @samp{gnu/linux}.  This option
 ensures the correct name of the remote shell program.
 
address@hidden emacs
 Starting with Emacs 24, when @option{explicit-shell-file-name} is
 equal to @code{nil}, calling @code{shell} interactively will prompt
 for a shell name.
address@hidden ifset
 
 
 @subsection Running @code{shell-command} on a remote host
@@ -2638,9 +2481,7 @@ host.  Example:
 @command{tail} command outputs continuously to the local buffer,
 @file{*Async Shell Command*}
 
address@hidden emacs
 @kbd{M-x auto-revert-tail-mode} runs similarly showing continuous output.
address@hidden ifset
 
 
 @subsection Running @code{eshell} on a remote host
@@ -2663,9 +2504,8 @@ uid=0(root) gid=0(root) groups=0(root)
 @address@hidden, root, host, /etc} $}
 @end example
 
address@hidden emacs
address@hidden in @value{emacsname} 23.2 added custom @code{su} and
address@hidden commands that set the default directory correctly for the
address@hidden in Emacs 23.2 added custom @code{su} and @code{sudo}
+commands that set the default directory correctly for the
 @file{*eshell*} buffer.  @value{tramp} silently updates
 @code{tramp-default-proxies-alist} with an entry for this directory
 (@pxref{Multi-hops}):
@@ -2682,7 +2522,6 @@ File is not readable: @trampfn{ssh, user, remotehost, 
/etc/shadow}
 uid=0(root) gid=0(root) groups=0(root)
 @address@hidden, root, remotehost, /root} $}
 @end example
address@hidden ifset
 
 
 @anchor{Running a debugger on a remote host}
@@ -2692,11 +2531,9 @@ uid=0(root) gid=0(root) groups=0(root)
 @cindex perldb
 
 @file{gud.el} provides a unified interface to symbolic debuggers
address@hidden emacs
 @ifinfo
-(@ref{Debuggers, , , @value{emacsdir}}).
+(@ref{Debuggers, , , emacs}).
 @end ifinfo
address@hidden ifset
 @value{tramp} can run debug on remote hosts by calling @code{gdb}
 with a remote file name:
 
@@ -2807,11 +2644,9 @@ To subscribe to the mailing list, visit:
 @uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/, the
 @value{tramp} Mail Subscription Page}.
 
address@hidden emacs
 @ifset installchapter
 Before sending a bug report, run the test suite first @ref{Testing}.
 @end ifset
address@hidden ifset
 
 @findex tramp-bug
 Check if the bug or problem is already addressed in @xref{Frequently
@@ -2870,8 +2705,7 @@ Where is the latest @value{tramp}?
 @item
 Which systems does it work on?
 
-The package works successfully on Emacs 22, Emacs 23, Emacs 24, Emacs
-25, XEmacs 21 (starting with 21.4), and SXEmacs 22.
+The package works successfully on Emacs 23, Emacs 24, and Emacs 25.
 
 While Unix and Unix-like systems are the primary remote targets,
 @value{tramp} has equal success connecting to other platforms, such as
@@ -3019,9 +2853,9 @@ Host *
 
 @value{tramp} overwrites @code{ControlPath} settings when initiating
 @command{ssh} sessions.  @value{tramp} does this to fend off a stall
-if a master session opened outside the @value{emacsname} session is no
-longer open.  That is why @value{tramp} prompts for the password again
-even if there is an @command{ssh} already open.
+if a master session opened outside the Emacs session is no longer
+open.  That is why @value{tramp} prompts for the password again even
+if there is an @command{ssh} already open.
 
 Some @command{ssh} versions support a @code{ControlPersist} option,
 which allows to set the @code{ControlPath} provided the variable
@@ -3081,8 +2915,8 @@ When testing, ensure the remote shell is the same shell
 @item
 How to get notified after @value{tramp} completes file transfers?
 
-Make @value{emacsname} beep after reading from or writing to the
-remote host with the following code in @file{~/.emacs} file.
+Make Emacs beep after reading from or writing to the remote host with
+the following code in @file{~/.emacs} file.
 
 @lisp
 (defadvice tramp-handle-write-region
@@ -3105,13 +2939,12 @@ remote host with the following code in @file{~/.emacs} 
file.
 @end lisp
 
 
address@hidden emacs
 @item
 How to get a Visual Warning when working with @samp{root} privileges
 
 Get a modeline indication when working with @samp{root} privileges
-with the following code (tested with @value{emacsname} 22.1) in
address@hidden/.emacs} file:
+with the following code (tested with Emacs 22.1) in @file{~/.emacs}
+file:
 
 @lisp
 (defun my-mode-line-function ()
@@ -3122,15 +2955,13 @@ with the following code (tested with @value{emacsname} 
22.1) in
 (add-hook 'find-file-hook 'my-mode-line-function)
 (add-hook 'dired-mode-hook 'my-mode-line-function)
 @end lisp
address@hidden ifset
 
 
address@hidden emacs
 @item
 How to get host indication in the mode line?
 
-The following code (tested with @value{emacsname} 22.1) in
address@hidden/.emacs} file shows it:
+The following code (tested with Emacs 22.1) in @file{~/.emacs} file
+shows it:
 
 @lisp
 (defconst my-mode-line-buffer-identification
@@ -3158,11 +2989,11 @@ The following code (tested with @value{emacsname} 22.1) 
in
     my-mode-line-buffer-identification)))
 @end lisp
 
-The mode line in @value{emacsname} 23.1 and later versions now
-contains an indication if @code{default-directory} for the current
-buffer is on a remote host.  Moreover, the corresponding tool-tip
-shows the remote host name.  The above @code{:eval} clause can also be
-simplified to show the host name in the mode line:
+The mode line in Emacs 23.1 and later versions now contains an
+indication if @code{default-directory} for the current buffer is on a
+remote host.  Moreover, the corresponding tool-tip shows the remote
+host name.  The above @code{:eval} clause can also be simplified to
+show the host name in the mode line:
 
 @lisp
    '(:eval
@@ -3173,16 +3004,14 @@ simplified to show the host name in the mode line:
            (substring host-name 0 (match-beginning 1))
          host-name)))
 @end lisp
address@hidden ifset
 
 
address@hidden emacs
 @item
 Remote host does not understand default options for directory listing
 
address@hidden computes the @command{dired} options based on the
-local host but if the remote host cannot understand the same
address@hidden command, then set them with a hook as follows:
+Emacs computes the @command{dired} options based on the local host but
+if the remote host cannot understand the same @command{ls} command,
+then set them with a hook as follows:
 
 @lisp
 (add-hook
@@ -3191,7 +3020,6 @@ local host but if the remote host cannot understand the 
same
    (when (file-remote-p default-directory)
      (setq dired-actual-switches "-al"))))
 @end lisp
address@hidden ifset
 
 
 @item
@@ -3270,8 +3098,8 @@ completion can further reduce key strokes: @kbd{C-x C-f
 Use environment variables to expand long strings
 
 For long file names, set up environment variables that are expanded in
-the minibuffer.  Environment variables are set either outside
address@hidden or inside @value{emacsname} with Lisp:
+the minibuffer.  Environment variables are set either outside Emacs or
+inside Emacs with Lisp:
 
 @lisp
 (setenv "xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")
@@ -3285,7 +3113,7 @@ minibuffer.
 
 @item Define own keys:
 
-Redefine another key sequence in @value{emacsname} for @kbd{C-x C-f}:
+Redefine another key sequence in Emacs for @kbd{C-x C-f}:
 
 @lisp
 (global-set-key
@@ -3355,70 +3183,32 @@ The minibuffer expands for further editing.
 
 Use bookmarks to save Tramp file names.
 @ifinfo
address@hidden, , , @value{emacsdir}}.
address@hidden, , , emacs}.
 @end ifinfo
 
 Upon visiting a location with @value{tramp}, save it as a bookmark with
address@hidden emacs
 @address@hidden @key{edit} @key{bookmarks} @key{set}}.
address@hidden ifset
address@hidden xemacs
address@hidden@key{menu-bar} @key{view} @key{bookmarks} @key{set}}.
address@hidden ifset
 
 To revisit that bookmark:
address@hidden emacs
 @address@hidden @key{edit} @key{bookmarks} @key{jump}}.
address@hidden ifset
address@hidden xemacs
address@hidden@key{menu-bar} @key{view} @key{bookmarks} @key{jump}}.
address@hidden ifset
 
 @item Use recent files:
 
address@hidden emacs
address@hidden
address@hidden ifset
address@hidden xemacs
address@hidden
address@hidden ifset
-remembers visited places.
address@hidden remembers visited places.
 @ifinfo
address@hidden emacs
address@hidden Conveniences, , , @value{emacsdir}}.
address@hidden ifset
address@hidden xemacs
address@hidden, , , edit-utils}.
address@hidden ifset
address@hidden Conveniences, , , emacs}.
 @end ifinfo
 
 Keep remote file names in the recent list without have to check for
 their accessibility through remote access:
 
 @lisp
address@hidden emacs
 (recentf-mode 1)
address@hidden ifset
address@hidden xemacs
-(recent-files-initialize)
-(add-hook
- 'find-file-hook
- (lambda ()
-   (when (file-remote-p (buffer-file-name))
-     (recent-files-make-permanent)))
- 'append)
address@hidden ifset
 @end lisp
 
-Reaching recently opened files:
address@hidden emacs
address@hidden@key{menu-bar} @key{file} @key{Open Recent}}.
address@hidden ifset
address@hidden xemacs
address@hidden@key{menu-bar} @key{Recent Files}}.
address@hidden ifset
+Reaching recently opened files: @address@hidden @key{file}
address@hidden Recent}}.
 
address@hidden emacs
 @item Use filecache:
 
 Since @file{filecache} remembers visited places, add the remote
@@ -3432,18 +3222,16 @@ directory to the cache:
 
 Then use directory completion in the minibuffer with @kbd{C-x C-f
 address@hidden
address@hidden ifset
 
address@hidden emacs
 @item Use bbdb:
 
address@hidden has a built-in feature for @value{ftppackagename} files,
-which also works for @value{tramp} file names.
address@hidden has a built-in feature for Ange FTP files, which also
+works for @value{tramp} file names.
 @ifinfo
 @pxref{bbdb-ftp, Storing FTP sites in the BBDB, , bbdb}.
 @end ifinfo
 
-Load @file{bbdb} in @value{emacs}:
+Load @file{bbdb} in Emacs:
 
 @lisp
 (require 'bbdb)
@@ -3463,24 +3251,19 @@ a method and user name where needed.  Examples:
 @end example
 
 In BBDB buffer, access an entry by pressing the key @key{F}.
address@hidden ifset
 
 @end enumerate
 
 Thanks to @value{tramp} users for contributing to these recipes.
 
 @item
-Why saved multi-hop file names do not work in a new @value{emacsname}
-session?
+Why saved multi-hop file names do not work in a new Emacs session?
 
 When saving ad-hoc multi-hop @value{tramp} file names (@pxref{Ad-hoc
-multi-hops}) via bookmarks, recent files,
address@hidden emacs
-filecache, bbdb,
address@hidden ifset
-or another package, use the full ad-hoc file name including all hops,
-like @address@hidden, bird,
-bastion|address@hidden, /opt/news/etc}}.
+multi-hops}) via bookmarks, recent files, filecache, bbdb, or another
+package, use the full ad-hoc file name including all hops, like
address@hidden@trampfn{ssh, bird, bastion|address@hidden,
+/opt/news/etc}}.
 
 Alternatively, when saving abbreviated multi-hop file names
 @address@hidden, news, news.my.domain, /opt/news/etc}}, the custom
@@ -3488,13 +3271,12 @@ option @code{tramp-save-ad-hoc-proxies} must be set 
address@hidden
 value.
 
 
address@hidden emacs
 @item
-How to connect to a remote @value{emacsname} session using @value{tramp}?
+How to connect to a remote Emacs session using @value{tramp}?
 
 Configure Emacs Client
 @ifinfo
-(@pxref{Emacs Server, , , @value{emacsdir}}).
+(@pxref{Emacs Server, , , emacs}).
 @end ifinfo
 
 Then on the remote host, start the Emacs Server:
@@ -3535,7 +3317,6 @@ wrapper script:
 @example
 export EDITOR=/path/to/emacsclient.sh
 @end example
address@hidden ifset
 
 
 @item
@@ -3572,35 +3353,25 @@ Disable remote directory tracking mode:
 How to disable @value{tramp}?
 
 @itemize @minus
address@hidden emacs
 @item
-To keep @value{ftppackagename} as default the remote files access
-package, set this in @file{.emacs}:
+To keep Ange FTP as default the remote files access package, set this
+in @file{.emacs}:
 
 @lisp
 (setq tramp-default-method "ftp")
 @end lisp
address@hidden ifset
 
 @item
-To disable both
address@hidden emacs
address@hidden (and @value{ftppackagename}),
address@hidden ifset
address@hidden xemacs
address@hidden,
address@hidden ifset
-set @code{tramp-mode} to @code{nil} in @file{.emacs}.
+To disable both @value{tramp} (and Ange FTP), set @code{tramp-mode} to
address@hidden in @file{.emacs}.
 
 @lisp
 (setq tramp-mode nil)
 @end lisp
 
 @item
-To unload @value{tramp}, type @kbd{M-x tramp-unload-tramp}.
address@hidden emacs
-Unloading @value{tramp} resets @value{ftppackagename} plugins also.
address@hidden ifset
+To unload @value{tramp}, type @kbd{M-x tramp-unload-tramp}.  Unloading
address@hidden resets Ange FTP plugins also.
 @end itemize
 @end itemize
 
@@ -3611,9 +3382,7 @@ Unloading @value{tramp} resets @value{ftppackagename} 
plugins also.
 
 @menu
 * Localname deconstruction::    Splitting a localname into its component parts.
address@hidden emacs
 * External packages::           Integrating with external Lisp packages.
address@hidden ifset
 @end menu
 
 
@@ -3631,7 +3400,6 @@ file name.  By relying on the original handlers for 
localnames,
 handlers.
 
 
address@hidden emacs
 @node External packages
 @section Integrating with external Lisp packages
 @subsection File name completion.
@@ -3689,7 +3457,6 @@ attributes cache in its process sentinel with this code:
 Since @value{tramp} traverses subdirectories starting with the
 root-directory, it is most likely sufficient to make the
 @code{default-directory} of the process buffer as the root directory.
address@hidden ifset
 
 
 @node Traces and Profiles
@@ -3720,7 +3487,7 @@ set the @code{tramp-verbose} level to 6 (@pxref{Bug 
Reports}).
 
 The debug buffer is in
 @ifinfo
address@hidden Mode, , , @value{emacsdir}}.
address@hidden Mode, , , emacs}.
 @end ifinfo
 @ifnotinfo
 Outline Mode.
@@ -3729,7 +3496,7 @@ In this buffer, messages can be filtered by their level.  
To see
 messages up to verbosity level 5, enter @kbd{C-u 6 C-c C-q}.
 @ifinfo
 Other navigation keys are described in
address@hidden Visibility, , , @value{emacsdir}}.
address@hidden Visibility, , , emacs}.
 @end ifinfo
 
 @value{tramp} handles errors internally.  But to get a Lisp backtrace,
@@ -3757,62 +3524,6 @@ call traces.  Disable @code{tramp-read-passwd} and
 being written to @file{*trace-output*}.
 
 
address@hidden Issues
address@hidden Debatable Issues and What Was Decided
-
address@hidden @bullet
address@hidden The uuencode method does not always work.
-
address@hidden on some systems cannot write to stdout, but
address@hidden depends on encoding and decoding programs to be able to
-read from stdin and write to stdout.
-
-We can find ways to circumvent @command{uudecode}'s ability to write
-to stdout, such as writing to a temporary file and then piping that to
-stdout.
-
-But I have decided not to implement workarounds as they are too
-fragile to work reliably.  Some on systems, @value{tramp} will not have
-uuencode method.
-
address@hidden The @value{tramp} file name syntax differs between Emacs and 
XEmacs.
-
-The Emacs maintainers wish to use a unified file name syntax for
-Ange-FTP and @value{tramp} so that users don't have to learn yet
-another syntax though it is okay to learn new extensions.
-
-For the XEmacs maintainers, the disruption from a unified file name
-syntax are not worth the gains.  Firstly, the XEmacs package system
-relies on EFS for downloading new packages and therefore is already
-installed.  On the other hand, @value{tramp} is not installed by
-default in XEmacs.  Unifying will require @value{tramp} installed from
-the start.
-
address@hidden xemacs
address@hidden:} To make the syntax similar to @value{ftppackagename},
-make this change to the init file:
-
address@hidden
-(setq tramp-unified-filenames t)
-(require 'tramp)
address@hidden lisp
-
-To disable auto loading @value{emacsname} @value{tramp} package, set
-file permissions of
address@hidden@dots{}/xemacs-packages/lisp/tramp/auto-autoloads.el*} to
address@hidden
-
-When using unified file names, @value{emacsname} download sites are
-added to @code{tramp-default-method-alist} with default method of
address@hidden @xref{Default Method} for proper working of the
address@hidden package system.
-
-The syntax for unified file names is described in the @value{tramp} manual
-for @value{emacsothername}.
address@hidden ifset
address@hidden itemize
-
-
 @node GNU Free Documentation License
 @appendix GNU Free Documentation License
 @include doclicense.texi
diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi
index 0cdf08d..7093817 100644
--- a/doc/misc/trampver.texi
+++ b/doc/misc/trampver.texi
@@ -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.
address@hidden trampver 2.2.13.25.1
address@hidden 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.
address@hidden tramp @sc{tramp}
address@hidden tramp @sc{Tramp}
 
 @c Whether or not describe GVFS integration.
 @ifclear noemacsgvfs
 @set emacsgvfs
 @end ifclear
 
address@hidden Whether or not describe gateway methods.
address@hidden noemacsgw
address@hidden emacsgw
address@hidden ifclear
-
address@hidden Some flags which make the text independent on the (X)Emacs 
flavor.
address@hidden "emacs" resp "xemacs" are set in the Makefile.  Default is 
"emacs".
address@hidden emacs
address@hidden xemacs
address@hidden emacs
address@hidden Some flags which define the remote file name syntax.
address@hidden unified
address@hidden separate
address@hidden unified
 @end ifclear
 @end ifclear
 
address@hidden Emacs values.
address@hidden emacs
address@hidden emacsname          Emacs
address@hidden emacsdir           emacs
address@hidden ftppackagename     Ange-FTP
address@hidden unified
 @set prefix             /
 @set prefixhop
 @set postfix            :
 @set postfixhop         :
 @set ipv6prefix         [
 @set ipv6postfix        ]
address@hidden emacsothername     XEmacs
address@hidden emacsotherdir      xemacs
address@hidden emacsotherfilename tramp-xemacs.html
 @end ifset
 
address@hidden XEmacs counterparts.
address@hidden xemacs
address@hidden emacsname          XEmacs
address@hidden emacsdir           xemacs
address@hidden ftppackagename     EFS
address@hidden separate
 @set prefix             /[
 @set prefixhop          [
 @set postfix            ]
 @set postfixhop         /
 @set ipv6prefix
 @set ipv6postfix
address@hidden emacsothername     Emacs
address@hidden emacsotherdir      emacs
address@hidden emacsotherfilename tramp-emacs.html
 @end ifset
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index dbd1318..d0a5c52 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -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 ()
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 26825ff..92f66f4 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -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)
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index e714e4f..f9b66d4 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -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))
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 44923ae..f1f31d0 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -23,9 +23,8 @@
 
 ;;; Commentary:
 
-;; Tramp's main Emacs version for development is Emacs 24.  This
-;; package provides compatibility functions for Emacs 22, Emacs 23,
-;; XEmacs 21.4+ and SXEmacs 22.
+;; Tramp's main Emacs version for development is Emacs 25.  This
+;; package provides compatibility functions for Emacs 23 and Emacs 24.
 
 ;;; Code:
 
@@ -33,164 +32,57 @@
 (eval-when-compile
   (require 'cl))
 
-(eval-and-compile
-
-  ;; GNU Emacs 22.
-  (unless (fboundp 'ignore-errors)
-    (load "cl" 'noerror)
-    (load "cl-macs" 'noerror))
-
-  ;; 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 'time-date))
-
-  (require 'advice)
-  (require 'custom)
-  (require 'format-spec)
-  (require 'shell)
-  ;; Introduced in Emacs 23.2.
-  (require 'ucs-normalize nil 'noerror)
-
-  (require 'trampver)
-  (require 'tramp-loaddefs)
-
-  ;; As long as password.el is not part of (X)Emacs, it shouldn't be
-  ;; mandatory.
-  (if (featurep 'xemacs)
-      (load "password" 'noerror)
-    (or (require 'password-cache nil 'noerror)
-       (require 'password nil 'noerror))) ; Part of contrib.
-
-  ;; auth-source is relatively new.
-  (if (featurep 'xemacs)
-      (load "auth-source" 'noerror)
-    (require 'auth-source nil 'noerror))
-
-  ;; Load the appropriate timer package.
-  (if (featurep 'xemacs)
-      (require 'timer-funcs)
-    (require 'timer))
-
-  ;; Avoid byte-compiler warnings if the byte-compiler supports this.
-  ;; Currently, XEmacs supports this.
-  (when (featurep 'xemacs)
-    (unless (boundp 'byte-compile-default-warnings)
-      (defvar byte-compile-default-warnings nil))
-    (delq 'unused-vars byte-compile-default-warnings))
-
-  ;; `last-coding-system-used' is unknown in XEmacs.
-  (unless (boundp 'last-coding-system-used)
-    (defvar last-coding-system-used nil))
-
-  ;; `directory-sep-char' is an obsolete variable in Emacs.  But it is
-  ;; used in XEmacs, so we set it here and there.  The following is
-  ;; needed to pacify Emacs byte-compiler.
-  ;; Note that it was removed altogether in Emacs 24.1.
-  (when (boundp 'directory-sep-char)
-    (defvar byte-compile-not-obsolete-var nil)
-    (setq byte-compile-not-obsolete-var 'directory-sep-char)
-    ;; Emacs 23.2.
-    (defvar byte-compile-not-obsolete-vars nil)
-    (setq byte-compile-not-obsolete-vars '(directory-sep-char)))
-
-  ;; `remote-file-name-inhibit-cache' has been introduced with Emacs 24.1.
-  ;; Besides t, nil, and integer, we use also timestamps (as
-  ;; returned by `current-time') internally.
-  (unless (boundp 'remote-file-name-inhibit-cache)
-    (defvar remote-file-name-inhibit-cache nil))
-
-  ;; For not existing functions, or functions with a changed argument
-  ;; list, there are compiler warnings.  We want to avoid them in
-  ;; cases we know what we do.
-  (defmacro tramp-compat-funcall (function &rest arguments)
-    (if (featurep 'xemacs)
-       `(funcall (symbol-function ,function) ,@arguments)
-      `(when (or (subrp ,function) (functionp ,function))
-        (with-no-warnings (funcall ,function ,@arguments)))))
-
-  ;; `set-buffer-multibyte' comes from Emacs Leim.
-  (unless (fboundp 'set-buffer-multibyte)
-    (defalias 'set-buffer-multibyte 'ignore))
-
-  ;; The following functions cannot be aliases of the corresponding
-  ;; `tramp-handle-*' functions, because this would bypass the locking
-  ;; mechanism.
-
-  ;; `process-file' does not exist in XEmacs.
-  (unless (fboundp 'process-file)
-    (defalias 'process-file
-      (lambda (program &optional infile buffer display &rest args)
-       (when (tramp-tramp-file-p default-directory)
-         (apply
-          'tramp-file-name-handler
-          'process-file program infile buffer display args)))))
-
-  ;; `start-file-process' is new in Emacs 23.
-  (unless (fboundp 'start-file-process)
-    (defalias 'start-file-process
-      (lambda (name buffer program &rest program-args)
-       (when (tramp-tramp-file-p default-directory)
-         (apply
-          'tramp-file-name-handler
-          'start-file-process name buffer program program-args)))))
-
-  ;; `set-file-times' is also new in Emacs 23.
-  (unless (fboundp 'set-file-times)
-    (defalias 'set-file-times
-      (lambda (filename &optional time)
-       (when (tramp-tramp-file-p filename)
-         (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
-  ;; wildcards if `find-file-wildcards' is non-nil, and then barfs
-  ;; because no expansion could be found.  We detect this situation
-  ;; and do something really awful: we have `file-expand-wildcards'
-  ;; return the original filename if it can't expand anything.  Let's
-  ;; just hope that this doesn't break anything else.
-  ;; It is not needed anymore since GNU Emacs 23.2.
-  (unless (or (featurep 'xemacs)
-             ;; `featurep' has only one argument in XEmacs.
-             (funcall 'featurep 'files 'remote-wildcards))
-    (defadvice file-expand-wildcards
+(require 'auth-source)
+(require 'advice)
+(require 'custom)
+(require 'format-spec)
+(require 'password-cache)
+(require 'shell)
+(require 'timer)
+(require 'ucs-normalize)
+
+(require 'trampver)
+(require 'tramp-loaddefs)
+
+;; `remote-file-name-inhibit-cache' has been introduced with Emacs
+;; 24.1.  Besides t, nil, and integer, we use also timestamps (as
+;; returned by `current-time') internally.
+(unless (boundp 'remote-file-name-inhibit-cache)
+  (defvar remote-file-name-inhibit-cache nil))
+
+;; For not existing functions, or functions with a changed argument
+;; list, there are compiler warnings.  We want to avoid them in cases
+;; we know what we do.
+(defmacro tramp-compat-funcall (function &rest arguments)
+  `(when (or (subrp ,function) (functionp ,function))
+     (with-no-warnings (funcall ,function ,@arguments))))
+
+;; We currently use "[" and "]" in the filename format for IPv6 hosts
+;; of GNU Emacs.  This means that Emacs wants to expand wildcards if
+;; `find-file-wildcards' is non-nil, and then barfs because no
+;; expansion could be found.  We detect this situation and do
+;; something really awful: we have `file-expand-wildcards' return the
+;; original filename if it can't expand anything.  Let's just hope
+;; that this doesn't break anything else.  It is not needed anymore
+;; since GNU Emacs 23.2.
+(unless (featurep 'files 'remote-wildcards)
+  (defadvice file-expand-wildcards
       (around tramp-advice-file-expand-wildcards activate)
-      (let ((name (ad-get-arg 0)))
-       ;; If it's a Tramp file, look if wildcards need to be expanded
-       ;; at all.
-       (if (and
-            (tramp-tramp-file-p name)
-            (not (string-match
-                  "[[*?]" (tramp-compat-funcall
-                           'file-remote-p name 'localname))))
-           (setq ad-return-value (list name))
-         ;; Otherwise, just run the original function.
-         ad-do-it)))
-    (add-hook
-     'tramp-unload-hook
-     (lambda ()
-       (ad-remove-advice
-       'file-expand-wildcards 'around 'tramp-advice-file-expand-wildcards)
-       (ad-activate 'file-expand-wildcards))))
-
-  ;; `redisplay' does not exist in XEmacs.
-  (unless (fboundp 'redisplay)
-    (defalias 'redisplay 'ignore)))
-
-;; `with-temp-message' does not exist in XEmacs.
-(if (fboundp 'with-temp-message)
-    (defalias 'tramp-compat-with-temp-message 'with-temp-message)
-  (defmacro tramp-compat-with-temp-message (_message &rest body)
-    "Display MESSAGE temporarily if non-nil while BODY is evaluated."
-    `(progn ,@body)))
+    (let ((name (ad-get-arg 0)))
+      ;; If it's a Tramp file, look if wildcards need to be expanded
+      ;; at all.
+      (if (and
+          (tramp-tramp-file-p name)
+          (not (string-match "[[*?]" (file-remote-p name 'localname))))
+         (setq ad-return-value (list name))
+       ;; Otherwise, just run the original function.
+       ad-do-it)))
+  (add-hook
+   'tramp-unload-hook
+   (lambda ()
+     (ad-remove-advice
+      'file-expand-wildcards 'around 'tramp-advice-file-expand-wildcards)
+     (ad-activate 'file-expand-wildcards))))
 
 ;; `condition-case-unless-debug' is introduced with Emacs 24.
 (if (fboundp 'condition-case-unless-debug)
@@ -208,105 +100,23 @@
               (funcall ,bodysym)
             ,@handlers))))))
 
-;; `font-lock-add-keywords' does not exist in XEmacs.
-(defun tramp-compat-font-lock-add-keywords (mode keywords &optional how)
-  "Add highlighting KEYWORDS for MODE."
-  (ignore-errors
-    (tramp-compat-funcall 'font-lock-add-keywords mode keywords how)))
-
 (defsubst tramp-compat-temporary-file-directory ()
-  "Return name of directory for temporary files (compat function).
-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
-     ((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")))
-     ((let ((d (getenv "TMP"))) (and d (file-directory-p d)))
-      (file-name-as-directory (getenv "TMP")))
-     ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d)))
-      (file-name-as-directory (getenv "TMPDIR")))
-     ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp"))
-     (t (message (concat "Neither `temporary-file-directory' nor "
-                        "`temp-directory' is defined -- using /tmp."))
-       (file-name-as-directory "/tmp")))))
-
-;; `make-temp-file' exists in Emacs only.  On XEmacs, we use our own
-;; implementation with `make-temp-name', creating the temporary file
-;; immediately in order to avoid a security hole.
+  "Return name of directory for temporary files.
+It is the default value of `temporary-file-directory'."
+  ;; We must return a local directory.  If it is remote, we could run
+  ;; into an infloop.
+  (eval (car (get 'temporary-file-directory 'standard-value))))
+
 (defsubst tramp-compat-make-temp-file (f &optional dir-flag)
-  "Create a temporary file (compat function).
+  "Create a local temporary file (compat function).
 Add the extension of F, if existing."
   (let* (file-name-handler-alist
         (prefix (expand-file-name
                  (symbol-value 'tramp-temp-name-prefix)
                  (tramp-compat-temporary-file-directory)))
-        (extension (file-name-extension f t))
-        result)
-    (condition-case nil
-       (setq result
-             (tramp-compat-funcall 'make-temp-file prefix dir-flag extension))
-      (error
-       ;; We use our own implementation, taken from files.el.
-       (while
-          (condition-case ()
-              (progn
-                (setq result (concat (make-temp-name prefix) extension))
-                (if dir-flag
-                    (make-directory result)
-                  (write-region "" nil result nil 'silent))
-                nil)
-            (file-already-exists t))
-        ;; The file was somehow created by someone else between
-        ;; `make-temp-name' and `write-region', let's try again.
-        nil)))
-    result))
-
-;; `most-positive-fixnum' does not exist in XEmacs.
-(defsubst tramp-compat-most-positive-fixnum ()
-  "Return largest positive integer value (compat function)."
-  (cond
-   ((boundp 'most-positive-fixnum) (symbol-value 'most-positive-fixnum))
-   ;; Default value in XEmacs.
-   (t 134217727)))
-
-(defun tramp-compat-decimal-to-octal (i)
-  "Return a string consisting of the octal digits of I.
-Not actually used.  Use `(format \"%o\" i)' instead?"
-  (cond ((< i 0) (error "Cannot convert negative number to octal"))
-        ((not (integerp i)) (error "Cannot convert non-integer to octal"))
-        ((zerop i) "0")
-        (t (concat (tramp-compat-decimal-to-octal (/ i 8))
-                   (number-to-string (% i 8))))))
-
-;; Kudos to Gerd Moellmann for this suggestion.
-(defun tramp-compat-octal-to-decimal (ostr)
-  "Given a string of octal digits, return a decimal number."
-  (let ((x (or ostr "")))
-    ;; `save-match' is in `tramp-mode-string-to-int' which calls this.
-    (unless (string-match "\\`[0-7]*\\'" x)
-      (error "Non-octal junk in string `%s'" x))
-    (string-to-number ostr 8)))
-
-;; ID-FORMAT does not exist in XEmacs.
-(defun tramp-compat-file-attributes (filename &optional id-format)
-  "Like `file-attributes' for Tramp files (compat function)."
-  (cond
-   ((or (null id-format) (eq id-format 'integer))
-    (file-attributes filename))
-   ((tramp-tramp-file-p filename)
-    (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))))))
-
-;; PRESERVE-UID-GID does not exist in XEmacs.
+        (extension (file-name-extension f t)))
+    (make-temp-file prefix dir-flag extension)))
+
 ;; PRESERVE-EXTENDED-ATTRIBUTES has been introduced with Emacs 24.1
 ;; (as PRESERVE-SELINUX-CONTEXT), and renamed in Emacs 24.3.
 (defun tramp-compat-copy-file
@@ -320,21 +130,13 @@ Not actually used.  Use `(format \"%o\" i)' instead?"
         'copy-file filename newname ok-if-already-exists keep-date
         preserve-uid-gid preserve-extended-attributes)
       (wrong-number-of-arguments
-       (tramp-compat-copy-file
+       (copy-file
        filename newname ok-if-already-exists keep-date preserve-uid-gid))))
-   (preserve-uid-gid
-    (condition-case nil
-       (tramp-compat-funcall
-        'copy-file filename newname ok-if-already-exists keep-date
-        preserve-uid-gid)
-      (wrong-number-of-arguments
-       (tramp-compat-copy-file
-       filename newname ok-if-already-exists keep-date))))
    (t
-    (copy-file filename newname ok-if-already-exists keep-date))))
+    (copy-file
+     filename newname ok-if-already-exists keep-date preserve-uid-gid))))
 
-;; `copy-directory' is a new function in Emacs 23.2.  Implementation
-;; is taken from there.
+;; COPY-CONTENTS has been introduced with Emacs 24.1.
 (defun tramp-compat-copy-directory
   (directory newname &optional keep-time parents copy-contents)
   "Make a copy of DIRECTORY (compat function)."
@@ -401,12 +203,10 @@ Not actually used.  Use `(format \"%o\" i)' instead?"
       (cond
        (trash
        (tramp-compat-funcall 'delete-directory directory recursive trash))
-       (recursive
-       (tramp-compat-funcall 'delete-directory directory recursive))
        (t
-       (delete-directory directory)))
-    ;; This Emacs version does not support the RECURSIVE or TRASH flag.  We
-    ;; use the implementation from Emacs 23.2.
+       (delete-directory directory recursive)))
+    ;; This Emacs version does not support the TRASH flag.  We use the
+    ;; implementation from Emacs 23.2.
     (wrong-number-of-arguments
      (setq directory (directory-file-name (expand-file-name directory)))
      (if (not (file-symlink-p directory))
@@ -418,42 +218,6 @@ Not actually used.  Use `(format \"%o\" i)' instead?"
                directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
      (delete-directory directory))))
 
-;; MUST-SUFFIX doesn't exist on XEmacs.
-(defun tramp-compat-load (file &optional noerror nomessage nosuffix 
must-suffix)
-  "Like `load' for Tramp files (compat function)."
-  (if must-suffix
-      (tramp-compat-funcall 'load file noerror nomessage nosuffix must-suffix)
-    (load file noerror nomessage nosuffix)))
-
-;; `number-sequence' does not exist in XEmacs.  Implementation is
-;; taken from Emacs 23.
-(defun tramp-compat-number-sequence (from &optional to inc)
-  "Return a sequence of numbers from FROM to TO as a list (compat function)."
-  (if (or (subrp 'number-sequence) (symbol-file 'number-sequence))
-      (tramp-compat-funcall 'number-sequence from to inc)
-    (if (or (not to) (= from to))
-       (list from)
-      (or inc (setq inc 1))
-      (when (zerop inc) (error "The increment can not be zero"))
-      (let (seq (n 0) (next from))
-       (if (> inc 0)
-           (while (<= next to)
-             (setq seq (cons next seq)
-                   n (1+ n)
-                   next (+ from (* n inc))))
-         (while (>= next to)
-           (setq seq (cons next seq)
-                 n (1+ n)
-                 next (+ from (* n inc)))))
-       (nreverse seq)))))
-
-(defun tramp-compat-split-string (string pattern)
-  "Like `split-string' but omit empty strings.
-In Emacs, (split-string \"/foo/bar\" \"/\") returns (\"foo\" \"bar\").
-This is, the first, empty, element is omitted.  In XEmacs, the first
-element is not omitted."
-  (delete "" (split-string string pattern)))
-
 (defun tramp-compat-process-running-p (process-name)
   "Returns t if system process PROCESS-NAME is running for `user-login-name'."
   (when (stringp process-name)
@@ -466,7 +230,7 @@ element is not omitted."
      ((and (fboundp 'list-system-processes) (fboundp 'process-attributes))
       (let (result)
        (dolist (pid (tramp-compat-funcall 'list-system-processes) result)
-         (let ((attributes (tramp-compat-funcall 'process-attributes pid)))
+         (let ((attributes (process-attributes pid)))
            (when (and (string-equal
                         (cdr (assoc 'user attributes)) (user-login-name))
                        (let ((comm (cdr (assoc 'comm attributes))))
@@ -476,135 +240,16 @@ element is not omitted."
                          (and comm (string-match
                                     (concat "^" (regexp-quote comm))
                                     process-name))))
-             (setq result t))))))
-
-     ;; Fallback, if there is no Lisp support yet.
-     (t (let ((default-directory
-               (if (tramp-tramp-file-p default-directory)
-                   (tramp-compat-temporary-file-directory)
-                 default-directory))
-             (unix95 (getenv "UNIX95"))
-             result)
-         (setenv "UNIX95" "1")
-         (when (member
-                (user-login-name)
-                (tramp-compat-split-string
-                 (shell-command-to-string
-                  (format "ps -C %s -o user=" process-name))
-                 "[ \f\t\n\r\v]+"))
-           (setq result t))
-         (setenv "UNIX95" unix95)
-         result)))))
-
-;; The following functions do not exist in XEmacs.  We ignore this;
-;; they are used for checking a remote tty.
-(defun tramp-compat-process-get (process propname)
-  "Return the value of PROCESS' PROPNAME property.
-This is the last value stored with `(process-put PROCESS PROPNAME VALUE)'."
-  (ignore-errors (tramp-compat-funcall 'process-get process propname)))
-
-(defun tramp-compat-process-put (process propname value)
-  "Change PROCESS' PROPNAME property to VALUE.
-It can be retrieved with `(process-get PROCESS PROPNAME)'."
-  (ignore-errors (tramp-compat-funcall 'process-put process propname value)))
-
-(defun tramp-compat-set-process-query-on-exit-flag (process flag)
-  "Specify if query is needed for process when Emacs is exited.
-If the second argument flag is non-nil, Emacs will query the user before
-exiting if process is running."
-  (if (fboundp 'set-process-query-on-exit-flag)
-      (tramp-compat-funcall 'set-process-query-on-exit-flag process flag)
-    (tramp-compat-funcall 'process-kill-without-query process flag)))
-
-;; There exist different implementations for this function.
-(defun tramp-compat-coding-system-change-eol-conversion (coding-system 
eol-type)
-  "Return a coding system like CODING-SYSTEM but with given EOL-TYPE.
-EOL-TYPE can be one of `dos', `unix', or `mac'."
-  (cond ((fboundp 'coding-system-change-eol-conversion)
-         (tramp-compat-funcall
-         'coding-system-change-eol-conversion coding-system eol-type))
-        ((fboundp 'subsidiary-coding-system)
-         (tramp-compat-funcall
-         'subsidiary-coding-system coding-system
-         (cond ((eq eol-type 'dos) 'crlf)
-               ((eq eol-type 'unix) 'lf)
-               ((eq eol-type 'mac) 'cr)
-               (t (error
-                   "Unknown EOL-TYPE `%s', must be `dos', `unix', or `mac'"
-                   eol-type)))))
-        (t (error "Can't change EOL conversion -- is MULE missing?"))))
-
-;; `replace-regexp-in-string' does not exist in XEmacs.
-;; Implementation is taken from Emacs 24.
-(if (fboundp 'replace-regexp-in-string)
-    (defalias 'tramp-compat-replace-regexp-in-string 'replace-regexp-in-string)
-  (defun tramp-compat-replace-regexp-in-string
-    (regexp rep string &optional fixedcase literal subexp start)
-    "Replace all matches for REGEXP with REP in STRING.
-
-Return a new string containing the replacements.
-
-Optional arguments FIXEDCASE, LITERAL and SUBEXP are like the
-arguments with the same names of function `replace-match'.  If START
-is non-nil, start replacements at that index in STRING.
-
-REP is either a string used as the NEWTEXT arg of `replace-match' or a
-function.  If it is a function, it is called with the actual text of each
-match, and its value is used as the replacement text.  When REP is called,
-the match data are the result of matching REGEXP against a substring
-of STRING.
-
-To replace only the first match (if any), make REGEXP match up to \\'
-and replace a sub-expression, e.g.
-  (replace-regexp-in-string \"\\\\(foo\\\\).*\\\\'\" \"bar\" \" foo foo\" nil 
nil 1)
-    => \" bar foo\""
-
-    (let ((l (length string))
-         (start (or start 0))
-         matches str mb me)
-      (save-match-data
-       (while (and (< start l) (string-match regexp string start))
-         (setq mb (match-beginning 0)
-               me (match-end 0))
-         ;; If we matched the empty string, make sure we advance by one char
-         (when (= me mb) (setq me (min l (1+ mb))))
-         ;; Generate a replacement for the matched substring.
-         ;; Operate only on the substring to minimize string consing.
-         ;; Set up match data for the substring for replacement;
-         ;; presumably this is likely to be faster than munging the
-         ;; match data directly in Lisp.
-         (string-match regexp (setq str (substring string mb me)))
-         (setq matches
-               (cons (replace-match (if (stringp rep)
-                                        rep
-                                      (funcall rep (match-string 0 str)))
-                                    fixedcase literal str subexp)
-                     (cons (substring string start mb) ; unmatched prefix
-                           matches)))
-         (setq start me))
-       ;; Reconstruct a string from the pieces.
-       (setq matches (cons (substring string start l) matches)) ; leftover
-       (apply #'concat (nreverse matches))))))
+             (setq result t)))))))))
 
 ;; `default-toplevel-value' has been declared in Emacs 24.
 (unless (fboundp 'default-toplevel-value)
   (defalias 'default-toplevel-value 'symbol-value))
 
-;; `format-message' is new in Emacs 25, and does not exist in XEmacs.
+;; `format-message' is new in Emacs 25.
 (unless (fboundp 'format-message)
   (defalias 'format-message 'format))
 
-;; `delete-dups' does not exist in XEmacs 21.4.
-(if (fboundp 'delete-dups)
-    (defalias 'tramp-compat-delete-dups 'delete-dups)
-  (defun tramp-compat-delete-dups (list)
-  "Destructively remove `equal' duplicates from LIST.
-Store the result in LIST and return it.  LIST must be a proper list.
-Of several `equal' occurrences of an element in LIST, the first
-one is kept."
-  (tramp-compat-funcall
-   'cl-delete-duplicates list '(:test equal :from-end) nil)))
-
 (add-hook 'tramp-unload-hook
          (lambda ()
            (unload-feature 'tramp-loaddefs 'force)
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el
index 902b0a4..caca3c0 100644
--- a/lisp/net/tramp-ftp.el
+++ b/lisp/net/tramp-ftp.el
@@ -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 ()
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 0379acc..46bf3de 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -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
-       'rename filename newname ok-if-already-exists t t)
+       'rename filename newname ok-if-already-exists
+       'keep-date 'preserve-uid-gid)
     (tramp-run-real-handler
      'rename-file (list filename newname ok-if-already-exists))))
 
@@ -1133,8 +1131,7 @@ file-notify events."
   (start end filename &optional append visit lockname confirm)
   "Like `write-region' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    ;; XEmacs takes a coding system as the seventh argument, not `confirm'.
-    (when (and (not (featurep 'xemacs)) confirm (file-exists-p filename))
+    (when (and confirm (file-exists-p filename))
       (unless (y-or-n-p (format "File %s exists; overwrite anyway? " filename))
        (tramp-error v 'file-error "File not overwritten")))
 
@@ -1203,8 +1200,7 @@ file-notify events."
 (defun tramp-gvfs-file-name (object-path)
   "Retrieve file name from D-Bus OBJECT-PATH."
   (dbus-unescape-from-identifier
-   (tramp-compat-replace-regexp-in-string
-    "^.*/\\([^/]+\\)$" "\\1" object-path)))
+   (replace-regexp-in-string "^.*/\\([^/]+\\)$" "\\1" object-path)))
 
 (defun tramp-bluez-address (device)
   "Return bluetooth device address from a given bluetooth DEVICE name."
@@ -1293,7 +1289,7 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or 
\"[xx:xx:xx:xx:xx:xx]\"."
            ;; host signature.
            (with-temp-buffer
              ;; Preserve message for `progress-reporter'.
-             (tramp-compat-with-temp-message ""
+             (with-temp-message ""
                (insert message)
                (pop-to-buffer (current-buffer))
                (setq choice (if (yes-or-no-p (concat (car choices) " ")) 0 1))
@@ -1533,7 +1529,7 @@ connection if a previous connection has died for some 
reason."
              :name (tramp-buffer-name vec)
              :buffer (tramp-get-connection-buffer vec)
              :server t :host 'local :service t)))
-      (tramp-compat-set-process-query-on-exit-flag p nil)))
+      (set-process-query-on-exit-flag p nil)))
 
   (unless (tramp-gvfs-connection-mounted-p vec)
     (let* ((method (tramp-file-name-method vec))
@@ -1751,7 +1747,7 @@ This uses \"avahi-browse\" in case D-Bus is not enabled 
in Avahi."
            'split-string
            (shell-command-to-string (format "avahi-browse -trkp %s" service))
            "[\n\r]+" 'omit "^\\+;.*$"))))
-    (tramp-compat-delete-dups
+    (delete-dups
      (mapcar
       (lambda (x)
        (let* ((list (split-string x ";"))
diff --git a/lisp/net/tramp-gw.el b/lisp/net/tramp-gw.el
index f868bea..a1ddceb 100644
--- a/lisp/net/tramp-gw.el
+++ b/lisp/net/tramp-gw.el
@@ -108,7 +108,7 @@
      tramp-gw-vector 4
      "Opening auxiliary process `%s', speaking with process `%s'"
      proc tramp-gw-gw-proc)
-    (tramp-compat-set-process-query-on-exit-flag proc nil)
+    (set-process-query-on-exit-flag proc nil)
     ;; We don't want debug messages, because the corresponding debug
     ;; buffer might be undecided.
     (let ((tramp-verbose 0))
@@ -158,7 +158,7 @@ instead of the host name declared in TARGET-VEC."
             :name (tramp-buffer-name aux-vec) :buffer nil :host 'local
             :server t :noquery t :service t :coding 'binary))
       (set-process-sentinel tramp-gw-aux-proc 'tramp-gw-aux-proc-sentinel)
-      (tramp-compat-set-process-query-on-exit-flag tramp-gw-aux-proc nil)
+      (set-process-query-on-exit-flag tramp-gw-aux-proc nil)
       (tramp-message
        vec 4 "Opening auxiliary process `%s', listening on port %d"
        tramp-gw-aux-proc (process-contact tramp-gw-aux-proc :service))))
@@ -204,7 +204,7 @@ instead of the host name declared in TARGET-VEC."
           (tramp-file-name-port target-vec)))
     (set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel)
     (set-process-coding-system tramp-gw-gw-proc 'binary 'binary)
-    (tramp-compat-set-process-query-on-exit-flag tramp-gw-gw-proc nil)
+    (set-process-query-on-exit-flag tramp-gw-gw-proc nil)
     (tramp-message
      vec 4 "Opened %s process `%s'"
      (case gw-method ('tunnel "HTTP tunnel") ('socks "SOCKS"))
@@ -235,14 +235,14 @@ authentication is requested from proxy server, provide 
it."
       (setq proc (open-network-stream
                  name buffer (nth 1 socks-server) (nth 2 socks-server)))
       (set-process-coding-system proc 'binary 'binary)
-      (tramp-compat-set-process-query-on-exit-flag proc nil)
+      (set-process-query-on-exit-flag proc nil)
       ;; Send CONNECT command.
       (process-send-string proc (format "%s%s\r\n" command authentication))
       (tramp-message
        tramp-gw-vector 6 "\n%s"
        (format
        "%s%s\r\n" command
-       (tramp-compat-replace-regexp-in-string ;; no password in trace!
+       (replace-regexp-in-string ;; no password in trace!
         "Basic [^\r\n]+" "Basic xxxxx" authentication t)))
       (with-current-buffer buffer
        ;; Trap errors to be traced in the right trace buffer.  Often,
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 7ace886..7b1aa2a 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -32,7 +32,6 @@
 (eval-when-compile
   (require 'cl)
   (require 'dired))
-(defvar directory-sep-char)
 (defvar tramp-gw-tunnel-method)
 (defvar tramp-gw-socks-method)
 (defvar vc-handled-backends)
@@ -380,9 +379,8 @@ The string is used in `tramp-methods'.")
     (tramp-remote-shell-args    ("-c"))
     (tramp-copy-program         "pscp")
     (tramp-copy-args            (("-l" "%u") ("-P" "%p") ("-sftp") ("-p" "%k")
-                                ("-q") ("-r")))
-    (tramp-copy-keep-date       t)
-    (tramp-copy-recursive       t)))
+                                ("-q")))
+    (tramp-copy-keep-date       t)))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
   '("fcp"
@@ -986,10 +984,7 @@ of command line.")
     (directory-files . tramp-handle-directory-files)
     (directory-files-and-attributes
      . tramp-sh-handle-directory-files-and-attributes)
-    ;; `dired-call-process' performed by default handler.
     (dired-compress-file . tramp-sh-handle-dired-compress-file)
-    (dired-recursive-delete-directory
-     . tramp-sh-handle-dired-recursive-delete-directory)
     (dired-uncache . tramp-handle-dired-uncache)
     (expand-file-name . tramp-sh-handle-expand-file-name)
     (file-accessible-directory-p . tramp-handle-file-accessible-directory-p)
@@ -1025,8 +1020,6 @@ of command line.")
     ;; `get-file-buffer' performed by default handler.
     (insert-directory . tramp-sh-handle-insert-directory)
     (insert-file-contents . tramp-handle-insert-file-contents)
-    (insert-file-contents-literally
-     . tramp-sh-handle-insert-file-contents-literally)
     (load . tramp-handle-load)
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (make-directory . tramp-sh-handle-make-directory)
@@ -1041,7 +1034,7 @@ of command line.")
     (shell-command . tramp-handle-shell-command)
     (start-file-process . tramp-sh-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 . tramp-sh-handle-vc-registered)
     (verify-visited-file-modtime . tramp-sh-handle-verify-visited-file-modtime)
     (write-region . tramp-sh-handle-write-region))
@@ -1148,10 +1141,8 @@ target of the symlink differ."
                   (format "tramp_perl_file_truename %s"
                           (tramp-shell-quote-argument localname)))))
 
-          ;; Do it yourself.  We bind `directory-sep-char' here for
-          ;; XEmacs on Windows, which would otherwise use backslash.
-          (t (let ((directory-sep-char ?/)
-                   (steps (tramp-compat-split-string localname "/"))
+          ;; Do it yourself.
+          (t (let ((steps (split-string localname "/" 'omit))
                    (thisstep nil)
                    (numchase 0)
                    ;; Don't make the following value larger than
@@ -1200,9 +1191,8 @@ target of the symlink differ."
                              symlink-target))
                           (setq symlink-target localname))
                         (setq steps
-                              (append (tramp-compat-split-string
-                                       symlink-target "/")
-                                      steps)))
+                              (append
+                               (split-string symlink-target "/" 'omit) steps)))
                        (t
                         ;; It's a file.
                         (setq result (cons thisstep result)))))
@@ -1355,8 +1345,8 @@ target of the symlink differ."
            res-gid
            ;; 4. Last access time, as a list of integers.  Normally
            ;; this would be in the same format as `current-time', but
-           ;; the subseconds part is not currently implemented, and (0
-           ;; 0) denotes an unknown time.
+           ;; the subseconds part is not currently implemented, and
+          ;; (0 0) denotes an unknown time.
            ;; 5. Last modification time, likewise.
            ;; 6. Last status change time, likewise.
            '(0 0) '(0 0) '(0 0)                ;CCC how to find out?
@@ -1370,8 +1360,7 @@ target of the symlink differ."
            ;; 10. Inode number.
            res-inode
            ;; 11. Device number.  Will be replaced by a virtual device number.
-           -1
-           ))))))
+           -1))))))
 
 (defun tramp-do-file-attributes-with-perl
   (vec localname &optional id-format)
@@ -1428,8 +1417,7 @@ target of the symlink differ."
               (attr (file-attributes f))
               ;; '(-1 65535) means file doesn't exists yet.
               (modtime (or (nth 5 attr) '(-1 65535))))
-         (when (boundp 'last-coding-system-used)
-           (setq coding-system-used (symbol-value 'last-coding-system-used)))
+         (setq coding-system-used last-coding-system-used)
          ;; We use '(0 0) as a don't-know value.  See also
          ;; `tramp-do-file-attributes-with-ls'.
          (if (not (equal modtime '(0 0)))
@@ -1443,8 +1431,7 @@ target of the symlink differ."
              (setq attr (buffer-substring (point) (point-at-eol))))
            (tramp-set-file-property
             v localname "visited-file-modtime-ild" attr))
-         (when (boundp 'last-coding-system-used)
-           (set 'last-coding-system-used coding-system-used))
+         (setq last-coding-system-used coding-system-used)
          nil)))))
 
 ;; This function makes the same assumption as
@@ -1463,7 +1450,7 @@ of."
       ;; connection.
       (if (or (not f)
              (eq (visited-file-modtime) 0)
-             (not (tramp-file-name-handler 'file-remote-p f nil 'connected)))
+             (not (file-remote-p f nil 'connected)))
          t
        (with-parsed-tramp-file-name f nil
          (let* ((remote-file-name-inhibit-cache t)
@@ -1508,48 +1495,26 @@ of."
     ;; FIXME: extract the proper text from chmod's stderr.
     (tramp-barf-unless-okay
      v
-     (format "chmod %s %s"
-            (tramp-compat-decimal-to-octal mode)
-            (tramp-shell-quote-argument localname))
+     (format "chmod %o %s" mode (tramp-shell-quote-argument localname))
      "Error while changing file's mode %s" filename)))
 
 (defun tramp-sh-handle-set-file-times (filename &optional time)
   "Like `set-file-times' for Tramp files."
-  (if (tramp-tramp-file-p filename)
-      (with-parsed-tramp-file-name filename nil
-       (when (tramp-get-remote-touch v)
-         (tramp-flush-file-property v (file-name-directory localname))
-         (tramp-flush-file-property v localname)
-         (let ((time (if (or (null time) (equal time '(0 0)))
-                         (current-time)
-                       time))
-               ;; With GNU Emacs, `format-time-string' has an
-               ;; optional parameter UNIVERSAL.  This is preferred,
-               ;; because we could handle the case when the remote
-               ;; host is located in a different time zone as the
-               ;; local host.
-               (utc (not (featurep 'xemacs))))
-           (tramp-send-command-and-check
-            v (format
-               "%s %s %s %s"
-               (if utc "env TZ=UTC" "")
-               (tramp-get-remote-touch v)
-               (if (tramp-get-connection-property v "touch-t" nil)
-                   (format "-t %s"
-                           (if utc
-                               (format-time-string "%Y%m%d%H%M.%S" time t)
-                             (format-time-string "%Y%m%d%H%M.%S" time)))
-                 "")
-               (tramp-shell-quote-argument localname))))))
-
-    ;; We handle also the local part, because in older Emacsen,
-    ;; without `set-file-times', this function is an alias for this.
-    ;; We are local, so we don't need the UTC settings.
-    (zerop
-     (tramp-call-process
-      nil "touch" nil nil nil "-t"
-      (format-time-string "%Y%m%d%H%M.%S" time)
-      (tramp-shell-quote-argument filename)))))
+  (with-parsed-tramp-file-name filename nil
+    (when (tramp-get-remote-touch v)
+      (tramp-flush-file-property v (file-name-directory localname))
+      (tramp-flush-file-property v localname)
+      (let ((time (if (or (null time) (equal time '(0 0)))
+                     (current-time)
+                   time)))
+       (tramp-send-command-and-check
+        v (format
+           "env TZ=UTC %s %s %s"
+           (tramp-get-remote-touch v)
+           (if (tramp-get-connection-property v "touch-t" nil)
+               (format "-t %s" (format-time-string "%Y%m%d%H%M.%S" time t))
+             "")
+           (tramp-shell-quote-argument localname)))))))
 
 (defun tramp-set-file-uid-gid (filename &optional uid gid)
   "Set the ownership for FILENAME.
@@ -1653,8 +1618,7 @@ be non-negative integers."
          (goto-char (point-max))
          (delete-blank-lines)
          (when (> (point-max) (point-min))
-           (tramp-compat-funcall
-            'substring-no-properties (buffer-string))))))))
+           (substring-no-properties (buffer-string))))))))
 
 (defun tramp-sh-handle-set-file-acl (filename acl-string)
   "Like `set-file-acl' for Tramp files."
@@ -1905,7 +1869,7 @@ be non-negative integers."
                  (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.
@@ -1928,14 +1892,7 @@ be non-negative integers."
                   (format "tramp_perl_file_name_all_completions %s %s %d"
                           (tramp-shell-quote-argument localname)
                           (tramp-shell-quote-argument filename)
-                          (if (symbol-value
-                              ;; `read-file-name-completion-ignore-case'
-                              ;; is introduced with Emacs 22.1.
-                              (if (boundp
-                                   'read-file-name-completion-ignore-case)
-                                  'read-file-name-completion-ignore-case
-                                'completion-ignore-case))
-                             1 0)))
+                          (if read-file-name-completion-ignore-case 1 0)))
 
               (format (concat
                        "(cd %s 2>&1 && (%s -a %s 2>/dev/null"
@@ -2058,19 +2015,18 @@ tramp-sh-handle-file-name-all-completions: internal 
error accessing `%s': `%s'"
     (tramp-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-sh-handle-copy-directory
   (dirname newname &optional keep-date parents copy-contents)
@@ -2125,7 +2081,8 @@ tramp-sh-handle-file-name-all-completions: internal error 
accessing `%s': `%s'"
   (if (or (tramp-tramp-file-p filename)
           (tramp-tramp-file-p newname))
       (tramp-do-copy-or-rename-file
-       'rename filename newname ok-if-already-exists t t)
+       'rename filename newname ok-if-already-exists
+       'keep-time 'preserve-uid-gid)
     (tramp-run-real-handler
      'rename-file (list filename newname ok-if-already-exists))))
 
@@ -2291,11 +2248,11 @@ the uid and gid from FILENAME."
                            op))))
             (localname1
              (if t1
-                 (tramp-file-name-handler 'file-remote-p filename 'localname)
+                 (file-remote-p filename 'localname)
                filename))
             (localname2
              (if t2
-                 (tramp-file-name-handler 'file-remote-p newname 'localname)
+                 (file-remote-p newname 'localname)
                newname))
             (prefix (file-remote-p (if t1 filename newname)))
              cmd-result)
@@ -2333,12 +2290,12 @@ the uid and gid from FILENAME."
                       (zerop
                        (logand
                         (file-modes (file-name-directory localname1))
-                        (tramp-compat-octal-to-decimal "1000"))))
+                        (string-to-number "1000" 8))))
                   (file-writable-p (file-name-directory localname2))
                   (or (file-directory-p localname2)
                       (file-writable-p localname2))))
            (if (eq op 'copy)
-               (tramp-compat-copy-file
+               (copy-file
                 localname1 localname2 ok-if-already-exists
                 keep-date preserve-uid-gid)
              (tramp-run-real-handler
@@ -2378,15 +2335,14 @@ the uid and gid from FILENAME."
                      ;; Since this does not work reliable, we also
                      ;; give read permissions.
                      (set-file-modes
-                      (concat prefix tmpfile)
-                      (tramp-compat-octal-to-decimal "0777"))
+                      (concat prefix tmpfile) (string-to-number "0777" 8))
                      (tramp-set-file-uid-gid
                       (concat prefix tmpfile)
                       (tramp-get-local-uid 'integer)
                       (tramp-get-local-gid 'integer)))
                     (t2
                      (if (eq op 'copy)
-                         (tramp-compat-copy-file
+                         (copy-file
                           localname1 tmpfile t
                           keep-date preserve-uid-gid)
                        (tramp-run-real-handler
@@ -2395,8 +2351,7 @@ the uid and gid from FILENAME."
                      ;; We must change the ownership as local user.
                      ;; Since this does not work reliable, we also
                      ;; give read permissions.
-                     (set-file-modes
-                      tmpfile (tramp-compat-octal-to-decimal "0777"))
+                     (set-file-modes tmpfile (string-to-number "0777" 8))
                      (tramp-set-file-uid-gid
                       tmpfile
                       (tramp-get-remote-uid v 'integer)
@@ -2455,7 +2410,7 @@ The method used must be an out-of-band method."
              ;; Save exit.
              (ignore-errors
                (if dir-flag
-                   (tramp-compat-delete-directory
+                   (delete-directory
                     (expand-file-name ".." tmpfile) 'recursive)
                  (delete-file tmpfile)))))
 
@@ -2628,7 +2583,7 @@ The method used must be an out-of-band method."
                   orig-vec 6 "%s"
                   (mapconcat 'identity (process-command p) " "))
                  (tramp-set-connection-property p "vector" orig-vec)
-                 (tramp-compat-set-process-query-on-exit-flag p nil)
+                 (set-process-query-on-exit-flag p nil)
 
                  ;; We must adapt `tramp-local-end-of-line' for
                  ;; sending the password.
@@ -2676,7 +2631,7 @@ The method used must be an out-of-band method."
       (unless (eq op 'copy)
        (if (file-regular-p filename)
            (delete-file filename)
-         (tramp-compat-delete-directory filename 'recursive))))))
+         (delete-directory filename 'recursive))))))
 
 (defun tramp-sh-handle-make-directory (dir &optional parents)
   "Like `make-directory' for Tramp files."
@@ -2716,51 +2671,16 @@ The method used must be an out-of-band method."
 
 ;; Dired.
 
-;; CCC: This does not seem to be enough. Something dies when
-;;      we try and delete two directories under Tramp :/
-(defun tramp-sh-handle-dired-recursive-delete-directory (filename)
-  "Recursively delete the directory given.
-This is like `dired-recursive-delete-directory' for Tramp files."
-  (with-parsed-tramp-file-name filename nil
-    ;; Run a shell command 'rm -r <localname>'.
-    ;; Code shamelessly stolen from the dired implementation and, um, hacked :)
-    (unless (file-exists-p filename)
-      (tramp-error v 'file-error "No such directory: %s" filename))
-    ;; Which is better, -r or -R? (-r works for me <address@hidden>).
-    (tramp-send-command
-     v
-     (format "rm -rf %s" (tramp-shell-quote-argument localname))
-     ;; Don't read the output, do it explicitly.
-     nil t)
-    ;; Wait for the remote system to return to us...
-    ;; This might take a while, allow it plenty of time.
-    (tramp-wait-for-output (tramp-get-connection-process v) 120)
-    ;; Make sure that it worked...
-    (tramp-flush-file-property v (file-name-directory localname))
-    (tramp-flush-directory-property v localname)
-    (and (file-exists-p filename)
-        (tramp-error
-         v 'file-error "Failed to recursively delete %s" filename))))
+(defvar dired-compress-file-suffixes)
+(declare-function dired-remove-file "dired-aux")
 
-(defun tramp-sh-handle-dired-compress-file (file &rest _ok-flag)
+(defun tramp-sh-handle-dired-compress-file (file)
   "Like `dired-compress-file' for Tramp files."
-  ;; OK-FLAG is valid for XEmacs only, but not implemented.
   ;; Code stolen mainly from dired-aux.el.
   (with-parsed-tramp-file-name file nil
     (tramp-flush-file-property v localname)
     (save-excursion
-      (let ((suffixes
-            (if (not (featurep 'xemacs))
-                ;; Emacs case
-                (symbol-value 'dired-compress-file-suffixes)
-              ;; XEmacs has `dired-compression-method-alist', which is
-              ;; transformed into `dired-compress-file-suffixes' structure.
-              (mapcar
-               (lambda (x)
-                 (list (concat (regexp-quote (nth 1 x)) "\\'")
-                       nil
-                       (mapconcat 'identity (nth 3 x) " ")))
-               (symbol-value 'dired-compression-method-alist))))
+      (let ((suffixes dired-compress-file-suffixes)
            suffix)
        ;; See if any suffix rule matches this file name.
        (while suffixes
@@ -2778,8 +2698,7 @@ This is like `dired-recursive-delete-directory' for Tramp 
files."
                 (when (tramp-send-command-and-check
                        v (concat (nth 2 suffix) " "
                                  (tramp-shell-quote-argument localname)))
-                  ;; `dired-remove-file' is not defined in XEmacs.
-                  (tramp-compat-funcall 'dired-remove-file file)
+                  (dired-remove-file file)
                   (string-match (car suffix) file)
                   (concat (substring file 0 (match-beginning 0))))))
              (t
@@ -2789,8 +2708,7 @@ This is like `dired-recursive-delete-directory' for Tramp 
files."
                 (when (tramp-send-command-and-check
                        v (concat "gzip -f "
                                  (tramp-shell-quote-argument localname)))
-                  ;; `dired-remove-file' is not defined in XEmacs.
-                  (tramp-compat-funcall 'dired-remove-file file)
+                  (dired-remove-file file)
                   (cond ((file-exists-p (concat file ".gz"))
                          (concat file ".gz"))
                         ((file-exists-p (concat file ".z"))
@@ -2900,9 +2818,7 @@ This is like `dired-recursive-delete-directory' for Tramp 
files."
          ;; Decode the output, it could be multibyte.
          (decode-coding-region
           beg (point-max)
-          (or file-name-coding-system
-              (and (boundp 'default-file-name-coding-system)
-                   (symbol-value 'default-file-name-coding-system))))
+          (or file-name-coding-system default-file-name-coding-system))
 
          ;; The inserted file could be from somewhere else.
          (when (and (not wildcard) (not full-directory-p))
@@ -2965,13 +2881,10 @@ the result will be a local, non-Tramp, file name."
       (while (string-match "//" localname)
        (setq localname (replace-match "/" t t localname)))
       ;; No tilde characters in file name, 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)))
+      ;; `expand-file-name' (this does "/./" and "/../").
+      ;; `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
@@ -3093,7 +3006,7 @@ the result will be a local, non-Tramp, file name."
                        ;; Send the command.
                        (tramp-send-command v command nil t) ; nooutput
                      ;; Check, whether a pty is associated.
-                     (unless (tramp-compat-process-get
+                     (unless (process-get
                               (tramp-get-connection-process v) 'remote-tty)
                        (tramp-error
                         v 'file-error
@@ -3103,7 +3016,7 @@ the result will be a local, non-Tramp, file name."
                    ;; 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))))
@@ -3227,12 +3140,7 @@ the result will be a local, non-Tramp, file name."
       ;; 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.
@@ -3258,7 +3166,7 @@ the result will be a local, non-Tramp, file name."
           ;; `copy-file' handles direct copy and out-of-band methods.
           ((or (tramp-local-host-p v)
                (tramp-method-out-of-band-p v size))
-           (copy-file filename tmpfile t t))
+           (copy-file filename tmpfile 'ok-if-already-exists 'keep-time))
 
           ;; Use inline encoding for file transfer.
           (rem-enc
@@ -3319,30 +3227,6 @@ the result will be a local, non-Tramp, file name."
       (run-hooks 'tramp-handle-file-local-copy-hook)
       tmpfile)))
 
-;; This is needed for XEmacs only.  Code stolen from files.el.
-(defun tramp-sh-handle-insert-file-contents-literally
-  (filename &optional visit beg end replace)
-  "Like `insert-file-contents-literally' for Tramp files."
-  (let ((format-alist nil)
-       (after-insert-file-functions nil)
-       (coding-system-for-read 'no-conversion)
-       (coding-system-for-write 'no-conversion)
-       (find-buffer-file-type-function
-        (if (fboundp 'find-buffer-file-type)
-            (symbol-function 'find-buffer-file-type)
-          nil))
-       (inhibit-file-name-handlers
-        '(epa-file-handler image-file-handler jka-compr-handler))
-       (inhibit-file-name-operation 'insert-file-contents))
-    (unwind-protect
-       (progn
-         (fset 'find-buffer-file-type (lambda (_filename) t))
-         (insert-file-contents filename visit beg end replace))
-      ;; Save exit.
-      (if find-buffer-file-type-function
-         (fset 'find-buffer-file-type find-buffer-file-type-function)
-       (fmakunbound 'find-buffer-file-type)))))
-
 ;; CCC grok LOCKNAME
 (defun tramp-sh-handle-write-region
   (start end filename &optional append visit lockname confirm)
@@ -3359,14 +3243,13 @@ the result will be a local, non-Tramp, file name."
     ;;    (error
     ;;     "tramp-sh-handle-write-region: LOCKNAME must be nil or equal 
FILENAME"))
 
-    ;; XEmacs takes a coding system as the seventh argument, not `confirm'.
-    (when (and (not (featurep 'xemacs)) confirm (file-exists-p filename))
+    (when (and confirm (file-exists-p filename))
       (unless (y-or-n-p (format "File %s exists; overwrite anyway? " filename))
        (tramp-error v 'file-error "File not overwritten")))
 
-    (let ((uid (or (nth 2 (tramp-compat-file-attributes filename 'integer))
+    (let ((uid (or (nth 2 (file-attributes filename 'integer))
                   (tramp-get-remote-uid v 'integer)))
-         (gid (or (nth 3 (tramp-compat-file-attributes filename 'integer))
+         (gid (or (nth 3 (file-attributes filename 'integer))
                   (tramp-get-remote-gid v 'integer))))
 
       (if (and (tramp-local-host-p v)
@@ -3424,9 +3307,7 @@ the result will be a local, non-Tramp, file name."
               (signal (car err) (cdr err))))
 
            ;; Now, `last-coding-system-used' has the right value.  Remember it.
-           (when (boundp 'last-coding-system-used)
-             (setq coding-system-used
-                   (symbol-value 'last-coding-system-used))))
+           (setq coding-system-used last-coding-system-used))
 
          ;; The permissions of the temporary file should be set.  If
          ;; FILENAME does not exist (eq modes nil) it has been
@@ -3436,7 +3317,7 @@ the result will be a local, non-Tramp, file name."
          (when modes
            (set-file-modes
             tmpfile
-            (logior (or modes 0) (tramp-compat-octal-to-decimal "0400"))))
+            (logior (or modes 0) (string-to-number "0400" 8))))
 
          ;; This is a bit lengthy due to the different methods
          ;; possible for file transfer.  First, we check whether the
@@ -3576,7 +3457,7 @@ the result will be a local, non-Tramp, file name."
       (let (last-coding-system-used (need-chown t))
        ;; Set file modification time.
        (when (or (eq visit t) (stringp visit))
-          (let ((file-attr (tramp-compat-file-attributes filename 'integer)))
+          (let ((file-attr (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
@@ -3611,7 +3492,7 @@ the result will be a local, non-Tramp, file name."
 ;; any other remote command.
 (defun tramp-sh-handle-vc-registered (file)
   "Like `vc-registered' for Tramp files."
-  (tramp-compat-with-temp-message ""
+  (with-temp-message ""
     (with-parsed-tramp-file-name file nil
       (with-tramp-progress-reporter
          v 3 (format-message "Checking `vc-registered' for %s" file)
@@ -3790,9 +3671,9 @@ Fall back to normal file name handler if no Tramp handler 
exists."
        (tramp-message v 6 "Run `%s', %S" (mapconcat 'identity sequence " ") p)
        (tramp-set-connection-property p "vector" v)
        ;; Needed for `tramp-sh-gvfs-monitor-dir-process-filter'.
-       (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 filter)
        ;; There might be an error if the monitor is not supported.
        ;; Give the filter a chance to read the output.
@@ -3808,13 +3689,13 @@ file-notify events."
   (let ((remote-prefix
         (with-current-buffer (process-buffer proc)
           (file-remote-p default-directory)))
-       (rest-string (tramp-compat-process-get proc 'rest-string)))
+       (rest-string (process-get proc 'rest-string)))
     (when rest-string
       (tramp-message proc 10 "Previous string:\n%s" rest-string))
     (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))
@@ -3832,7 +3713,7 @@ file-notify events."
              (list
               proc
               (intern-soft
-               (tramp-compat-replace-regexp-in-string
+               (replace-regexp-in-string
                 "_" "-" (downcase (match-string 4 string))))
               ;; File names are returned as absolute paths.  We must
               ;; add the remote prefix.
@@ -3841,24 +3722,23 @@ file-notify events."
        (setq string (replace-match "" nil nil string))
        ;; Remove watch when file or directory to be watched is deleted.
        (when (and (member (cadr object) '(moved deleted))
-                  (string-equal
-                   file (tramp-compat-process-get proc 'watch-name)))
+                  (string-equal file (process-get proc 'watch-name)))
          (delete-process proc))
        ;; Usually, we would add an Emacs event now.  Unfortunately,
        ;; `unread-command-events' does not accept several events at
        ;; once.  Therefore, we apply the callback directly.
-       (when (member (cadr object) (tramp-compat-process-get proc 'events))
+       (when (member (cadr object) (process-get proc 'events))
          (tramp-compat-funcall 'file-notify-callback object))))
 
     ;; 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-sh-inotifywait-process-filter (proc string)
   "Read output from \"inotifywait\" and add corresponding file-notify events."
   (tramp-message proc 6 "%S\n%s" proc string)
-  (dolist (line (split-string string "[\n\r]+" 'omit-nulls))
+  (dolist (line (split-string string "[\n\r]+" 'omit))
     ;; Check, whether there is a problem.
     (unless
        (string-match
@@ -3874,8 +3754,8 @@ file-notify events."
            (mapcar
             (lambda (x)
               (intern-soft
-               (tramp-compat-replace-regexp-in-string "_" "-" (downcase x))))
-            (split-string (match-string 1 line) "," 'omit-nulls))
+               (replace-regexp-in-string "_" "-" (downcase x))))
+            (split-string (match-string 1 line) "," 'omit))
            (match-string 3 line))))
       ;; Remove watch when file or directory to be watched is deleted.
       (when (equal (cadr object) 'ignored)
@@ -3899,7 +3779,7 @@ Only send the definition if it has not already been done."
          vec 5 (format-message "Sending script `%s'" name)
        ;; In bash, leading TABs like in `tramp-vc-registered-read-file-names'
        ;; could result in unwanted command expansion.  Avoid this.
-       (setq script (tramp-compat-replace-regexp-in-string
+       (setq script (replace-regexp-in-string
                      (make-string 1 ?\t) (make-string 8 ? ) script))
        ;; The script could contain a call of Perl.  This is masked with `%s'.
        (when (and (string-match "%s" script)
@@ -3972,8 +3852,7 @@ This function expects to be in the right *tramp* buffer."
            (setq result (concat "\\" progname))))
       (unless result
        (when ignore-tilde
-         ;; Remove all ~/foo directories from dirlist.  In XEmacs,
-         ;; `remove' is in CL, and we want to avoid CL dependencies.
+         ;; Remove all ~/foo directories from dirlist.
          (let (newdl d)
            (while dirlist
              (setq d (car dirlist))
@@ -4222,14 +4101,14 @@ process to set up.  VEC specifies the connection."
        (let ((cs (or (and (memq 'utf-8 (coding-system-list))
                           (string-match "utf-?8" (tramp-get-remote-locale vec))
                           (cons 'utf-8 'utf-8))
-                     (tramp-compat-funcall 'process-coding-system proc)
+                     (process-coding-system proc)
                      (cons 'undecided 'undecided)))
              cs-decode cs-encode)
          (when (symbolp cs) (setq cs (cons cs cs)))
          (setq cs-decode (or (car cs) 'undecided)
                 cs-encode (or (cdr cs) 'undecided))
          (setq cs-encode
-               (tramp-compat-coding-system-change-eol-conversion
+               (coding-system-change-eol-conversion
                 cs-encode
                 (if (string-match
                      "^Darwin" (tramp-get-connection-property vec "uname" ""))
@@ -4237,7 +4116,7 @@ process to set up.  VEC specifies the connection."
          (tramp-send-command vec "echo foo ; echo bar" t)
          (goto-char (point-min))
          (when (search-forward "\r" nil t)
-           (setq cs-decode (tramp-compat-coding-system-change-eol-conversion
+           (setq cs-decode (coding-system-change-eol-conversion
                             cs-decode 'dos)))
           ;; Special setting for Mac OS X.
           (when (and (string-match
@@ -4245,8 +4124,7 @@ process to set up.  VEC specifies the connection."
                      (memq 'utf-8-hfs (coding-system-list)))
             (setq cs-decode 'utf-8-hfs
                   cs-encode 'utf-8-hfs))
-          (tramp-compat-funcall
-          'set-buffer-process-coding-system cs-decode cs-encode)
+         (set-buffer-process-coding-system cs-decode cs-encode)
          (tramp-message
           vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode))
       ;; Look for ^M and do something useful if found.
@@ -4311,7 +4189,7 @@ process to set up.  VEC specifies the connection."
   ;; Set `remote-tty' process property.
   (let ((tty (tramp-send-command-and-read vec "echo \\\"`tty`\\\"" 'noerror)))
     (unless (zerop (length tty))
-      (tramp-compat-process-put proc 'remote-tty tty)))
+      (process-put proc 'remote-tty tty)))
 
   ;; Dump stty settings in the traces.
   (when (>= tramp-verbose 9)
@@ -4324,7 +4202,7 @@ process to set up.  VEC specifies the connection."
                     (copy-sequence tramp-remote-process-environment)))
        unset vars item)
     (while env
-      (setq item (tramp-compat-split-string (car env) "="))
+      (setq item (split-string (car env) "=" 'omit))
       (setcdr item (mapconcat 'identity (cdr item) "="))
       (if (and (stringp (cdr item)) (not (string-equal (cdr item) "")))
          (push (format "%s %s" (car item) (cdr item)) vars)
@@ -4514,8 +4392,7 @@ Goes through the list `tramp-local-coding-commands' and
                               value
                               (format-spec-make
                                ?t
-                               (tramp-file-name-handler
-                                'file-remote-p tmpfile 'localname)))))
+                               (file-remote-p tmpfile 'localname)))))
                      (tramp-maybe-send-script vec value name)
                      (setq rem-dec name)))
                  (tramp-message
@@ -4711,7 +4588,7 @@ Gateway hops are already opened."
        (push
         (vector
          (tramp-file-name-method hop) (tramp-file-name-user hop)
-         (tramp-compat-funcall 'tramp-gw-open-connection vec gw hop) nil nil)
+         (tramp-gw-open-connection vec gw hop) nil nil)
         target-alist)
        ;; For the password prompt, we need the correct values.
        ;; Therefore, we must remember the gateway vector.  But we
@@ -4845,6 +4722,7 @@ connection if a previous connection has died for some 
reason."
        (unless (and p (processp p) (memq (process-status p) '(run open)))
 
          ;; If `non-essential' is non-nil, don't reopen a new connection.
+         ;; This variable has been introduced with Emacs 24.1.
          (when (and (boundp 'non-essential) (symbol-value 'non-essential))
            (throw 'non-essential 'non-essential))
 
@@ -4897,7 +4775,7 @@ connection if a previous connection has died for some 
reason."
                ;; Set sentinel and query flag.
                (tramp-set-connection-property p "vector" vec)
                (set-process-sentinel p 'tramp-process-sentinel)
-               (tramp-compat-set-process-query-on-exit-flag p nil)
+               (set-process-query-on-exit-flag p nil)
                (setq tramp-current-connection
                      (cons (butlast (append vec nil) 2) (current-time))
                      tramp-current-host (system-name))
@@ -5193,12 +5071,12 @@ Return ATTR."
     (when (and (numberp (nth 2 attr)) (< (nth 2 attr) 0))
       (setcar (nthcdr 2 attr) -1))
     (when (and (floatp (nth 2 attr))
-               (<= (nth 2 attr) (tramp-compat-most-positive-fixnum)))
+               (<= (nth 2 attr) most-positive-fixnum))
       (setcar (nthcdr 2 attr) (round (nth 2 attr))))
     (when (and (numberp (nth 3 attr)) (< (nth 3 attr) 0))
       (setcar (nthcdr 3 attr) -1))
     (when (and (floatp (nth 3 attr))
-               (<= (nth 3 attr) (tramp-compat-most-positive-fixnum)))
+               (<= (nth 3 attr) most-positive-fixnum))
       (setcar (nthcdr 3 attr) (round (nth 3 attr))))
     ;; Convert last access time.
     (unless (listp (nth 4 attr))
@@ -5219,7 +5097,7 @@ Return ATTR."
     (when (< (nth 7 attr) 0)
       (setcar (nthcdr 7 attr) -1))
     (when (and (floatp (nth 7 attr))
-               (<= (nth 7 attr) (tramp-compat-most-positive-fixnum)))
+               (<= (nth 7 attr) most-positive-fixnum))
       (setcar (nthcdr 7 attr) (round (nth 7 attr))))
     ;; Convert file mode bits to string.
     (unless (stringp (nth 8 attr))
@@ -5351,7 +5229,7 @@ Return ATTR."
       (when elt1
        (setcdr elt1
                (append
-                (tramp-compat-split-string (or default-remote-path "") ":")
+                 (split-string (or default-remote-path "") ":" 'omit)
                 (cdr elt1)))
        (setq remote-path (delq 'tramp-default-remote-path remote-path)))
 
@@ -5359,7 +5237,7 @@ Return ATTR."
       (when elt2
        (setcdr elt2
                (append
-                (tramp-compat-split-string (or own-remote-path "") ":")
+                 (split-string (or own-remote-path "") ":" 'omit)
                 (cdr elt2)))
        (setq remote-path (delq 'tramp-own-remote-path remote-path)))
 
@@ -5563,7 +5441,7 @@ Return ATTR."
           "%s -t %s %s"
           result
           (format-time-string "%Y%m%d%H%M.%S")
-          (tramp-file-name-handler 'file-remote-p tmpfile 'localname))))
+          (file-remote-p tmpfile 'localname))))
        (delete-file tmpfile))
       result)))
 
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index e957fdf..2a38b0e 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -224,7 +224,6 @@ See `tramp-actions-before-shell' for more info.")
     (directory-files . tramp-smb-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-smb-handle-expand-file-name)
@@ -276,7 +275,7 @@ See `tramp-actions-before-shell' for more info.")
     (shell-command . tramp-handle-shell-command)
     (start-file-process . tramp-smb-handle-start-file-process)
     (substitute-in-file-name . tramp-smb-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-smb-handle-write-region))
@@ -419,12 +418,11 @@ pass to the OPERATION."
              (unwind-protect
                  (progn
                    (make-directory tmpdir)
-                   (tramp-compat-copy-directory
-                    dirname tmpdir keep-date 'parents)
-                   (tramp-compat-copy-directory
+                   (copy-directory dirname tmpdir keep-date 'parents)
+                   (copy-directory
                     (expand-file-name (file-name-nondirectory dirname) tmpdir)
                     newname keep-date parents))
-               (tramp-compat-delete-directory tmpdir 'recursive))))
+               (delete-directory tmpdir 'recursive))))
 
           ;; We can copy recursively.
           ((or t1 t2)
@@ -448,7 +446,7 @@ pass to the OPERATION."
                   (port      (tramp-file-name-port v))
                   (share     (tramp-smb-get-share v))
                   (localname (file-name-as-directory
-                              (tramp-compat-replace-regexp-in-string
+                              (replace-regexp-in-string
                                "\\\\" "/" (tramp-smb-get-localname v))))
                   (tmpdir    (make-temp-name
                               (expand-file-name
@@ -510,7 +508,7 @@ pass to the OPERATION."
                      (tramp-message
                       v 6 "%s" (mapconcat 'identity (process-command p) " "))
                      (tramp-set-connection-property p "vector" v)
-                     (tramp-compat-set-process-query-on-exit-flag p nil)
+                     (set-process-query-on-exit-flag p nil)
                      (tramp-process-actions p v nil tramp-smb-actions-with-tar)
 
                      (while (memq (process-status p) '(run open))
@@ -520,7 +518,7 @@ pass to the OPERATION."
                ;; Reset the transfer process properties.
                (tramp-set-connection-property v "process-name" nil)
                (tramp-set-connection-property v "process-buffer" nil)
-               (when t1 (tramp-compat-delete-directory tmpdir 'recurse))))
+               (when t1 (delete-directory tmpdir 'recurse))))
 
            ;; Handle KEEP-DATE argument.
            (when keep-date
@@ -555,7 +553,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
       0 (format "Copying %s to %s" filename newname)
 
     (if (file-directory-p filename)
-       (tramp-compat-copy-directory filename newname keep-date t t)
+       (tramp-compat-copy-directory
+        filename newname keep-date 'parents 'copy-contents)
 
       (let ((tmpfile (file-local-copy filename)))
        (if tmpfile
@@ -601,7 +600,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
        (mapc
         (lambda (file)
           (if (file-directory-p file)
-              (tramp-compat-delete-directory file recursive)
+              (delete-directory file recursive)
             (delete-file file)))
         ;; We do not want to delete "." and "..".
         (directory-files
@@ -665,7 +664,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
     ;; Sort them if necessary.
     (unless nosort (setq result (sort result 'string-lessp)))
     ;; Remove double entries.
-    (tramp-compat-delete-dups result)))
+    (delete-dups result)))
 
 (defun tramp-smb-handle-expand-file-name (name &optional dir)
   "Like `expand-file-name' for Tramp files."
@@ -730,7 +729,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
               (domain    (tramp-file-name-domain v))
               (port      (tramp-file-name-port v))
               (share     (tramp-smb-get-share v))
-              (localname (tramp-compat-replace-regexp-in-string
+              (localname (replace-regexp-in-string
                           "\\\\" "/" (tramp-smb-get-localname v)))
               (args      (list (concat "//" real-host "/" share) "-E")))
 
@@ -765,11 +764,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
                  (tramp-message
                   v 6 "%s" (mapconcat 'identity (process-command p) " "))
                  (tramp-set-connection-property p "vector" v)
-                 (tramp-compat-set-process-query-on-exit-flag p nil)
+                 (set-process-query-on-exit-flag p nil)
                  (tramp-process-actions p v nil tramp-smb-actions-get-acl)
                  (when (> (point-max) (point-min))
-                   (tramp-compat-funcall
-                    'substring-no-properties (buffer-string)))))
+                   (substring-no-properties (buffer-string)))))
 
            ;; Reset the transfer process properties.
            (tramp-set-connection-property v "process-name" nil)
@@ -1068,9 +1066,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
          (tramp-smb-send-command
           v
           (if (tramp-smb-get-cifs-capabilities v)
-              (format
-               "posix_mkdir \"%s\" %s"
-               file (tramp-compat-decimal-to-octal (default-file-modes)))
+              (format "posix_mkdir \"%s\" %o" file (default-file-modes))
             (format "mkdir \"%s\"" file)))
          ;; We must also flush the cache of the directory, because
          ;; `file-attributes' reads the values from there.
@@ -1240,12 +1236,7 @@ target of the symlink differ."
       (unless outbuf
        (kill-buffer (tramp-get-connection-property v "process-buffer" nil)))
 
-      ;; `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.
@@ -1296,9 +1287,10 @@ target of the symlink differ."
              (tramp-error v2 'file-error "Cannot rename `%s'" filename))))
 
       ;; We must rename via copy.
-      (tramp-compat-copy-file filename newname ok-if-already-exists t t t)
+      (copy-file
+       filename newname ok-if-already-exists 'keep-time 'preserve-uid-gid)
       (if (file-directory-p filename)
-         (tramp-compat-delete-directory filename 'recursive)
+         (delete-directory filename 'recursive)
        (delete-file filename)))))
 
 (defun tramp-smb-action-set-acl (proc vec)
@@ -1325,10 +1317,10 @@ target of the symlink differ."
               (domain    (tramp-file-name-domain v))
               (port      (tramp-file-name-port v))
               (share     (tramp-smb-get-share v))
-              (localname (tramp-compat-replace-regexp-in-string
+              (localname (replace-regexp-in-string
                           "\\\\" "/" (tramp-smb-get-localname v)))
               (args      (list (concat "//" real-host "/" share) "-E" "-S"
-                               (tramp-compat-replace-regexp-in-string
+                               (replace-regexp-in-string
                                 "\n" "," acl-string))))
 
          (if (not (zerop (length real-user)))
@@ -1364,7 +1356,7 @@ target of the symlink differ."
                  (tramp-message
                   v 6 "%s" (mapconcat 'identity (process-command p) " "))
                  (tramp-set-connection-property p "vector" v)
-                 (tramp-compat-set-process-query-on-exit-flag p nil)
+                 (set-process-query-on-exit-flag p nil)
                  (tramp-process-actions p v nil tramp-smb-actions-set-acl)
                  (goto-char (point-max))
                  (unless (re-search-backward "tramp_exit_status [0-9]+" nil t)
@@ -1387,9 +1379,7 @@ target of the symlink differ."
     (when (tramp-smb-get-cifs-capabilities v)
       (tramp-flush-file-property v localname)
       (unless (tramp-smb-send-command
-              v (format "chmod \"%s\" %s"
-                        (tramp-smb-get-localname v)
-                        (tramp-compat-decimal-to-octal mode)))
+              v (format "chmod \"%s\" %o" (tramp-smb-get-localname v) mode))
        (tramp-error
         v 'file-error "Error while changing file's mode %s" filename)))))
 
@@ -1460,9 +1450,7 @@ errors for shares like \"C$/\", which are common in 
Microsoft Windows."
   "Like `write-region' for Tramp files."
   (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
-    ;; XEmacs takes a coding system as the seventh argument, not `confirm'.
-    (when (and (not (featurep 'xemacs))
-              confirm (file-exists-p filename))
+    (when (and confirm (file-exists-p filename))
       (unless (y-or-n-p (format "File %s exists; overwrite anyway? "
                                filename))
        (tramp-error v 'file-error "File not overwritten")))
@@ -1575,10 +1563,6 @@ Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME 
YEAR)."
          ;; Add directory itself.
          (push '("" "drwxrwxrwx" 0 (0 0)) res)
 
-         ;; There's a very strange error (debugged with XEmacs 21.4.14)
-         ;; If there's no short delay, it returns nil.  No idea about.
-         (when (featurep 'xemacs) (sleep-for 0.01))
-
          ;; Return entries.
          (delq nil res))))))
 
@@ -1738,7 +1722,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
                (member
                 "pathnames"
                 (split-string
-                 (buffer-substring (point) (point-at-eol)) nil t)))))))))
+                 (buffer-substring (point) (point-at-eol)) nil 'omit)))))))))
 
 (defun tramp-smb-get-stat-capability (vec)
   "Check, whether the SMB server supports the STAT command."
@@ -1878,7 +1862,7 @@ If ARGUMENT is non-nil, use it as argument for
              (tramp-message
               vec 6 "%s" (mapconcat 'identity (process-command p) " "))
              (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)
 
              ;; Set variables for computing the prompt for reading password.
              (setq tramp-current-method tramp-smb-method
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index e8e40ae..5c67880 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -34,9 +34,7 @@
 ;; Notes:
 ;; -----
 ;;
-;; This package only works for Emacs 22.1 and higher, and for XEmacs 21.4
-;; and higher.  For XEmacs 21, you need the package `fsf-compat' for
-;; the `with-timeout' macro.
+;; This package only works for Emacs 23.1 and higher.
 ;;
 ;; Also see the todo list at the bottom of this file.
 ;;
@@ -61,11 +59,7 @@
 ;; Pacify byte-compiler.
 (eval-when-compile
   (require 'cl))
-(defvar bkup-backup-directory-info)
-(defvar directory-sep-char)
 (defvar eshell-path-env)
-(defvar ls-lisp-use-insert-directory-program)
-(defvar outline-regexp)
 
 ;;; User Customizable Internal Variables:
 
@@ -102,11 +96,8 @@ Any level x includes messages for all levels 1 .. x-1.  The 
levels are
   :group 'tramp
   :type 'integer)
 
-;; Emacs case.
-(eval-and-compile
-  (when (boundp 'backup-directory-alist)
-    (defcustom tramp-backup-directory-alist nil
-      "Alist of filename patterns and backup directory names.
+(defcustom tramp-backup-directory-alist nil
+  "Alist of filename patterns and backup directory names.
 Each element looks like (REGEXP . DIRECTORY), with the same meaning like
 in `backup-directory-alist'.  If a Tramp file is backed up, and DIRECTORY
 is a local file name, the backup directory is prepended with Tramp file
@@ -116,34 +107,9 @@ name prefix \(method, user, host) of file.
 
 gives the same backup policy for Tramp files on their hosts like the
 policy for local files."
-      :group 'tramp
-      :type '(repeat (cons (regexp :tag "Regexp matching filename")
-                          (directory :tag "Backup directory name"))))))
-
-;; XEmacs case.  We cannot check for `bkup-backup-directory-info', because
-;; the package "backup-dir" might not be loaded yet.
-(eval-and-compile
-  (when (featurep 'xemacs)
-    (defcustom tramp-bkup-backup-directory-info nil
-      "Alist of (FILE-REGEXP BACKUP-DIR OPTIONS ...))
-It has the same meaning like `bkup-backup-directory-info' from package
-`backup-dir'.  If a Tramp file is backed up, and BACKUP-DIR is a local
-file name, the backup directory is prepended with Tramp file name prefix
-\(method, user, host) of file.
-
-\(setq tramp-bkup-backup-directory-info bkup-backup-directory-info)
-
-gives the same backup policy for Tramp files on their hosts like the
-policy for local files."
-      :type '(repeat
-             (list (regexp :tag "File regexp")
-                   (string :tag "Backup Dir")
-                   (set :inline t
-                        (const ok-create)
-                        (const full-path)
-                        (const prepend-name)
-                        (const search-upward))))
-      :group 'tramp)))
+  :group 'tramp
+  :type '(repeat (cons (regexp :tag "Regexp matching filename")
+                      (directory :tag "Backup directory name"))))
 
 (defcustom tramp-auto-save-directory nil
   "Put auto-save files in this directory, if set.
@@ -329,25 +295,9 @@ useful only in combination with 
`tramp-default-proxies-alist'.")
    ;; PuTTY is installed.  We don't take it, if it is installed on a
    ;; non-windows system, or pscp from the pssh (parallel ssh) package
    ;; is found.
-   ((and (eq system-type 'windows-nt)
-        (executable-find "pscp"))
-    (if        (or (fboundp 'password-read)
-           (fboundp 'auth-source-user-or-password)
-           (fboundp 'auth-source-search)
-           ;; Pageant is running.
-           (tramp-compat-process-running-p "Pageant"))
-       "pscp"
-      "plink"))
+   ((and (eq system-type 'windows-nt) (executable-find "pscp")) "pscp")
    ;; There is an ssh installation.
-   ((executable-find "scp")
-    (if        (or (fboundp 'password-read)
-           (fboundp 'auth-source-user-or-password)
-           (fboundp 'auth-source-search)
-           ;; ssh-agent is running.
-           (getenv "SSH_AUTH_SOCK")
-           (getenv "SSH_AGENT_PID"))
-       "scp"
-      "ssh"))
+   ((executable-find "scp") "scp")
    ;; Fallback.
    (t "ftp"))
   "Default method to use for transferring files.
@@ -541,7 +491,7 @@ Sometimes the prompt is reported to look like \"login 
as:\"."
   ;; regexp works only for GNU Emacs.
   ;; Allow also [] style prompts.  They can appear only during
   ;; connection initialization; Tramp redefines the prompt afterwards.
-  (concat (if (featurep 'xemacs) "" "\\(?:^\\|\r\\)")
+  (concat "\\(?:^\\|\r\\)"
          "[^]#$%>\n]*#?[]#$%>] *\\(\e\\[[0-9;]*[a-zA-Z] *\\)*")
   "Regexp to match prompts from remote shell.
 Normally, Tramp expects you to configure `shell-prompt-pattern'
@@ -677,28 +627,17 @@ Useful for \"rsync\" like methods.")
 (make-variable-buffer-local 'tramp-temp-buffer-file-name)
 (put 'tramp-temp-buffer-file-name 'permanent-local t)
 
-;; XEmacs is distributed with few Lisp packages.  Further packages are
-;; installed using EFS.  If we use a unified filename format, then
-;; Tramp is required in addition to EFS.  (But why can't Tramp just
-;; disable EFS when Tramp is loaded?  Then XEmacs can ship with EFS
-;; just like before.)  Another reason for using a separate filename
-;; syntax on XEmacs is that EFS hooks into XEmacs in many places, but
-;; Tramp only knows how to deal with `file-name-handler-alist', not
-;; the other places.
-
-;; Currently, we have the choice between 'ftp and 'sep.
 ;;;###autoload
-(defcustom tramp-syntax
-  (if (featurep 'xemacs) 'sep 'ftp)
+(defcustom tramp-syntax 'ftp
   "Tramp filename syntax to be used.
 
 It can have the following values:
 
-  `ftp' -- Ange-FTP respective EFS like syntax (GNU Emacs default)
-  `sep' -- Syntax as defined for XEmacs."
+  `ftp' -- Ange-FTP like syntax
+  `sep' -- Syntax as defined for XEmacs originally."
   :group 'tramp
   :version "24.4"
-  :type `(choice (const :tag  ,(if (featurep 'xemacs) "EFS" "Ange-FTP") ftp)
+  :type '(choice (const :tag "Ange-FTP" ftp)
                 (const :tag "XEmacs" sep)))
 
 (defconst tramp-prefix-format
@@ -883,15 +822,13 @@ See also `tramp-file-name-regexp'.")
       "\\`/\\(\\[.*\\]\\|[^/|:]\\{2,\\}[^/|]*\\):"
     "\\`/[^/|:][^/|]*:")
   "Value for `tramp-file-name-regexp' for unified remoting.
-Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and
-Tramp.  See `tramp-file-name-structure' for more explanations.
+See `tramp-file-name-structure' for more explanations.
 
 On W32 systems, the volume letter must be ignored.")
 
 ;;;###autoload
 (defconst tramp-file-name-regexp-separate "\\`/\\[.*\\]"
   "Value for `tramp-file-name-regexp' for separate remoting.
-XEmacs uses a separate filename syntax for Tramp and EFS.
 See `tramp-file-name-structure' for more explanations.")
 
 ;;;###autoload
@@ -919,7 +856,6 @@ Also see `tramp-file-name-structure'.")
   (if (memq system-type '(cygwin windows-nt))
       "\\`/[^/]\\{2,\\}\\'" "\\`/[^/]*\\'")
   "Value for `tramp-completion-file-name-regexp' for unified remoting.
-GNU Emacs uses a unified filename syntax for Tramp and Ange-FTP.
 See `tramp-file-name-structure' for more explanations.
 
 On W32 systems, the volume letter must be ignored.")
@@ -928,7 +864,6 @@ On W32 systems, the volume letter must be ignored.")
 (defconst tramp-completion-file-name-regexp-separate
   "\\`/\\([[][^]]*\\)?\\'"
   "Value for `tramp-completion-file-name-regexp' for separate remoting.
-XEmacs uses a separate filename syntax for Tramp and EFS.
 See `tramp-file-name-structure' for more explanations.")
 
 ;;;###autoload
@@ -951,10 +886,7 @@ Also see `tramp-file-name-structure'.")
 ;; to drop bytes when data is sent too quickly.  There is also a connection
 ;; buffer local variable, which is computed depending on remote host properties
 ;; when `tramp-chunksize' is zero or nil.
-(defcustom tramp-chunksize
-  (when (and (not (featurep 'xemacs))
-            (memq system-type '(hpux)))
-    500)
+(defcustom tramp-chunksize (when (memq system-type '(hpux)) 500)
 ;; Parentheses in docstring starting at beginning of line are escaped.
 ;; Fontification is messed up when
 ;; `open-paren-in-column-0-is-defun-start' set to t.
@@ -1111,8 +1043,7 @@ If VEC is a vector, check first in connection properties.
 Afterwards, check in `tramp-methods'.  If the `tramp-methods'
 entry does not exist, return nil."
   (let ((hash-entry
-        (tramp-compat-replace-regexp-in-string
-         "^tramp-" "" (symbol-name param))))
+        (replace-regexp-in-string "^tramp-" "" (symbol-name param))))
     (if (tramp-connection-property-p vec hash-entry)
        ;; We use the cached property.
        (tramp-get-connection-property  vec hash-entry nil)
@@ -1230,11 +1161,10 @@ their replacement."
       ;; This works with the current set of `tramp-obsolete-methods'.
       ;; Must be improved, if their are more sophisticated replacements.
       (setq result (substring result 0 -1)))
-    ;; We must mark, whether a default value has been used.  Not
-    ;; applicable for XEmacs.
-    (if (or method (null result) (null (functionp 'propertize)))
+    ;; We must mark, whether a default value has been used.
+    (if (or method (null result))
        result
-      (tramp-compat-funcall 'propertize result 'tramp-default t))))
+      (propertize result 'tramp-default t))))
 
 (defun tramp-find-user (method user host)
   "Return the right user string to use.
@@ -1252,11 +1182,10 @@ This is USER, if non-nil. Otherwise, do a lookup in
                   (setq choices nil)))
               luser)
             tramp-default-user)))
-    ;; We must mark, whether a default value has been used.  Not
-    ;; applicable for XEmacs.
-    (if (or user (null result) (null (functionp 'propertize)))
+    ;; We must mark, whether a default value has been used.
+    (if (or user (null result))
        result
-      (tramp-compat-funcall 'propertize result 'tramp-default t))))
+      (propertize result 'tramp-default t))))
 
 (defun tramp-find-host (method user host)
   "Return the right host string to use.
@@ -1447,8 +1376,7 @@ ARGUMENTS to actually emit the message (if applicable)."
     (when (bobp)
       (insert
        (format
-       ";; %sEmacs: %s Tramp: %s -*- mode: outline; -*-"
-       (if (featurep 'sxemacs) "SX" (if (featurep 'xemacs) "X" "GNU "))
+       ";; Emacs: %s Tramp: %s -*- mode: outline; -*-"
        emacs-version tramp-version))
       (when (>= tramp-verbose 10)
        (insert
@@ -1481,7 +1409,6 @@ ARGUMENTS to actually emit the message (if applicable)."
                     '("tramp-backtrace"
                       "tramp-compat-condition-case-unless-debug"
                       "tramp-compat-funcall"
-                      "tramp-compat-with-temp-message"
                       "tramp-condition-case-unless-debug"
                       "tramp-debug-message"
                       "tramp-error"
@@ -1651,14 +1578,13 @@ If VAR is nil, then we bind `v' to the structure and 
`method', `user',
 
 (put 'with-parsed-tramp-file-name 'lisp-indent-function 2)
 (put 'with-parsed-tramp-file-name 'edebug-form-spec '(form symbolp body))
-(tramp-compat-font-lock-add-keywords
- 'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>"))
+(font-lock-add-keywords 'emacs-lisp-mode 
'("\\<with-parsed-tramp-file-name\\>"))
 
 (defun tramp-progress-reporter-update (reporter &optional value)
   (let* ((parameters (cdr reporter))
         (message (aref parameters 3)))
     (when (string-match message (or (current-message) ""))
-      (tramp-compat-funcall 'progress-reporter-update reporter value))))
+      (progress-reporter-update reporter value))))
 
 (defmacro with-tramp-progress-reporter (vec level message &rest body)
   "Executes BODY, spinning a progress reporter with MESSAGE.
@@ -1675,19 +1601,18 @@ without a visible progress reporter."
                        ;; Display only when there is a minimum level.
                        (<= ,level (min tramp-verbose 3)))
               (ignore-errors
-                (let ((pr (tramp-compat-funcall
-                           #'make-progress-reporter ,message)))
+                (let ((pr (make-progress-reporter ,message nil nil)))
                   (when pr
-                    (run-at-time 3 0.1
-                                 #'tramp-progress-reporter-update pr)))))))
+                    (run-at-time
+                    3 0.1 #'tramp-progress-reporter-update pr)))))))
        (unwind-protect
            ;; Execute the body.
            (prog1 (progn ,@body) (setq cookie "done"))
          ;; Stop progress reporter.
-         (if tm (tramp-compat-funcall 'cancel-timer tm))
+         (if tm (cancel-timer tm))
          (tramp-message ,vec ,level "%s...%s" ,message cookie)))))
 
-(tramp-compat-font-lock-add-keywords
+(font-lock-add-keywords
  'emacs-lisp-mode '("\\<with-tramp-progress-reporter\\>"))
 
 (defmacro with-tramp-file-property (vec file property &rest body)
@@ -1706,8 +1631,7 @@ FILE must be a local file name on a connection identified 
via VEC."
 
 (put 'with-tramp-file-property 'lisp-indent-function 3)
 (put 'with-tramp-file-property 'edebug-form-spec t)
-(tramp-compat-font-lock-add-keywords
- 'emacs-lisp-mode '("\\<with-tramp-file-property\\>"))
+(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-tramp-file-property\\>"))
 
 (defmacro with-tramp-connection-property (key property &rest body)
   "Check in Tramp for property PROPERTY, otherwise executes BODY and set."
@@ -1722,7 +1646,7 @@ FILE must be a local file name on a connection identified 
via VEC."
 
 (put 'with-tramp-connection-property 'lisp-indent-function 2)
 (put 'with-tramp-connection-property 'edebug-form-spec t)
-(tramp-compat-font-lock-add-keywords
+(font-lock-add-keywords
  'emacs-lisp-mode '("\\<with-tramp-connection-property\\>"))
 
 (defun tramp-drop-volume-letter (name)
@@ -1806,28 +1730,22 @@ Adds another overlay hiding filename parts according to 
Tramp's
 special handling of `substitute-in-file-name'."
   (when (symbol-value 'minibuffer-completing-file-name)
     (setq tramp-rfn-eshadow-overlay
-         (tramp-compat-funcall
-          'make-overlay
-          (tramp-compat-funcall 'minibuffer-prompt-end)
-          (tramp-compat-funcall 'minibuffer-prompt-end)))
+         (make-overlay (minibuffer-prompt-end) (minibuffer-prompt-end)))
     ;; Copy rfn-eshadow-overlay properties.
-    (let ((props (tramp-compat-funcall
-                 'overlay-properties (symbol-value 'rfn-eshadow-overlay))))
+    (let ((props (overlay-properties (symbol-value 'rfn-eshadow-overlay))))
       (while props
        ;; The `field' property prevents correct minibuffer
        ;; completion; we exclude it.
        (if (not (eq (car props) 'field))
-           (tramp-compat-funcall
-            'overlay-put tramp-rfn-eshadow-overlay (pop props) (pop props))
+            (overlay-put tramp-rfn-eshadow-overlay (pop props) (pop props))
          (pop props) (pop props))))))
 
-(when (boundp 'rfn-eshadow-setup-minibuffer-hook)
-  (add-hook 'rfn-eshadow-setup-minibuffer-hook
-           'tramp-rfn-eshadow-setup-minibuffer)
-  (add-hook 'tramp-unload-hook
-           (lambda ()
-             (remove-hook 'rfn-eshadow-setup-minibuffer-hook
-                          'tramp-rfn-eshadow-setup-minibuffer))))
+(add-hook 'rfn-eshadow-setup-minibuffer-hook
+         'tramp-rfn-eshadow-setup-minibuffer)
+(add-hook 'tramp-unload-hook
+         (lambda ()
+           (remove-hook 'rfn-eshadow-setup-minibuffer-hook
+                        'tramp-rfn-eshadow-setup-minibuffer)))
 
 (defconst tramp-rfn-eshadow-update-overlay-regexp
   (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format))
@@ -1839,15 +1757,13 @@ This is intended to be used as a minibuffer 
`post-command-hook' for
 been set up by `rfn-eshadow-setup-minibuffer'."
   ;; In remote files name, there is a shadowing just for the local part.
   (ignore-errors
-    (let ((end (or (tramp-compat-funcall
-                   'overlay-end (symbol-value 'rfn-eshadow-overlay))
-                  (tramp-compat-funcall 'minibuffer-prompt-end)))
+    (let ((end (or (overlay-end (symbol-value 'rfn-eshadow-overlay))
+                  (minibuffer-prompt-end)))
          ;; We do not want to send any remote command.
          (non-essential t))
       (when
          (tramp-tramp-file-p
-          (tramp-compat-funcall
-           'buffer-substring-no-properties end (point-max)))
+          (buffer-substring-no-properties end (point-max)))
        (save-excursion
          (save-restriction
            (narrow-to-region
@@ -1859,17 +1775,15 @@ been set up by `rfn-eshadow-setup-minibuffer'."
            (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
                  (rfn-eshadow-update-overlay-hook nil)
                  file-name-handler-alist)
-             (tramp-compat-funcall
-              'move-overlay rfn-eshadow-overlay (point-max) (point-max))
-             (tramp-compat-funcall 'rfn-eshadow-update-overlay))))))))
-
-(when (boundp 'rfn-eshadow-update-overlay-hook)
-  (add-hook 'rfn-eshadow-update-overlay-hook
-           'tramp-rfn-eshadow-update-overlay)
-  (add-hook 'tramp-unload-hook
-           (lambda ()
-             (remove-hook 'rfn-eshadow-update-overlay-hook
-                          'tramp-rfn-eshadow-update-overlay))))
+             (move-overlay rfn-eshadow-overlay (point-max) (point-max))
+             (rfn-eshadow-update-overlay))))))))
+
+(add-hook 'rfn-eshadow-update-overlay-hook
+         'tramp-rfn-eshadow-update-overlay)
+(add-hook 'tramp-unload-hook
+         (lambda ()
+           (remove-hook 'rfn-eshadow-update-overlay-hook
+                        'tramp-rfn-eshadow-update-overlay)))
 
 ;; Inodes don't exist for some file systems.  Therefore we must
 ;; generate virtual ones.  Used in `find-buffer-visiting'.  The method
@@ -1892,12 +1806,13 @@ been set up by `rfn-eshadow-setup-minibuffer'."
 If the file modes of FILENAME cannot be determined, return the
 value of `default-file-modes', without execute permissions."
   (or (file-modes filename)
-      (logand (default-file-modes) (tramp-compat-octal-to-decimal "0666"))))
+      (logand (default-file-modes) (string-to-number "0666" 8))))
 
 (defun tramp-replace-environment-variables (filename)
  "Replace environment variables in FILENAME.
 Return the string with the replaced variables."
  (or (ignore-errors
+       ;; Optional arg has been introduced with Emacs 24 (?).
        (tramp-compat-funcall 'substitute-env-vars filename 'only-defined))
      ;; We need an own implementation.
      (save-match-data
@@ -1912,35 +1827,6 @@ Return the string with the replaced variables."
                  t nil filename)))
         filename))))
 
-;; In XEmacs, electricity is implemented via a key map for ?/ and ?~,
-;; which calls corresponding functions (see minibuf.el).
-(when (fboundp 'minibuffer-electric-separator)
-  (mapc
-   (lambda (x)
-     (eval
-      `(defadvice ,x
-        (around ,(intern (format "tramp-advice-%s" x)) activate)
-        "Invoke `substitute-in-file-name' for Tramp files."
-        (if (and (symbol-value 'minibuffer-electric-file-name-behavior)
-                 (tramp-tramp-file-p (buffer-substring)))
-            ;; We don't need to handle `last-input-event', because
-            ;; due to the key map we know it must be ?/ or ?~.
-            (let ((s (concat (buffer-substring (point-min) (point))
-                             (string last-command-char))))
-              (delete-region (point-min) (point))
-              (insert (substitute-in-file-name s))
-              (setq ad-return-value last-command-char))
-          ad-do-it)))
-     (eval
-      `(add-hook
-       'tramp-unload-hook
-       (lambda ()
-         (ad-remove-advice ',x 'around ',(intern (format "tramp-advice-%s" x)))
-         (ad-activate ',x)))))
-
-   '(minibuffer-electric-separator
-     minibuffer-electric-tilde)))
-
 (defun tramp-find-file-name-coding-system-alist (filename tmpname)
   "Like `find-operation-coding-system' for Tramp filenames.
 Tramp's `insert-file-contents' and `write-region' work over
@@ -2000,49 +1886,35 @@ ARGS are the arguments OPERATION has been called with."
   (cond
    ;; FILE resp DIRECTORY.
    ((member operation
-           (list 'access-file 'byte-compiler-base-file-name 'delete-directory
-                 'delete-file 'diff-latest-backup-file 'directory-file-name
-                 'directory-files 'directory-files-and-attributes
-                 'dired-compress-file 'dired-uncache
-                 'file-accessible-directory-p 'file-attributes
-                 'file-directory-p 'file-executable-p 'file-exists-p
-                 'file-local-copy 'file-modes
-                 'file-name-as-directory 'file-name-directory
-                 'file-name-nondirectory 'file-name-sans-versions
-                 'file-ownership-preserved-p 'file-readable-p
-                 'file-regular-p 'file-remote-p 'file-symlink-p 'file-truename
-                 'file-writable-p 'find-backup-file-name 'find-file-noselect
-                 'get-file-buffer 'insert-directory 'insert-file-contents
-                 'load 'make-directory 'make-directory-internal
-                 'set-file-modes 'substitute-in-file-name
-                 'unhandled-file-name-directory 'vc-registered
-                 ;; Emacs 22+ only.
-                 'set-file-times
-                 ;; Emacs 24+ only.
-                 'file-acl 'file-notify-add-watch
-                 'file-selinux-context 'set-file-acl 'set-file-selinux-context
-                 ;; XEmacs only.
-                 'abbreviate-file-name 'create-file-buffer
-                 'dired-file-modtime 'dired-make-compressed-filename
-                 'dired-recursive-delete-directory 'dired-set-file-modtime
-                 'dired-shell-unhandle-file-name 'dired-uucode-file
-                 'insert-file-contents-literally 'make-temp-name 'recover-file
-                 'vm-imap-check-mail 'vm-pop-check-mail 'vm-spool-check-mail))
+           '(access-file byte-compiler-base-file-name delete-directory
+             delete-file diff-latest-backup-file directory-file-name
+             directory-files directory-files-and-attributes
+             dired-compress-file dired-uncache
+             file-accessible-directory-p file-attributes
+             file-directory-p file-executable-p file-exists-p
+             file-local-copy file-modes
+             file-name-as-directory file-name-directory
+             file-name-nondirectory file-name-sans-versions
+             file-ownership-preserved-p file-readable-p
+             file-regular-p file-remote-p file-symlink-p file-truename
+             file-writable-p find-backup-file-name find-file-noselect
+             get-file-buffer insert-directory insert-file-contents
+             load make-directory make-directory-internal
+             set-file-modes set-file-times substitute-in-file-name
+             unhandled-file-name-directory vc-registered
+             ;; Emacs 24+ only.
+             file-acl file-notify-add-watch file-selinux-context
+             set-file-acl set-file-selinux-context))
     (if (file-name-absolute-p (nth 0 args))
        (nth 0 args)
       (expand-file-name (nth 0 args))))
    ;; FILE DIRECTORY resp FILE1 FILE2.
    ((member operation
-           (list 'add-name-to-file 'copy-file 'expand-file-name
-                 'file-name-all-completions 'file-name-completion
-                 'file-newer-than-file-p 'make-symbolic-link 'rename-file
-                 ;; Emacs 23+ only.
-                 'copy-directory
-                 ;; Emacs 24+ only.
-                 'file-equal-p 'file-in-directory-p
-                 ;; XEmacs only.
-                 'dired-make-relative-symlink
-                 'vm-imap-move-mail 'vm-pop-move-mail 'vm-spool-move-mail))
+           '(add-name-to-file copy-directory copy-file expand-file-name
+             file-name-all-completions file-name-completion
+             file-newer-than-file-p make-symbolic-link rename-file
+             ;; Emacs 24+ only.
+             file-equal-p file-in-directory-p))
     (save-match-data
       (cond
        ((tramp-tramp-file-p (nth 0 args)) (nth 0 args))
@@ -2053,28 +1925,20 @@ ARGS are the arguments OPERATION has been called with."
     (nth 2 args))
    ;; BUFFER.
    ((member operation
-           (list 'set-visited-file-modtime 'verify-visited-file-modtime
-                  ;; Emacs 22+ only.
-                 'make-auto-save-file-name
-                 ;; XEmacs only.
-                 'backup-buffer))
+           '(make-auto-save-file-name
+             set-visited-file-modtime verify-visited-file-modtime))
     (buffer-file-name
      (if (bufferp (nth 0 args)) (nth 0 args) (current-buffer))))
    ;; COMMAND.
    ((member operation
-           (list ;; not in Emacs 23+.
-                 'dired-call-process
-                  ;; Emacs only.
-                 'shell-command
-                  ;; Emacs 22+ only.
-                  'process-file
-                  ;; Emacs 23+ only.
-                  'start-file-process
-                 ;; XEmacs only.
-                 'dired-print-file 'dired-shell-call-process))
+           '(process-file shell-command start-file-process))
     default-directory)
    ;; PROC.
-   ((member operation (list 'file-notify-rm-watch 'file-notify-valid-p))
+   ((member operation
+           '(;; Emacs 24+ only.
+             file-notify-rm-watch
+             ;; Emacs 25+ only.
+             file-notify-valid-p))
     (when (processp (nth 0 args))
       (with-current-buffer (process-buffer (nth 0 args))
        default-directory)))
@@ -2228,10 +2092,7 @@ preventing reentrant calls of Tramp.")
 (progn (defun tramp-completion-file-name-handler (operation &rest args)
   "Invoke Tramp file name completion handler.
 Falls back to normal file name handler if no Tramp file name handler exists."
-  ;; We bind `directory-sep-char' here for XEmacs on Windows, which
-  ;; would otherwise use backslash.
-  (let ((directory-sep-char ?/)
-       (fn (assoc operation tramp-completion-file-name-handler-alist)))
+  (let ((fn (assoc operation tramp-completion-file-name-handler-alist)))
     (if (and
         ;; When `tramp-mode' is not enabled, we don't do anything.
          fn tramp-mode
@@ -2242,8 +2103,7 @@ Falls back to normal file name handler if no Tramp file 
name handler exists."
          ;; indicated his interest in using a fancier completion system.
          (or (eq tramp-syntax 'sep)
              (featurep 'tramp) ;; If it's loaded, we may as well use it.
-            ;; `partial-completion-mode' does not exist in XEmacs.
-            ;; It is obsoleted with Emacs 24.1.
+            ;; `partial-completion-mode' is obsoleted with Emacs 24.1.
              (and (boundp 'partial-completion-mode)
                  (symbol-value 'partial-completion-mode))
              ;; FIXME: These may have been loaded even if the user never
@@ -2256,9 +2116,8 @@ Falls back to normal file name handler if no Tramp file 
name handler exists."
 ;;;###autoload
 (progn (defun tramp-autoload-file-name-handler (operation &rest args)
   "Load Tramp file name handler, and perform OPERATION."
-  ;; Avoid recursive loading of tramp.el.  `temporary-file-directory'
-  ;; does not exist in XEmacs, so we must use something else.
-  (let ((default-directory "/"))
+  ;; Avoid recursive loading of tramp.el.
+  (let ((default-directory temporary-file-directory))
     (load "tramp" nil t))
   (apply operation args)))
 
@@ -2361,7 +2220,7 @@ should never be set globally, the intention is to 
let-bind it.")
 ;; variable. On the other hand, those files shouldn't have partial
 ;; Tramp file name syntax. Maybe another variable should be introduced
 ;; overwriting this check in such cases. Or we change Tramp file name
-;; syntax in order to avoid ambiguities, like in XEmacs ...
+;; syntax in order to avoid ambiguities.
 ;;;###tramp-autoload
 (defun tramp-completion-mode-p ()
   "Check, whether method / user name / host name completion is active."
@@ -2369,7 +2228,6 @@ should never be set globally, the intention is to 
let-bind it.")
    ;; Signal from outside.  `non-essential' has been introduced in Emacs 24.
    (and (boundp 'non-essential) (symbol-value 'non-essential))
    tramp-completion-mode
-   ;; Emacs.
    (equal last-input-event 'tab)
    (and (natnump last-input-event)
        (or
@@ -2377,24 +2235,7 @@ should never be set globally, the intention is to 
let-bind it.")
         (equal last-input-event ?\t)
         (and (not (event-modifiers last-input-event))
              (or (equal last-input-event ?\?)
-                 (equal last-input-event ?\ )))))
-   ;; XEmacs.
-   (and (featurep 'xemacs)
-       ;; `last-input-event' might be nil.
-       (not (null last-input-event))
-       ;; `last-input-event' may have no character approximation.
-       (tramp-compat-funcall 'event-to-character last-input-event)
-       (or
-        ;; ?\t has event-modifier 'control.
-        (equal
-         (tramp-compat-funcall 'event-to-character last-input-event) ?\t)
-        (and (not (event-modifiers last-input-event))
-             (or (equal
-                  (tramp-compat-funcall 'event-to-character last-input-event)
-                  ?\?)
-                 (equal
-                  (tramp-compat-funcall 'event-to-character last-input-event)
-                  ?\ )))))))
+                 (equal last-input-event ?\ )))))))
 
 (defun tramp-connectable-p (filename)
   "Check, whether it is possible to connect the remote host w/o side-effects.
@@ -2868,10 +2709,8 @@ User is always nil."
        (substring directory 0 -1)
       directory)))
 
-(defun tramp-handle-directory-files
-  (directory &optional full match nosort files-only)
+(defun tramp-handle-directory-files (directory &optional full match nosort)
   "Like `directory-files' for Tramp files."
-  ;; FILES-ONLY is valid for XEmacs only.
   (when (file-directory-p directory)
     (setq directory (file-name-as-directory (expand-file-name directory)))
     (let ((temp (nreverse (file-name-all-completions "" directory)))
@@ -2879,12 +2718,7 @@ User is always nil."
 
       (while temp
        (setq item (directory-file-name (pop temp)))
-       (when (and (or (null match) (string-match match item))
-                  (or (null files-only)
-                      ;; Files only.
-                      (and (equal files-only t) (file-regular-p item))
-                      ;; Directories only.
-                      (file-directory-p item)))
+       (when (or (null match) (string-match match item))
          (push (if full (concat directory item) item)
                result)))
       (if nosort result (sort result 'string<)))))
@@ -2894,15 +2728,14 @@ User is always nil."
   "Like `directory-files-and-attributes' for Tramp files."
   (mapcar
    (lambda (x)
-     (cons x (tramp-compat-file-attributes
+     (cons x (file-attributes
              (if full x (expand-file-name x directory)) id-format)))
    (directory-files directory full match nosort)))
 
-(defun tramp-handle-dired-uncache (dir &optional dir-p)
+(defun tramp-handle-dired-uncache (dir)
   "Like `dired-uncache' for Tramp files."
-  ;; DIR-P is valid for XEmacs only.
   (with-parsed-tramp-file-name
-      (if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil
+      (if (file-directory-p dir) dir (file-name-directory dir)) nil
     (tramp-flush-directory-property v localname)))
 
 (defun tramp-handle-file-accessible-directory-p (filename)
@@ -3034,43 +2867,19 @@ User is always nil."
 (defun tramp-handle-find-backup-file-name (filename)
   "Like `find-backup-file-name' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    ;; We set both variables. It doesn't matter whether it is
-    ;; Emacs or XEmacs.
     (let ((backup-directory-alist
-          ;; Emacs case.
-          (when (boundp 'backup-directory-alist)
-            (if (symbol-value 'tramp-backup-directory-alist)
-                (mapcar
-                 (lambda (x)
-                   (cons
-                    (car x)
-                    (if (and (stringp (cdr x))
-                             (file-name-absolute-p (cdr x))
-                             (not (tramp-file-name-p (cdr x))))
-                        (tramp-make-tramp-file-name method user host (cdr x))
-                      (cdr x))))
-                 (symbol-value 'tramp-backup-directory-alist))
-              (symbol-value 'backup-directory-alist))))
-
-         (bkup-backup-directory-info
-          ;; XEmacs case.
-          (when (boundp 'bkup-backup-directory-info)
-            (if (symbol-value 'tramp-bkup-backup-directory-info)
-                (mapcar
-                 (lambda (x)
-                   (nconc
-                    (list (car x))
-                    (list
-                     (if (and (stringp (car (cdr x)))
-                              (file-name-absolute-p (car (cdr x)))
-                              (not (tramp-file-name-p (car (cdr x)))))
-                         (tramp-make-tramp-file-name
-                          method user host (car (cdr x)))
-                       (car (cdr x))))
-                    (cdr (cdr x))))
-                 (symbol-value 'tramp-bkup-backup-directory-info))
-              (symbol-value 'bkup-backup-directory-info)))))
-
+          (if tramp-backup-directory-alist
+              (mapcar
+               (lambda (x)
+                 (cons
+                  (car x)
+                  (if (and (stringp (cdr x))
+                           (file-name-absolute-p (cdr x))
+                           (not (tramp-file-name-p (cdr x))))
+                      (tramp-make-tramp-file-name method user host (cdr x))
+                    (cdr x))))
+               tramp-backup-directory-alist)
+            backup-directory-alist)))
       (tramp-run-real-handler 'find-backup-file-name (list filename)))))
 
 (defun tramp-handle-insert-directory
@@ -3181,8 +2990,7 @@ User is always nil."
                    ;; When the file is not readable for the owner, it
                    ;; cannot be inserted, even if it is readable for the
                    ;; group or for everybody.
-                   (set-file-modes
-                    local-copy (tramp-compat-octal-to-decimal "0600"))
+                   (set-file-modes local-copy (string-to-number "0600" 8))
 
                    (when (and (null remote-copy)
                               (tramp-get-method-parameter
@@ -3192,9 +3000,7 @@ User is always nil."
                      (setq tramp-temp-buffer-file-name local-copy))
 
                    ;; We must ensure that `file-coding-system-alist'
-                   ;; matches `local-copy'.  We must also use `visit',
-                   ;; otherwise there might be an error in the
-                   ;; `revert-buffer' function under XEmacs.
+                   ;; matches `local-copy'.
                    (let ((file-coding-system-alist
                           (tramp-find-file-name-coding-system-alist
                            filename local-copy)))
@@ -3250,7 +3056,7 @@ User is always nil."
        (with-tramp-progress-reporter v 0 (format "Loading %s" file)
          (let ((local-copy (file-local-copy file)))
            (unwind-protect
-               (tramp-compat-load local-copy noerror t nosuffix must-suffix)
+               (load local-copy noerror t nosuffix must-suffix)
              (delete-file local-copy)))))
       t)))
 
@@ -3344,9 +3150,7 @@ User is always nil."
                                     (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)))))))
 
 (defun tramp-handle-substitute-in-file-name (filename)
   "Like `substitute-in-file-name' for Tramp files.
@@ -3366,14 +3170,6 @@ User is always nil."
     (let (process-environment)
       (tramp-run-real-handler 'substitute-in-file-name (list filename)))))
 
-(defun tramp-handle-unhandled-file-name-directory (_filename)
-  "Like `unhandled-file-name-directory' for Tramp files."
-  ;; Starting with Emacs 23, we must simply return nil.  But we must
-  ;; keep backward compatibility, also with XEmacs.  "~/" cannot be
-  ;; returned, because there might be machines without a HOME
-  ;; directory (like hydra).
-  (and (< emacs-major-version 23) "/"))
-
 (defun tramp-handle-set-visited-file-modtime (&optional time-list)
   "Like `set-visited-file-modtime' for Tramp files."
   (unless (buffer-file-name)
@@ -3402,7 +3198,7 @@ of."
       ;; connection.
       (if (or (not f)
              (eq (visited-file-modtime) 0)
-             (not (tramp-file-name-handler 'file-remote-p f nil 'connected)))
+             (not (file-remote-p f nil 'connected)))
          t
        (with-parsed-tramp-file-name f nil
          (let* ((remote-file-name-inhibit-cache t)
@@ -3453,7 +3249,7 @@ of."
        (with-current-buffer (process-buffer proc)
         (file-exists-p
          (concat (file-remote-p default-directory)
-                 (tramp-compat-process-get proc 'watch-name))))))
+                 (process-get proc 'watch-name))))))
 
 ;;; Functions for establishing connection:
 
@@ -3656,9 +3452,7 @@ for process communication also."
       ;; Under Windows XP, accept-process-output doesn't return
       ;; sometimes.  So we add an additional timeout.
       (with-timeout ((or timeout 1))
-       (if (featurep 'xemacs)
-           (accept-process-output p timeout timeout-msecs)
-         (accept-process-output p timeout timeout-msecs (and proc t))))
+       (accept-process-output p timeout timeout-msecs (and proc t)))
       (tramp-message proc 10 "%s %s %s\n%s"
                     proc (process-status proc) p (buffer-string)))))
 
@@ -3683,11 +3477,10 @@ Erase echoed commands if exists."
     (when (or (not (tramp-get-connection-property proc "check-remote-echo" 
nil))
              ;; Sometimes, the echo string is suppressed on the remote side.
              (not (string-equal
-                   (tramp-compat-funcall
-                    'substring-no-properties tramp-echo-mark-marker
+                   (substring-no-properties
+                    tramp-echo-mark-marker
                     0 (min tramp-echo-mark-marker-length (1- (point-max))))
-                   (tramp-compat-funcall
-                    'buffer-substring-no-properties
+                   (buffer-substring-no-properties
                     (point-min)
                     (min (+ (point-min) tramp-echo-mark-marker-length)
                          (point-max))))))
@@ -3705,22 +3498,15 @@ Expects the output of PROC to be sent to the current 
buffer.  Returns
 the string that matched, or nil.  Waits indefinitely if TIMEOUT is
 nil."
   (with-current-buffer (process-buffer proc)
-    (let ((found (tramp-check-for-regexp proc regexp))
-         (start-time (current-time)))
+    (let ((found (tramp-check-for-regexp proc regexp)))
       (cond (timeout
-            ;; Work around a bug in XEmacs 21, where the timeout
-            ;; expires faster than it should.  This degenerates
-            ;; to polling for buggy XEmacsen, but oh, well.
-            (while (and (not found)
-                        (< (tramp-time-diff (current-time) start-time)
-                           timeout))
-              (with-timeout (timeout)
-                (while (not found)
-                  (tramp-accept-process-output proc 1)
-                  (unless (memq (process-status proc) '(run open))
-                    (tramp-error-with-buffer
-                     nil proc 'file-error "Process has died"))
-                  (setq found (tramp-check-for-regexp proc regexp))))))
+            (with-timeout (timeout)
+              (while (not found)
+                (tramp-accept-process-output proc 1)
+                (unless (memq (process-status proc) '(run open))
+                  (tramp-error-with-buffer
+                   nil proc 'file-error "Process has died"))
+                (setq found (tramp-check-for-regexp proc regexp)))))
            (t
             (while (not found)
               (tramp-accept-process-output proc 1)
@@ -3760,9 +3546,8 @@ the remote host use line-endings as defined in the 
variable
       (let (buffer-read-only) (delete-region (point-min) (point-max)))
       ;; Replace "\n" by `tramp-rsh-end-of-line'.
       (setq string
-           (mapconcat 'identity
-                      (tramp-compat-split-string string "\n")
-                      tramp-rsh-end-of-line))
+           (mapconcat
+            'identity (split-string string "\n") tramp-rsh-end-of-line))
       (unless (or (string= string "")
                  (string-equal (substring string -1) tramp-rsh-end-of-line))
        (setq string (concat string tramp-rsh-end-of-line)))
@@ -3826,57 +3611,47 @@ would yield t.  On the other hand, the following check 
results in nil:
     (save-match-data
       (logior
        (cond
-       ((char-equal owner-read ?r) (tramp-compat-octal-to-decimal "00400"))
+       ((char-equal owner-read ?r) (string-to-number "00400" 8))
        ((char-equal owner-read ?-) 0)
        (t (error "Second char `%c' must be one of `r-'" owner-read)))
        (cond
-       ((char-equal owner-write ?w) (tramp-compat-octal-to-decimal "00200"))
+       ((char-equal owner-write ?w) (string-to-number "00200" 8))
        ((char-equal owner-write ?-) 0)
        (t (error "Third char `%c' must be one of `w-'" owner-write)))
        (cond
-       ((char-equal owner-execute-or-setid ?x)
-        (tramp-compat-octal-to-decimal "00100"))
-       ((char-equal owner-execute-or-setid ?S)
-        (tramp-compat-octal-to-decimal "04000"))
-       ((char-equal owner-execute-or-setid ?s)
-        (tramp-compat-octal-to-decimal "04100"))
+       ((char-equal owner-execute-or-setid ?x) (string-to-number "00100" 8))
+       ((char-equal owner-execute-or-setid ?S) (string-to-number "04000" 8))
+       ((char-equal owner-execute-or-setid ?s) (string-to-number "04100" 8))
        ((char-equal owner-execute-or-setid ?-) 0)
        (t (error "Fourth char `%c' must be one of `xsS-'"
                  owner-execute-or-setid)))
        (cond
-       ((char-equal group-read ?r) (tramp-compat-octal-to-decimal "00040"))
+       ((char-equal group-read ?r) (string-to-number "00040" 8))
        ((char-equal group-read ?-) 0)
        (t (error "Fifth char `%c' must be one of `r-'" group-read)))
        (cond
-       ((char-equal group-write ?w) (tramp-compat-octal-to-decimal "00020"))
+       ((char-equal group-write ?w) (string-to-number "00020" 8))
        ((char-equal group-write ?-) 0)
        (t (error "Sixth char `%c' must be one of `w-'" group-write)))
        (cond
-       ((char-equal group-execute-or-setid ?x)
-        (tramp-compat-octal-to-decimal "00010"))
-       ((char-equal group-execute-or-setid ?S)
-        (tramp-compat-octal-to-decimal "02000"))
-       ((char-equal group-execute-or-setid ?s)
-        (tramp-compat-octal-to-decimal "02010"))
+       ((char-equal group-execute-or-setid ?x) (string-to-number "00010" 8))
+       ((char-equal group-execute-or-setid ?S) (string-to-number "02000" 8))
+       ((char-equal group-execute-or-setid ?s) (string-to-number "02010" 8))
        ((char-equal group-execute-or-setid ?-) 0)
        (t (error "Seventh char `%c' must be one of `xsS-'"
                  group-execute-or-setid)))
        (cond
-       ((char-equal other-read ?r)
-        (tramp-compat-octal-to-decimal "00004"))
+       ((char-equal other-read ?r) (string-to-number "00004" 8))
        ((char-equal other-read ?-) 0)
        (t (error "Eighth char `%c' must be one of `r-'" other-read)))
        (cond
-         ((char-equal other-write ?w) (tramp-compat-octal-to-decimal "00002"))
-        ((char-equal other-write ?-) 0)
-         (t (error "Ninth char `%c' must be one of `w-'" other-write)))
+       ((char-equal other-write ?w) (string-to-number "00002" 8))
+       ((char-equal other-write ?-) 0)
+       (t (error "Ninth char `%c' must be one of `w-'" other-write)))
        (cond
-       ((char-equal other-execute-or-sticky ?x)
-        (tramp-compat-octal-to-decimal "00001"))
-       ((char-equal other-execute-or-sticky ?T)
-        (tramp-compat-octal-to-decimal "01000"))
-       ((char-equal other-execute-or-sticky ?t)
-        (tramp-compat-octal-to-decimal "01001"))
+       ((char-equal other-execute-or-sticky ?x) (string-to-number "00001" 8))
+       ((char-equal other-execute-or-sticky ?T) (string-to-number "01000" 8))
+       ((char-equal other-execute-or-sticky ?t) (string-to-number "01001" 8))
        ((char-equal other-execute-or-sticky ?-) 0)
        (t (error "Tenth char `%c' must be one of `xtT-'"
                  other-execute-or-sticky)))))))
@@ -3934,9 +3709,10 @@ This is used internally by `tramp-file-mode-from-int'."
 
 ;;;###tramp-autoload
 (defun tramp-get-local-gid (id-format)
+  ;; `group-gid' has been introduced with Emacs 24.4.
   (if (and (fboundp 'group-gid) (equal id-format 'integer))
       (tramp-compat-funcall 'group-gid)
-    (nth 3 (tramp-compat-file-attributes "~/" id-format))))
+    (nth 3 (file-attributes "~/" id-format))))
 
 ;;;###tramp-autoload
 (defun tramp-check-cached-permissions (vec access)
@@ -3958,7 +3734,7 @@ be granted."
                (tramp-get-file-property
                 vec (tramp-file-name-localname vec)
                 (concat "file-attributes-" suffix) nil)
-               (tramp-compat-file-attributes
+               (file-attributes
                 (tramp-make-tramp-file-name
                  (tramp-file-name-method vec)
                  (tramp-file-name-user vec)
@@ -4029,7 +3805,7 @@ be granted."
              (or (tramp-get-method-parameter vec 'tramp-tmpdir) "/tmp"))))
     (with-tramp-connection-property vec "tmpdir"
       (or (and (file-directory-p dir) (file-writable-p dir)
-              (tramp-file-name-handler 'file-remote-p dir 'localname))
+              (file-remote-p dir 'localname))
          (tramp-error vec 'file-error "Directory %s not accessible" dir)))
     dir))
 
@@ -4050,7 +3826,7 @@ Return the local name of the temporary file."
          (setq result nil)
        ;; This creates the file by side effect.
        (set-file-times result)
-       (set-file-modes result (tramp-compat-octal-to-decimal "0700"))))
+       (set-file-modes result (string-to-number "0700" 8))))
 
     ;; Return the local part.
     (with-parsed-tramp-file-name result nil localname)))
@@ -4066,9 +3842,6 @@ Return the local name of the temporary file."
            (remove-hook 'kill-buffer-hook
                         'tramp-delete-temp-file-function)))
 
-;;; Auto saving to a special directory:
-(defvar auto-save-file-name-transforms)
-
 (defun tramp-handle-make-auto-save-file-name ()
   "Like `make-auto-save-file-name' for Tramp files.
 Returns a file name in `tramp-auto-save-directory' for autosaving
@@ -4083,9 +3856,8 @@ this file, if that variable is non-nil."
 
   (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)))
+        (if (null tramp-auto-save-directory)
+            auto-save-file-name-transforms))
        (buffer-file-name
         (if (null tramp-auto-save-directory)
             buffer-file-name
@@ -4099,61 +3871,8 @@ this file, if that variable is non-nil."
               ("]" . "_r"))
             (buffer-file-name))
            tramp-auto-save-directory))))
-    ;; Run plain `make-auto-save-file-name'.  There might be an advice when
-    ;; it is not a magic file name operation (since Emacs 22).
-    ;; We must deactivate it temporarily.
-    (if (not (ad-is-active 'make-auto-save-file-name))
-       (tramp-run-real-handler 'make-auto-save-file-name nil)
-      ;; else
-      (ad-deactivate 'make-auto-save-file-name)
-      (prog1
-         (tramp-run-real-handler 'make-auto-save-file-name nil)
-       (ad-activate 'make-auto-save-file-name)))))
-
-(unless (tramp-exists-file-name-handler 'make-auto-save-file-name)
-  (defadvice make-auto-save-file-name
-    (around tramp-advice-make-auto-save-file-name () activate)
-    "Invoke `tramp-*-handle-make-auto-save-file-name' for Tramp files."
-    (if (tramp-tramp-file-p (buffer-file-name))
-       ;; We cannot call `tramp-handle-make-auto-save-file-name'
-       ;; directly, because this would bypass the locking mechanism.
-       (setq ad-return-value
-             (tramp-file-name-handler 'make-auto-save-file-name))
-      ad-do-it))
-  (add-hook
-   'tramp-unload-hook
-   (lambda ()
-     (ad-remove-advice
-      'make-auto-save-file-name
-      'around 'tramp-advice-make-auto-save-file-name)
-     (ad-activate 'make-auto-save-file-name))))
-
-;; In XEmacs < 21.5, autosaved remote files have permission 0666 minus
-;; umask. This is a security threat.
-
-(defun tramp-set-auto-save-file-modes ()
-  "Set permissions of autosaved remote files to the original permissions."
-  (let ((bfn (buffer-file-name)))
-    (when (and (tramp-tramp-file-p bfn)
-              (buffer-modified-p)
-              (stringp buffer-auto-save-file-name)
-              (not (equal bfn buffer-auto-save-file-name)))
-      (unless (file-exists-p buffer-auto-save-file-name)
-       (write-region "" nil buffer-auto-save-file-name))
-      ;; Permissions should be set always, because there might be an old
-      ;; auto-saved file belonging to another original file.  This could
-      ;; be a security threat.
-      (set-file-modes
-       buffer-auto-save-file-name
-       (or (file-modes bfn) (tramp-compat-octal-to-decimal "0600"))))))
-
-(unless (and (featurep 'xemacs)
-            (= emacs-major-version 21)
-            (> emacs-minor-version 4))
-  (add-hook 'auto-save-hook 'tramp-set-auto-save-file-modes)
-  (add-hook 'tramp-unload-hook
-           (lambda ()
-             (remove-hook 'auto-save-hook 'tramp-set-auto-save-file-modes))))
+    ;; Run plain `make-auto-save-file-name'.
+    (tramp-run-real-handler 'make-auto-save-file-name nil)))
 
 (defun tramp-subst-strs-in-string (alist string)
   "Replace all occurrences of the string FROM with TO in STRING.
@@ -4247,27 +3966,24 @@ Invokes `password-read' if available, `read-passwd' 
else."
                (tramp-check-for-regexp proc tramp-password-prompt-regexp)
                (format "%s for %s " (capitalize (match-string 1)) key))))
         ;; We suspend the timers while reading the password.
-         (stimers (and (functionp 'with-timeout-suspend)
-                      (tramp-compat-funcall 'with-timeout-suspend)))
+         (stimers (with-timeout-suspend))
         auth-info auth-passwd)
 
     (unwind-protect
        (with-parsed-tramp-file-name key nil
          (prog1
              (or
-              ;; See if auth-sources contains something useful, if
-              ;; it's bound.  `auth-source-user-or-password' is an
-              ;; obsoleted function, it has been replaced by
+              ;; See if auth-sources contains something useful.
+              ;; `auth-source-user-or-password' is an obsoleted
+              ;; function since Emacs 24.1, it has been replaced by
               ;; `auth-source-search'.
               (ignore-errors
-                (and (boundp 'auth-sources)
-                     (tramp-get-connection-property
+                (and (tramp-get-connection-property
                       v "first-password-request" nil)
                      ;; Try with Tramp's current method.
                      (if (fboundp 'auth-source-search)
                          (setq auth-info
-                               (tramp-compat-funcall
-                                'auth-source-search
+                               (auth-source-search
                                 :max 1
                                 :user (or tramp-current-user t)
                                 :host tramp-current-host
@@ -4277,21 +3993,17 @@ Invokes `password-read' if available, `read-passwd' 
else."
                                auth-passwd (if (functionp auth-passwd)
                                                (funcall auth-passwd)
                                              auth-passwd))
-                       (tramp-compat-funcall
-                        'auth-source-user-or-password
+                       (tramp-compat-funcall 'auth-source-user-or-password
                         "password" tramp-current-host tramp-current-method))))
               ;; Try the password cache.
-              (when (functionp 'password-read)
-                (let ((password
-                       (tramp-compat-funcall 'password-read pw-prompt key)))
-                  (tramp-compat-funcall 'password-cache-add key password)
-                  password))
+              (let ((password (password-read pw-prompt key)))
+                (password-cache-add key password)
+                password)
               ;; Else, get the password interactively.
               (read-passwd pw-prompt))
            (tramp-set-connection-property v "first-password-request" nil)))
       ;; Reenable the timers.
-      (and (functionp 'with-timeout-unsuspend)
-          (tramp-compat-funcall 'with-timeout-unsuspend stimers)))))
+      (with-timeout-unsuspend stimers))))
 
 ;;;###tramp-autoload
 (defun tramp-clear-passwd (vec)
@@ -4303,11 +4015,10 @@ Invokes `password-read' if available, `read-passwd' 
else."
        (tramp-dissect-file-name
        (concat
         tramp-prefix-format
-        (tramp-compat-replace-regexp-in-string
+        (replace-regexp-in-string
          (concat tramp-postfix-hop-regexp "$")
          tramp-postfix-host-format hop))))))
-  (tramp-compat-funcall
-   'password-cache-remove
+  (password-cache-remove
    (tramp-make-tramp-file-name
     (tramp-file-name-method vec)
     (tramp-file-name-user vec)
@@ -4330,24 +4041,7 @@ Invokes `password-read' if available, `read-passwd' 
else."
 (defun tramp-time-diff (t1 t2)
   "Return the difference between the two times, in seconds.
 T1 and T2 are time values (as returned by `current-time' for example)."
-  (cond ((and (fboundp 'subtract-time)
-             (fboundp 'float-time))
-         (tramp-compat-funcall
-         'float-time (tramp-compat-funcall 'subtract-time t1 t2)))
-       ((and (fboundp 'subtract-time)
-             (fboundp 'time-to-seconds))
-         (tramp-compat-funcall
-         'time-to-seconds (tramp-compat-funcall 'subtract-time t1 t2)))
-        ((fboundp 'itimer-time-difference)
-        (tramp-compat-funcall
-         'itimer-time-difference
-         (if (< (length t1) 3) (append t1 '(0)) t1)
-         (if (< (length t2) 3) (append t2 '(0)) t2)))
-        (t
-        (let ((time (time-subtract t1 t2)))
-          (+ (* (car time) 65536.0)
-             (cadr time)
-             (/ (or (nth 2 time) 0) 1000000.0))))))
+  (float-time (subtract-time t1 t2)))
 
 ;; Currently (as of Emacs 20.5), the function `shell-quote-argument'
 ;; does not deal well with newline characters.  Newline is replaced by
@@ -4442,7 +4136,6 @@ Only works for Bourne-like shells."
 ;; * In Emacs 21, `insert-directory' shows total number of bytes used
 ;;   by the files in that directory.  Add this here.
 ;; * Avoid screen blanking when hitting `g' in dired.  (Eli Tziperman)
-;; * abbreviate-file-name
 ;; * Better error checking.  At least whenever we see something
 ;;   strange when doing zerop, we should kill the process and start
 ;;   again.  (Greg Stark)
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index fc65c0a..64cc47e 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -6,7 +6,7 @@
 ;; Author: Kai Großjohann <address@hidden>
 ;; Keywords: comm, processes
 ;; Package: tramp
-;; Version: 2.2.13.25.1
+;; Version: 2.3.0-pre
 
 ;; This file is part of GNU Emacs.
 
@@ -27,45 +27,36 @@
 
 ;; In the Tramp GIT repository, the version number and the bug report
 ;; address are auto-frobbed from configure.ac, so you should edit that
-;; file and run "autoconf && ./configure" to change them.  (X)Emacs
+;; file and run "autoconf && ./configure" to change them.  Emacs
 ;; version check is defined in macro AC_EMACS_INFO of aclocal.m4;
 ;; should be changed only there.
 
 ;;;###tramp-autoload
-(defconst tramp-version "2.2.13.25.1"
+(defconst tramp-version "2.3.0-pre"
   "This version of Tramp.")
 
 ;;;###tramp-autoload
 (defconst tramp-bug-report-address "address@hidden"
   "Email address to send bug reports to.")
 
-;; `locate-dominating-file' does not exist in XEmacs. But it is not used here.
-(autoload 'locate-dominating-file "files")
-(autoload 'tramp-compat-replace-regexp-in-string "tramp-compat")
-
 (defun tramp-repository-get-version ()
   "Try to return as a string the repository revision of the Tramp sources."
-  (unless (featurep 'xemacs)
-    (let ((dir (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)))
-                (tramp-compat-replace-regexp-in-string
-                 "\n" "" (buffer-string)))))))))
-
-;; Check for (X)Emacs version.
-(let ((x (if (or (>= emacs-major-version 22)
-                (and (featurep 'xemacs)
-                     (= emacs-major-version 21)
-                     (>= emacs-minor-version 4)))
-            "ok"
-          (format "Tramp 2.2.13.25.1 is not fit for %s"
-                  (when (string-match "^.*$" (emacs-version))
-                    (match-string 0 (emacs-version)))))))
+  (let ((dir (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 Emacs version.
+(let ((x (if (>= emacs-major-version 23)
+    "ok"
+  (format "Tramp 2.3.0-pre is not fit for %s"
+         (when (string-match "^.*$" (emacs-version))
+           (match-string 0 (emacs-version)))))))
   (unless (string-match "\\`ok\\'" x) (error "%s" x)))
 
 (add-hook 'tramp-unload-hook



reply via email to

[Prev in Thread] Current Thread [Next in Thread]