emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/tramp 373c0b5: Tramp ELPA version 2.5.0.2 released


From: Michael Albinus
Subject: [elpa] externals/tramp 373c0b5: Tramp ELPA version 2.5.0.2 released
Date: Sat, 27 Feb 2021 04:47:50 -0500 (EST)

branch: externals/tramp
commit 373c0b5e5823ba21733f7d32166a97edfa7a90b9
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Tramp ELPA version 2.5.0.2 released
---
 test/tramp-tests.el |  32 ++++--
 texi/tramp.texi     | 285 ++++++++++++++++++++++++++++++----------------------
 texi/trampver.texi  |   2 +-
 tramp-adb.el        |  26 ++---
 tramp-cmds.el       |   2 +-
 tramp-compat.el     |   7 ++
 tramp-crypt.el      |  14 +--
 tramp-gvfs.el       | 182 +++++++++++++++++++--------------
 tramp-rclone.el     |  83 +++------------
 tramp-sh.el         |  74 +++++---------
 tramp-smb.el        |  48 ++++-----
 tramp-sudoedit.el   |  11 +-
 tramp.el            |  43 ++++----
 trampver.el         |  11 +-
 14 files changed, 406 insertions(+), 414 deletions(-)

diff --git a/test/tramp-tests.el b/test/tramp-tests.el
index 982d85e..719e97d 100644
--- a/test/tramp-tests.el
+++ b/test/tramp-tests.el
@@ -2182,6 +2182,16 @@ is greater than 10.
       (expand-file-name ".." "./"))
     (concat (file-remote-p tramp-test-temporary-file-directory) "/"))))
 
+(ert-deftest tramp-test05-expand-file-name-top ()
+  "Check `expand-file-name'."
+  (skip-unless (tramp--test-enabled))
+  (skip-unless (not (tramp--test-ange-ftp-p)))
+
+  (let ((dir (concat (file-remote-p tramp-test-temporary-file-directory) "/")))
+    (dolist (local '("." ".."))
+      (should (string-equal (expand-file-name local dir) dir))
+      (should (string-equal (expand-file-name (concat dir local)) dir)))))
+
 (ert-deftest tramp-test06-directory-file-name ()
   "Check `directory-file-name'.
 This checks also `file-name-as-directory', `file-name-directory',
@@ -5092,8 +5102,10 @@ INPUT, if non-nil, is a string sent to the process."
             (string-match-p
              (regexp-quote envvar)
              ;; We must remove PS1, the output is truncated otherwise.
+             ;; We must suppress "_=VAR...".
              (funcall
-              this-shell-command-to-string "printenv | grep -v PS1")))))))))
+              this-shell-command-to-string
+              "printenv | grep -v PS1 | grep -v _=")))))))))
 
 (tramp--test--deftest-direct-async-process tramp-test33-environment-variables
   "Check that remote processes set / unset environment variables properly.
@@ -5739,6 +5751,11 @@ This does not support globbing characters in file names 
(yet)."
   (string-match-p
    "ftp$" (file-remote-p tramp-test-temporary-file-directory 'method)))
 
+(defun tramp--test-gdrive-p ()
+  "Check, whether the gdrive method is used."
+  (string-equal
+   "gdrive" (file-remote-p tramp-test-temporary-file-directory 'method)))
+
 (defun tramp--test-gvfs-p (&optional method)
   "Check, whether the remote host runs a GVFS based method.
 This requires restrictions of file name syntax.
@@ -5769,11 +5786,6 @@ This does not support external Emacs calls."
   (string-equal
    "mock" (file-remote-p tramp-test-temporary-file-directory 'method)))
 
-(defun tramp--test-nextcloud-p ()
-  "Check, whether the nextcloud method is used."
-  (string-equal
-   "nextcloud" (file-remote-p tramp-test-temporary-file-directory 'method)))
-
 (defun tramp--test-rclone-p ()
   "Check, whether the remote host is offered by rclone.
 This requires restrictions of file name syntax."
@@ -6144,7 +6156,6 @@ Use the `ls' command."
   (skip-unless (tramp--test-enabled))
   (skip-unless (tramp--test-sh-p))
   (skip-unless (not (tramp--test-rsync-p)))
-  (skip-unless (not (tramp--test-windows-nt-and-batch-p)))
   (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
   (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
 
@@ -6214,6 +6225,7 @@ Use the `ls' command."
   (skip-unless (not (tramp--test-windows-nt-and-batch-p)))
   (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
   (skip-unless (not (tramp--test-ksh-p)))
+  (skip-unless (not (tramp--test-gdrive-p)))
   (skip-unless (not (tramp--test-crypt-p)))
   (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
 
@@ -6838,8 +6850,8 @@ Since it unloads Tramp, it shall be the last test to run."
 If INTERACTIVE is non-nil, the tests are run interactively."
   (interactive "p")
   (funcall
-   (if interactive
-       #'ert-run-tests-interactively #'ert-run-tests-batch) "^tramp"))
+   (if interactive #'ert-run-tests-interactively #'ert-run-tests-batch)
+   "^tramp"))
 
 ;; TODO:
 
@@ -6855,8 +6867,6 @@ If INTERACTIVE is non-nil, the tests are run 
interactively."
 ;; * Work on skipped tests.  Make a comment, when it is impossible.
 ;; * Revisit expensive tests, once problems in `tramp-error' are solved.
 ;; * Fix `tramp-test06-directory-file-name' for `ftp'.
-;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file'
-;;   do not work properly for `nextcloud'.
 ;; * Implement `tramp-test31-interrupt-process' for `adb' and for
 ;;   direct async processes.
 ;; * Fix `tramp-test44-threads'.
diff --git a/texi/tramp.texi b/texi/tramp.texi
index aabda59..382feb8 100644
--- a/texi/tramp.texi
+++ b/texi/tramp.texi
@@ -223,7 +223,7 @@ presented here to illustrate the steps involved:
 
 @kbd{C-x C-f} to initiate find-file, enter part of the @value{tramp}
 file name, then hit @kbd{@key{TAB}} for completion.  If this is the
-first time connection to that host, here's what happens:
+first time connecting to that host, here's what happens:
 
 @itemize
 @item
@@ -250,17 +250,17 @@ message.
 
 If @value{tramp} does not receive any messages within a timeout period
 (a minute, for example), then @value{tramp} responds with an error
-message about not finding the remote shell prompt.  If any messages
-from the remote host, @value{tramp} displays them in the buffer.
+message about not finding the remote shell prompt.  If there are any
+messages from the remote host, @value{tramp} displays them in the
+buffer.
 
 For any @samp{login failed} message from the remote host,
-@value{tramp} aborts the login attempt, and repeats the login steps
-again.
+@value{tramp} aborts the login attempt, and repeats the login steps.
 
 @item
-Upon successful login and @value{tramp} recognizes the shell prompt
+Upon successful login, if @value{tramp} recognizes the shell prompt
 from the remote host, @value{tramp} prepares the shell environment by
-turning off echoing, setting shell prompt, and other housekeeping
+turning off echoing, setting the shell prompt, and other housekeeping
 chores.
 
 @strong{Note} that for the remote shell, @value{tramp} invokes
@@ -282,8 +282,8 @@ contents from the remote host.
 
 For inline transfers, @value{tramp} sends a command, such as
 @samp{mimencode -b /path/to/remote/file}, waits until the output has
-accumulated in the buffer, decodes that output to produce the file's
-contents.
+accumulated in the buffer, then decodes that output to produce the
+file's contents.
 
 For external transfers, @value{tramp} sends a command as follows:
 @example
@@ -335,7 +335,7 @@ versions packaged with Emacs can be retrieved by
 @end lisp
 
 @value{tramp} is also available as @uref{https://elpa.gnu.org, GNU
-ELPA} package.  Besides the standalone releases, further minor version
+ELPA} package.  Besides the standalone releases, further minor versions
 of @value{tramp} will appear on GNU ELPA, until the next @value{tramp}
 release appears.  These minor versions have a four-number string, like
 ``2.4.5.1''.
@@ -345,7 +345,7 @@ Development versions contain new and incomplete features.  
The
 development version of @value{tramp} is always the version number of
 the next release, plus the suffix ``-pre'', like ``2.4.4-pre''.
 
-One way to obtain @value{tramp} from Git server is to visit the
+One way to obtain @value{tramp} from the Git server is to visit the
 Savannah project page at the following URL and then clicking on the
 Git link in the navigation bar at the top.
 
@@ -363,7 +363,7 @@ $ git clone git://git.savannah.gnu.org/tramp.git
 @end example
 
 @noindent
-From behind a firewall:
+From behind a proxy:
 
 @example
 @group
@@ -411,7 +411,7 @@ $ autoconf
 @end ifset
 @ifclear installchapter
 See the file @file{INSTALL} in that directory for further information
-how to install @value{tramp}.
+on how to install @value{tramp}.
 @end ifclear
 
 
@@ -419,16 +419,16 @@ how to install @value{tramp}.
 @chapter Short introduction how to use @value{tramp}
 @cindex quick start guide
 
-@value{tramp} extends the Emacs file name syntax by a remote
-component.  A remote file name looks always like
+@value{tramp} extends the Emacs file name syntax by adding a remote
+component.  A remote file name always looks like
 @file{@trampfn{method,user@@host,/path/to/file}}.
 
 You can use remote files exactly like ordinary files, that means you
-could open a file or directory by @kbd{C-x C-f
+can open a file or directory by @kbd{C-x C-f
 @trampfn{method,user@@host,/path/to/file} @key{RET}}, edit the file,
 and save it.  You can also mix local files and remote files in file
 operations with two arguments, like @code{copy-file} or
-@code{rename-file}.  And finally, you can run even processes on a
+@code{rename-file}.  And finally, you can even run processes on a
 remote host, when the buffer you call the process from has a remote
 @code{default-directory}.
 
@@ -437,26 +437,26 @@ remote host, when the buffer you call the process from 
has a remote
 @section File name syntax
 @cindex file name syntax
 
-Remote file names are prepended by the @code{method}, @code{user} and
-@code{host} parts.  All of them, and also the local file name part,
-are optional, in case of a missing part a default value is assumed.
-The default value for an empty local file name part is the remote
-user's home directory.  The shortest remote file name is
-@file{@trampfn{-,,}}, therefore.  The @samp{-} notation for the
-default method is used for syntactical reasons, @ref{Default Method}.
+Remote file names have @code{method}, @code{user} and @code{host}
+parts prepended.  All of them, and also the local file name part, are
+optional, in case of a missing part a default value is assumed.  The
+default value for an empty local file name part is the remote user's
+home directory.  The shortest remote file name is thus
+@file{@trampfn{-,,}}.  The @samp{-} notation for the default method is
+used for syntactical reasons, @ref{Default Method}.
 
 The @code{method} part describes the connection method used to reach
 the remote host, see below.
 
 The @code{user} part is the user name for accessing the remote host.
 For the @option{smb} method, this could also require a domain name, in
-this case it is written as @code{user%domain}.
+which case it is written as @code{user%domain}.
 
-The @code{host} part must be a host name which could be resolved on
+The @code{host} part must be a host name which can be resolved on
 your local host.  It could be a short host name, a fully qualified
 domain name, an IPv4 or IPv6 address, @ref{File name syntax}.  Some
-connection methods support also a notation of the port to be used, in
-this case it is written as @code{host#port}.
+connection methods also support a notation for the port to be used, in
+which case it is written as @code{host#port}.
 
 
 @anchor{Quick Start Guide: @option{ssh} and @option{plink} methods}
@@ -470,9 +470,9 @@ If your local host runs an SSH client, and the remote host 
runs an SSH
 server, the simplest remote file name is
 @file{@trampfn{ssh,user@@host,/path/to/file}}.  The remote file name
 @file{@trampfn{ssh,,}} opens a remote connection to yourself on the
-local host, and is taken often for testing @value{tramp}.
+local host, and is often used for testing @value{tramp}.
 
-On MS Windows, PuTTY is often used as SSH client.  Its @command{plink}
+On MS Windows, PuTTY is often used as the SSH client.  Its @command{plink}
 method can be used there to open a connection to a remote host running
 an @command{ssh} server:
 @file{@trampfn{plink,user@@host,/path/to/file}}.
@@ -488,14 +488,14 @@ an @command{ssh} server:
 @cindex @option{sg} method
 
 Sometimes, it is necessary to work on your local host under different
-permissions.  For this, you could use the @option{su} or @option{sudo}
+permissions.  For this, you can use the @option{su} or @option{sudo}
 connection method.  Both methods use @samp{root} as default user name
 and the return value of @code{(system-name)} as default host name.
 Therefore, it is convenient to open a file as
 @file{@trampfn{sudo,,/path/to/file}}.
 
-The method @option{sg} stands for ``switch group''; the changed group
-must be used here as user name.  The default host name is the same.
+The method @option{sg} stands for ``switch group''; here the user name
+is used as the group to change to.  The default host name is the same.
 
 
 @anchor{Quick Start Guide: @option{ssh}, @option{plink}, @option{su}, 
@option{sudo} and @option{sg} methods}
@@ -509,9 +509,9 @@ must be used here as user name.  The default host name is 
the same.
 @cindex method @option{sudo}
 @cindex @option{sudo} method
 
-If the @option{su} or @option{sudo} option shall be performed on
-another host, it could be comnbined with a leading @option{ssh} or
-@option{plink} option.  That means, @value{tramp} connects first to
+If the @option{su} or @option{sudo} option should be performed on
+another host, it can be comnbined with a leading @option{ssh} or
+@option{plink} option.  That means that @value{tramp} connects first to
 the other host with non-administrative credentials, and changes to
 administrative credentials on that host afterwards.  In a simple case,
 the syntax looks like
@@ -527,8 +527,8 @@ the syntax looks like
 The @option{sudoedit} method is similar to the @option{sudo} method.
 However, it is a different implementation: it does not keep an open
 session running in the background.  This is for security reasons; on
-the backside this method is less performant than the @option{sudo}
-method, it is restricted to the @samp{localhost} only, and it does not
+the backside this method has worse performance than the @option{sudo}
+method, it is restricted to @samp{localhost} only, and it does not
 support external processes.
 
 
@@ -561,9 +561,9 @@ of the local file name is the share exported by the remote 
host,
 @cindex method @option{mtp}
 @cindex @option{mtp} method
 
-On systems, which have installed @acronym{GVFS, the GNOME Virtual File
-System}, its offered methods could be used by @value{tramp}.  Examples
-are @file{@trampfn{sftp,user@@host,/path/to/file}},
+On systems which have @acronym{GVFS, the GNOME Virtual File System}
+installed, its offered methods can be used by @value{tramp}.
+Examples are @file{@trampfn{sftp,user@@host,/path/to/file}},
 @file{@trampfn{afp,user@@host,/path/to/file}} (accessing Apple's AFP
 file system), @file{@trampfn{dav,user@@host,/path/to/file}},
 @file{@trampfn{davs,user@@host,/path/to/file}} (for WebDAV shares) and
@@ -580,10 +580,10 @@ file system), 
@file{@trampfn{dav,user@@host,/path/to/file}},
 @cindex @option{nextcloud} method
 @cindex nextcloud
 
-@acronym{GVFS}-based methods include also @acronym{GNOME} Online
+@acronym{GVFS}-based methods also include @acronym{GNOME} Online
 Accounts, which support the @option{Files} service.  These are the
 Google Drive file system, and the OwnCloud/NextCloud file system.  The
-file name syntax is here always
+file name syntax here is always
 @file{@trampfn{gdrive,john.doe@@gmail.com,/path/to/file}}
 (@samp{john.doe@@gmail.com} stands here for your Google Drive
 account), or @file{@trampfn{nextcloud,user@@host#8081,/path/to/file}}
@@ -608,7 +608,7 @@ needed.  The file name syntax is 
@file{@trampfn{adb,,/path/to/file}}.
 
 A convenient way to access system storages is the @command{rclone}
 program.  If you have configured a storage in @command{rclone} under a
-name @samp{storage} (for example), you could access it via the remote
+name @samp{storage} (for example), you can access it via the remote
 file name syntax @file{@trampfn{rclone,storage,/path/to/file}}.  User
 names are not needed.
 
@@ -630,7 +630,7 @@ For changing the connection type and file access method 
from the
 defaults to one of several other options, @xref{Connection types}.
 
 @strong{Note} that some user options described in these examples are
-not auto loaded by Emacs.  All examples require @value{tramp} is
+not auto loaded by Emacs.  All examples require @value{tramp} to be
 installed and loaded:
 
 @lisp
@@ -638,7 +638,7 @@ installed and loaded:
 @end lisp
 
 For functions used to configure @value{tramp}, the following clause
-might be used in your init file:
+may be used in your init file:
 
 @lisp
 (with-eval-after-load 'tramp (tramp-change-syntax 'simplified))
@@ -693,13 +693,13 @@ methods.  While these methods do see better performance 
when actually
 transferring files, the overhead of the cryptographic negotiation at
 startup may drown out the improvement in file transfer times.
 
-External methods should be configured such a way that they don't
-require a password (with @command{ssh-agent}, or such alike).  Modern
+External methods should be configured in such a way that they don't
+require a password (with @command{ssh-agent}, or similar).  Modern
 @command{scp} implementations offer options to reuse existing
-@command{ssh} connections, which will be enabled by default if
-available.  If it isn't possible, you should consider @ref{Password
-handling}, otherwise you will be prompted for a password every copy
-action.
+@command{ssh} connections, which @value{tramp} enables by default if
+available.  If that is not possible, you should consider @ref{Password
+handling}, otherwise you will be prompted for a password for every
+copy action.
 
 
 @node Inline methods
@@ -727,17 +727,17 @@ usability of one of the commands defined in
 reliable command it finds.  @value{tramp}'s search path can be
 customized, see @ref{Remote programs}.
 
-In case none of the commands are unavailable, @value{tramp} first
-transfers a small Perl program to the remote host, and then tries that
-program for encoding and decoding.
+In case none of the commands are available, @value{tramp} first
+transfers a small Perl program to the remote host, and then tries to
+use that program for encoding and decoding.
 
 @vindex tramp-inline-compress-start-size
 @vindex tramp-inline-compress-commands
-To increase transfer speeds for large text files, use compression
-before encoding.  The user option
-@code{tramp-inline-compress-start-size} specifies the file size for
-such optimization.  This feature depends on the availability and
-usability of one of the commands defined in
+To increase transfer speeds for large text files, @value{tramp} can
+use compression before encoding.  The user option
+@code{tramp-inline-compress-start-size} specifies the file size above
+which to use this optimization.  This feature depends on the
+availability and usability of one of the commands defined in
 @code{tramp-inline-compress-commands}.
 
 @table @asis
@@ -747,6 +747,8 @@ usability of one of the commands defined in
 
 @command{rsh} is an option for connecting to hosts within local
 networks since @command{rsh} is not as secure as other methods.
+There should be no reason to use it, as @command{ssh} is a both a
+complete replacement and ubiquitous.
 
 @item @option{ssh}
 @cindex method @option{ssh}
@@ -784,7 +786,7 @@ Similar to @option{su} method, @option{sudo} uses 
@command{sudo}.
 @command{sudo} must have sufficient rights to start a shell.
 
 For security reasons, a @option{sudo} connection is disabled after a
-predefined timeout (5 minutes per default).  This can be changed, see
+predefined timeout (5 minutes by default).  This can be changed, see
 @ref{Predefined connection information}.
 
 @item @option{doas}
@@ -1180,10 +1182,10 @@ of the configured system storage.
 Optional flags to the different @option{rclone} operations could be
 passed as connection property, @xref{Predefined connection
 information}.  Supported properties are @t{"mount-args"},
-@t{"copyto-args"} and @t{"moveto-args"}.
+@t{"copyto-args"}, @t{"moveto-args"} and @t{"about-args"}.
 
 Access via @option{rclone} is slow.  If you have an alternative method
-for accessing the system storage, you shall prefer this.
+for accessing the system storage, you should use it.
 @ref{GVFS-based methods} for example, methods @option{gdrive} and
 @option{nextcloud}.
 
@@ -1908,10 +1910,10 @@ machine melancholia#4711 port davs login daniel%BIZARRE 
password geheim
 @end example
 
 @vindex auth-source-save-behavior
-If there doesn't exist a proper entry, the password is read
+If no proper entry exists, the password is read
 interactively.  After successful login (verification of the password),
-it is offered to save a corresponding entry for further use by
-@code{auth-source} backends which support this.  This could be changed
+Emacs offers to save a corresponding entry for further use by
+@code{auth-source} backends which support this.  This can be changed
 by setting the user option @code{auth-source-save-behavior} to @code{nil}.
 
 @vindex auth-source-debug
@@ -1927,6 +1929,25 @@ file, you must customize @code{ange-ftp-netrc-filename}:
 (customize-set-variable 'ange-ftp-netrc-filename "~/.authinfo.gpg")
 @end lisp
 
+In case you do not want to use an authentication file for
+@value{tramp} passwords, use connection-local variables
+@ifinfo
+(@pxref{Connection Variables, , , emacs})
+@end ifinfo
+like this:
+
+@lisp
+@group
+(connection-local-set-profile-variables
+ 'remote-without-auth-sources '((auth-sources . nil)))
+@end group
+
+@group
+(connection-local-set-profiles
+ '(:application tramp) 'remote-without-auth-sources)
+@end group
+@end lisp
+
 
 @anchor{Caching passwords}
 @subsection Caching passwords
@@ -2018,10 +2039,10 @@ properties are listed here:
 @itemize
 @item @t{"login-program"}
 
-The property @t{"login-program"} keeps the program to be called in
-order to connect the remote host.  Sometimes, the program might have
-another name on your host, or it is located on another path.  In this
-case, you can overwrite the default value, which is special for every
+The property @t{"login-program"} stores the program to be used to
+connect to the remote host.  Sometimes, the program might have another
+name on your host, or it might be located in another path.  In this case,
+you can overwrite the default value, which is special for every
 connection method.  It is used in all connection methods of
 @file{tramp-sh.el}.
 
@@ -2074,19 +2095,21 @@ Connections using the @option{smb} method check, 
whether the remote
 host supports posix commands.  If the remote host runs Samba, it
 confirms this capability.  However, some very old Samba versions have
 errors in their implementation.  In order to suppress the posix
-commands for those hosts, the property @t{"posix"} shall be set to
+commands for those hosts, the property @t{"posix"} should be set to
 @code{nil}.
 
 The default value of this property is @code{t} (not specified in
 @code{tramp-methods}).  If the remote host runs native MS Windows,
-there is no effect of this property.
+this propery has no effect.
 
 @item @t{"mount-args"}@*
 @t{"copyto-args"}@*
-@t{"moveto-args"}
+@t{"moveto-args"}@*
+@t{"about-args"}
 
 These properties keep optional flags to the different @option{rclone}
-operations.  Their default value is @code{nil}.
+operations.  See their default values in @code{tramp-methods} if you
+want to change their values.
 @end itemize
 
 
@@ -2186,7 +2209,7 @@ be recomputed.  To force @value{tramp} to recompute 
afresh, call
 @subsection Changing the default remote or local shell
 @cindex zsh setup
 
-Per default, @value{tramp} uses the command @command{/bin/sh} for
+By default, @value{tramp} uses the command @command{/bin/sh} for
 starting a shell on the remote host.  This can be changed by setting
 the connection property @t{"remote-shell"}; see @pxref{Predefined
 connection information}.  If you want, for example, use
@@ -2195,7 +2218,7 @@ connection information}.  If you want, for example, use
 @lisp
 @group
 (add-to-list 'tramp-connection-properties
-             (list (regexp-quote "@trampfn{ssh,user@@host,}")
+             (list (regexp-quote "@trampfn{sshx,user@@host,}")
                    "remote-shell" "/usr/bin/zsh"))
 @end group
 @end lisp
@@ -2211,7 +2234,7 @@ This approach has also the advantage, that settings in
 trouble with the shell prompt due to set zle options will be avoided.
 
 Similar problems can happen with the local shell Tramp uses to create
-a process.  Per default, it uses the command @command{/bin/sh} for
+a process.  By default, it uses the command @command{/bin/sh} for
 this, which could also be a link to another shell.  In order to
 overwrite this, you might apply
 
@@ -2311,7 +2334,7 @@ prompts, for which @value{tramp} uses 
@code{tramp-wrong-passwd-regexp}.
 
 @value{tramp} uses the user option @code{tramp-terminal-type} to set
 the remote environment variable @env{TERM} for the shells it runs.
-Per default, it is @t{"dumb"}, but this could be changed.  A dumb
+By default, it is @t{"dumb"}, but this could be changed.  A dumb
 terminal is best suited to run the background sessions of
 @value{tramp}.  However, running interactive remote shells might
 require a different setting.  This could be achieved by tweaking the
@@ -2343,10 +2366,16 @@ fi
 
 Another possibility is to check the environment variable
 @env{INSIDE_EMACS}.  Like for all subprocesses of Emacs, this is set
-to the version of the parent Emacs process, @xref{Interactive Shell, ,
-, emacs}.  @value{tramp} adds its own package version to this string,
-which could be used for further tests in an inferior shell.  The
-string of that environment variable looks always like
+to the version of the parent Emacs
+@ifinfo
+process, @xref{Interactive Shell, , , emacs}.
+@end ifinfo
+@ifnotinfo
+process.
+@end ifnotinfo
+@value{tramp} adds its own package version to this string, which could
+be used for further tests in an inferior shell.  The string of that
+environment variable looks always like
 
 @example
 @group
@@ -2792,9 +2821,10 @@ visiting a file will show its encrypted contents.  
However, it is
 highly discouraged to mix encrypted and not encrypted files in the
 same directory.
 
-@deffn Command tramp-crypt-add-directory name
-If a remote directory shall not include encrypted files anymore, it
-must be indicated by this command.
+@deffn Command tramp-crypt-remove-directory name
+This command should be used to indicate that files in @code{name}
+should no longer be encrypted.  Existing encrypted files and
+subdirectories will remain encrypted.
 @end deffn
 
 
@@ -3188,19 +3218,19 @@ host when the variable @code{default-directory} is 
remote:
 @end lisp
 
 @vindex process-file-return-signal-string
-@code{process-file} shall return either the exit code of the process,
-or a string describing the signal, when the process has been
-interrupted.  Since it cannot be determined reliably whether a remote
-process has been interrupted, @code{process-file} returns always the
-exit code.  When the user option
+For a local process, @code{process-file} returns either the exit code
+of the process, or a string describing a signal, when the process has
+been interrupted.  Since it cannot be determined reliably whether a
+remote process has been interrupted, @code{process-file} will always
+returns the exit code for it.  When the user option
 @code{process-file-return-signal-string} is non-@code{nil},
-@code{process-file} regards all exit codes greater than 128 as an
+@code{process-file} treats all exit codes greater than 128 as an
 indication that the process has been interrupted, and returns a
-respective string.
+corresponding string.
 
-Remote processes do not apply to @acronym{GVFS} (see @ref{GVFS-based
-methods}) because the remote file system is mounted on the local host
-and @value{tramp} just accesses by changing the
+This remote process handling does not apply to @acronym{GVFS} (see
+@ref{GVFS-based methods}) because the remote file system is mounted on
+the local host and @value{tramp} accesses it by changing the
 @code{default-directory}.
 
 @value{tramp} starts a remote process when a command is executed in a
@@ -3211,7 +3241,7 @@ integrated to work with @value{tramp}: @file{shell.el},
 
 @vindex INSIDE_EMACS@r{, environment variable}
 @value{tramp} always modifies the @env{INSIDE_EMACS} environment
-variable for remote processes.  Per default, this environment variable
+variable for remote processes.  By default, this environment variable
 shows the Emacs version.  @value{tramp} adds its own version string,
 so it looks like @samp{27.2,tramp:2.4.5.1}.  However, other packages
 might also add their name to this environment variable, like
@@ -3266,8 +3296,8 @@ local @file{.emacs} file:
 
 @vindex ENV@r{, environment variable}
 Setting the @env{ENV} environment variable instructs some shells to
-read an initialization file.  Per default, @value{tramp} has disabled
-this.  You could overwrite this behavior by evaluating
+read an initialization file.  By default, @value{tramp} disables
+this.  You can override this behavior by evaluating
 
 @lisp
 @group
@@ -3470,10 +3500,13 @@ uid=0(root) gid=0(root) groups=0(root)
 @cindex @code{gdb}
 @cindex @code{perldb}
 
-@file{gud.el} provides a unified interface to symbolic debuggers
+@file{gud.el} provides a unified interface to symbolic
 @ifinfo
-(@ref{Debuggers, , , emacs}).
+debuggers (@pxref{Debuggers, , , emacs}).
 @end ifinfo
+@ifnotinfo
+debuggers.
+@end ifnotinfo
 @value{tramp} can run debug on remote hosts by calling @code{gdb}
 with a remote file name:
 
@@ -3634,9 +3667,15 @@ minibuffer.  Each connection is of the format
 
 Flushing remote connections also cleans the password cache
 (@pxref{Password handling}), file cache, connection cache
-(@pxref{Connection caching}), and recentf cache (@pxref{File
-Conveniences, , , emacs}).  It also deletes session timers
-(@pxref{Predefined connection information}) and connection buffers.
+(@pxref{Connection caching}), and recentf
+@ifinfo
+cache (@pxref{File Conveniences, , , emacs}).
+@end ifinfo
+@ifnotinfo
+cache.
+@end ifnotinfo
+It also deletes session timers (@pxref{Predefined connection
+information}) and connection buffers.
 
 If @var{keep-debug} is non-@code{nil}, the debug buffer is kept.  A
 non-@code{nil} @var{keep-password} preserves the password cache.
@@ -4348,7 +4387,7 @@ this @code{nil} setting:
 
 @vindex ProxyCommand@r{, ssh option}
 @vindex ProxyJump@r{, ssh option}
-This shall also be set to @code{nil} if you use the
+This should also be set to @code{nil} if you use the
 @option{ProxyCommand} or @option{ProxyJump} options in your
 @command{ssh} configuration.
 
@@ -4541,10 +4580,16 @@ HISTFILE=/dev/null
 @item
 Where are remote files trashed to?
 
-Emacs can trash file instead of deleting them, @ref{Misc File Ops,
-Trashing , , emacs}.  Remote files are always trashed to the local
-trash, except remote encrypted files (@pxref{Keeping files
-encrypted}), which are deleted anyway.
+Emacs can trash file instead of deleting
+@ifinfo
+them, @ref{Misc File Ops, Trashing , , emacs}.
+@end ifinfo
+@ifnotinfo
+them.
+@end ifnotinfo
+Remote files are always trashed to the local trash, except remote
+encrypted files (@pxref{Keeping files encrypted}), which are deleted
+anyway.
 
 If Emacs is configured to use the XDG conventions for the trash
 directory, remote files cannot be restored with the respective tools,
@@ -4912,9 +4957,9 @@ I get an error @samp{Remote file error: Forbidden 
reentrant call of Tramp}
 Timers, process filters and sentinels, and other event based functions
 can run at any time, when a remote file operation is still running.
 This can cause @value{tramp} to block.  When such a situation is
-detected, this error is triggered.  It shall be fixed in the
-respective function (an error report will help), but for the time
-being you can suppress this error by the following code in your
+detected, this error is triggered.  It should be fixed in the
+respective function (sending an error report will help), but for the
+time being you can suppress this error by the following code in your
 @file{~/.emacs}:
 
 @lisp
@@ -5097,9 +5142,9 @@ sending a string to a process, or waiting for process 
output.  They
 can run any remote file operation, which would conflict with the
 already running remote file operation, if the same connection is
 affected.  @value{tramp} detects this situation, and raises the
-@code{remote-file-error} error.  A timer function shall avoid this
-situation.  At least, it shall protect itself against this error, by
-wrapping the timer function body with
+@code{remote-file-error} error.  A timer function should avoid this
+situation.  As a minimum, it should protect itself against this error, by
+wrapping the timer function body as follows:
 
 @lisp
 @group
@@ -5151,8 +5196,8 @@ Other navigation keys are described in
 @ref{Outline Visibility, , , emacs}.
 @end ifinfo
 
-@value{tramp} handles errors internally.  But to get a Lisp backtrace,
-both the error and the signal have to be set as follows:
+@value{tramp} handles errors internally.  Hence, to get a Lisp backtrace,
+the following settings are required:
 
 @lisp
 @group
@@ -5166,15 +5211,15 @@ backtraces are also added to the @value{tramp} debug 
buffer in case of
 errors.
 
 In very rare cases it could happen, that @value{tramp} blocks Emacs.
-Killing Emacs does not allow to inspect the debug buffer.  In that
-case, you might instruct @value{tramp} to mirror the debug buffer to
-file:
+Killing Emacs does not allow inspecting the debug buffer.  In that
+case, you can instruct @value{tramp} to mirror the debug buffer to
+a file:
 
 @lisp
 (customize-set-variable 'tramp-debug-to-file t)
 @end lisp
 
-The debug buffer is written as file in your
+The debug buffer is written as a file in your
 @code{temporary-file-directory}, which is usually @file{/tmp/}.  Use
 this option with care, because it could decrease the performance of
 @value{tramp} actions.
diff --git a/texi/trampver.texi b/texi/trampver.texi
index bc7eadb..580c390 100644
--- a/texi/trampver.texi
+++ b/texi/trampver.texi
@@ -8,7 +8,7 @@
 @c In the Tramp GIT, the version numbers are auto-frobbed from
 @c tramp.el, and the bug report address is auto-frobbed from
 @c configure.ac.
-@set trampver 2.5.0.1
+@set trampver 2.5.0.2
 @set trampurl https://www.gnu.org/software/tramp/
 @set tramp-bug-report-address tramp-devel@@gnu.org
 @set emacsver 25.1
diff --git a/tramp-adb.el b/tramp-adb.el
index 73dffe1..6ec4d1f 100644
--- a/tramp-adb.el
+++ b/tramp-adb.el
@@ -197,13 +197,13 @@ It is used for TCP/IP devices."
                tramp-adb-method)))
 
 ;;;###tramp-autoload
-(defun tramp-adb-file-name-handler (operation &rest arguments)
+(defun tramp-adb-file-name-handler (operation &rest args)
   "Invoke the ADB handler for OPERATION.
 First arg specifies the OPERATION, second arg is a list of
-ARGUMENTS to pass to the OPERATION."
+arguments to pass to the OPERATION."
   (if-let ((fn (assoc operation tramp-adb-file-name-handler-alist)))
-      (save-match-data (apply (cdr fn) arguments))
-    (tramp-run-real-handler operation arguments)))
+      (save-match-data (apply (cdr fn) args))
+    (tramp-run-real-handler operation args)))
 
 ;;;###tramp-autoload
 (tramp--with-startup
@@ -305,9 +305,7 @@ ARGUMENTS to pass to the OPERATION."
   (directory &optional full match nosort id-format count)
   "Like `directory-files-and-attributes' for Tramp files."
   (unless (file-exists-p directory)
-    (tramp-error
-     (tramp-dissect-file-name directory) tramp-file-missing
-     "No such file or directory" directory))
+    (tramp-compat-file-missing (tramp-dissect-file-name directory) directory))
   (when (file-directory-p directory)
     (with-parsed-tramp-file-name (expand-file-name directory) nil
       (copy-tree
@@ -435,7 +433,7 @@ Emacs dired can't find files."
   (setq dir (expand-file-name dir))
   (with-parsed-tramp-file-name dir nil
     (when (and (null parents) (file-exists-p dir))
-      (tramp-error v 'file-already-exists "Directory already exists %s" dir))
+      (tramp-error v 'file-already-exists dir))
     (when parents
       (let ((par (expand-file-name ".." dir)))
        (unless (file-directory-p par)
@@ -498,9 +496,7 @@ Emacs dired can't find files."
   "Like `file-local-copy' for Tramp files."
   (with-parsed-tramp-file-name filename nil
     (unless (file-exists-p (file-truename filename))
-      (tramp-error
-       v tramp-file-missing
-       "Cannot make local copy of non-existing file `%s'" filename))
+      (tramp-compat-file-missing v filename))
     (let ((tmpfile (tramp-compat-make-temp-file filename)))
       (with-tramp-progress-reporter
          v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
@@ -642,9 +638,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
          (jka-compr-inhibit t))
       (with-parsed-tramp-file-name (if t1 filename newname) nil
        (unless (file-exists-p filename)
-         (tramp-error
-          v tramp-file-missing
-          "Copying file" "No such file or directory" filename))
+         (tramp-compat-file-missing v filename))
        (when (and (not ok-if-already-exists) (file-exists-p newname))
          (tramp-error v 'file-already-exists newname))
        (when (and (file-directory-p newname)
@@ -726,9 +720,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
          (jka-compr-inhibit t))
       (with-parsed-tramp-file-name (if t1 filename newname) nil
        (unless (file-exists-p filename)
-         (tramp-error
-          v tramp-file-missing
-          "Renaming file" "No such file or directory" filename))
+         (tramp-compat-file-missing v filename))
        (when (and (not ok-if-already-exists) (file-exists-p newname))
          (tramp-error v 'file-already-exists newname))
        (when (and (file-directory-p newname)
diff --git a/tramp-cmds.el b/tramp-cmds.el
index 097f25e..f0bbe31 100644
--- a/tramp-cmds.el
+++ b/tramp-cmds.el
@@ -465,7 +465,7 @@ For details, see `tramp-rename-files'."
 
 ;;;###tramp-autoload
 (defun tramp-version (arg)
-  "Print version number of tramp.el in minibuffer or current buffer."
+  "Print version number of tramp.el in echo area or current buffer."
   (interactive "P")
   (if arg (insert tramp-version) (message tramp-version)))
 
diff --git a/tramp-compat.el b/tramp-compat.el
index 80347cd..00e29bf 100644
--- a/tramp-compat.el
+++ b/tramp-compat.el
@@ -41,6 +41,7 @@
 (require 'shell)
 (require 'subr-x)
 
+(declare-function tramp-error "tramp")
 ;; `temporary-file-directory' as function is introduced with Emacs 26.1.
 (declare-function tramp-handle-temporary-file-directory "tramp")
 (declare-function tramp-tramp-file-p "tramp")
@@ -178,6 +179,12 @@ This is a string of ten letters or dashes as in ls -l."
   (if (get 'file-missing 'error-conditions) 'file-missing 'file-error)
   "The error symbol for the `file-missing' error.")
 
+(defsubst tramp-compat-file-missing (vec file)
+  "Emit the `file-missing' error."
+  (if (get 'file-missing 'error-conditions)
+      (tramp-error vec tramp-file-missing file)
+    (tramp-error vec tramp-file-missing "No such file or directory: %s" file)))
+
 ;; `file-local-name', `file-name-quoted-p', `file-name-quote' and
 ;; `file-name-unquote' are introduced in Emacs 26.1.
 (defalias 'tramp-compat-file-local-name
diff --git a/tramp-crypt.el b/tramp-crypt.el
index a10da25..f8de708 100644
--- a/tramp-crypt.el
+++ b/tramp-crypt.el
@@ -1,6 +1,6 @@
 ;;; tramp-crypt.el --- Tramp crypt utilities  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2021 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -249,7 +249,7 @@ arguments to pass to the OPERATION."
 ;;;###tramp-autoload
 (defun tramp-crypt-file-name-handler (operation &rest args)
   "Invoke the crypted remote file related OPERATION.
-First arg specifies the OPERATION, second arg ARGS is a list of
+First arg specifies the OPERATION, second arg is a list of
 arguments to pass to the OPERATION."
   (if-let ((filename
            (apply #'tramp-crypt-file-name-for-operation operation args))
@@ -568,9 +568,7 @@ absolute file names."
 
       (with-parsed-tramp-file-name (if t1 filename newname) nil
        (unless (file-exists-p filename)
-         (tramp-error
-          v tramp-file-missing
-          "%s file" msg-operation "No such file or directory" filename))
+         (tramp-compat-file-missing v filename))
        (when (and (not ok-if-already-exists) (file-exists-p newname))
          (tramp-error v 'file-already-exists newname))
        (when (and (file-directory-p newname)
@@ -672,9 +670,7 @@ absolute file names."
     (directory &optional full match nosort count)
   "Like `directory-files' for Tramp files."
   (unless (file-exists-p directory)
-    (tramp-error
-     (tramp-dissect-file-name directory) tramp-file-missing
-     "No such file or directory" directory))
+    (tramp-compat-file-missing (tramp-dissect-file-name directory) directory))
   (when (file-directory-p directory)
     (setq directory (file-name-as-directory (expand-file-name directory)))
     (let* (tramp-crypt-enabled
@@ -781,7 +777,7 @@ WILDCARD is not supported."
   "Like `make-directory' for Tramp files."
   (with-parsed-tramp-file-name (expand-file-name dir) nil
     (when (and (null parents) (file-exists-p dir))
-      (tramp-error v 'file-already-exists "Directory already exists %s" dir))
+      (tramp-error v 'file-already-exists dir))
     (let (tramp-crypt-enabled)
       (make-directory (tramp-crypt-encrypt-file-name dir) parents))
     ;; When PARENTS is non-nil, DIR could be a chain of non-existent
diff --git a/tramp-gvfs.el b/tramp-gvfs.el
index f882636..9d4e04c 100644
--- a/tramp-gvfs.el
+++ b/tramp-gvfs.el
@@ -841,8 +841,8 @@ Operations not mentioned here will be handled by the 
default Emacs primitives.")
 ;;;###tramp-autoload
 (defun tramp-gvfs-file-name-handler (operation &rest args)
   "Invoke the GVFS related OPERATION and ARGS.
-First arg specifies the OPERATION, second arg is a list of arguments to
-pass to the OPERATION."
+First arg specifies the OPERATION, second arg is a list of
+arguments to pass to the OPERATION."
   (unless tramp-gvfs-enabled
     (tramp-user-error nil "Package `tramp-gvfs' not supported"))
   (if-let ((fn (assoc operation tramp-gvfs-file-name-handler-alist)))
@@ -945,7 +945,7 @@ is no information where to trace the message.")
   "Called when a D-Bus error message arrives, see 
`dbus-event-error-functions'."
   (when tramp-gvfs-dbus-event-vector
     (tramp-message tramp-gvfs-dbus-event-vector 6 "%S" event)
-    (tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err))))
+    (tramp-error tramp-gvfs-dbus-event-vector 'file-error (cadr err))))
 
 (add-hook 'dbus-event-error-functions #'tramp-gvfs-dbus-event-error)
 (add-hook 'tramp-gvfs-unload-hook
@@ -985,83 +985,97 @@ file names."
     (let ((t1 (tramp-tramp-file-p filename))
          (t2 (tramp-tramp-file-p newname))
          (equal-remote (tramp-equal-remote filename newname))
+         (volatile
+          (and (eq op 'rename) (tramp-gvfs-file-name-p filename)
+               (equal
+                (cdr
+                 (assoc
+                  "standard::is-volatile"
+                  (tramp-gvfs-get-file-attributes filename)))
+                "TRUE")))
          ;; "gvfs-rename" is not trustworthy.
          (gvfs-operation (if (eq op 'copy) "gvfs-copy" "gvfs-move"))
          (msg-operation (if (eq op 'copy) "Copying" "Renaming")))
 
       (with-parsed-tramp-file-name (if t1 filename newname) nil
        (unless (file-exists-p filename)
-         (tramp-error
-          v tramp-file-missing
-          "%s file" msg-operation "No such file or directory" filename))
+         (tramp-compat-file-missing v filename))
        (when (and (not ok-if-already-exists) (file-exists-p newname))
          (tramp-error v 'file-already-exists newname))
        (when (and (file-directory-p newname)
                   (not (directory-name-p newname)))
          (tramp-error v 'file-error "File is a directory %s" newname))
 
-       (if (or (and equal-remote
-                    (tramp-get-connection-property v "direct-copy-failed" nil))
-               (and t1 (not (tramp-gvfs-file-name-p filename)))
-               (and t2 (not (tramp-gvfs-file-name-p newname))))
-
-           ;; We cannot copy or rename directly.
-           (let ((tmpfile (tramp-compat-make-temp-file filename)))
-             (if (eq op 'copy)
-                 (copy-file
-                  filename tmpfile t keep-date preserve-uid-gid
-                  preserve-extended-attributes)
-               (rename-file filename tmpfile t))
-             (rename-file tmpfile newname ok-if-already-exists))
-
-         ;; Direct action.
-         (with-tramp-progress-reporter
-             v 0 (format "%s %s to %s" msg-operation filename newname)
-           (unless
-               (and (apply
-                     #'tramp-gvfs-send-command v gvfs-operation
-                     (append
-                      (and (eq op 'copy) (or keep-date preserve-uid-gid)
-                           '("--preserve"))
-                      (list
-                       (tramp-gvfs-url-file-name filename)
-                       (tramp-gvfs-url-file-name newname))))
-                    ;; Some backends do not return a proper error
-                    ;; code in case of direct copy/move.  Apply sanity checks.
-                    (or (not equal-remote)
-                        (tramp-gvfs-send-command
-                         v "gvfs-info" (tramp-gvfs-url-file-name newname))
-                        (eq op 'copy)
-                        (not (tramp-gvfs-send-command
-                              v "gvfs-info"
-                              (tramp-gvfs-url-file-name filename)))))
-
-             (if (or (not equal-remote)
-                     (and equal-remote
-                          (tramp-get-connection-property
-                           v "direct-copy-failed" nil)))
-                 ;; Propagate the error.
-                 (with-current-buffer (tramp-get-connection-buffer v)
-                   (goto-char (point-min))
-                   (tramp-error-with-buffer
-                    nil v 'file-error
-                    "%s failed, see buffer `%s' for details."
-                    msg-operation (buffer-name)))
-
-               ;; Some WebDAV server, like the one from QNAP, do not
-               ;; support direct copy/move.  Try a fallback.
-               (tramp-set-connection-property v "direct-copy-failed" t)
-               (tramp-gvfs-do-copy-or-rename-file
-                op filename newname ok-if-already-exists keep-date
-                preserve-uid-gid preserve-extended-attributes))))
-
-         (when (and t1 (eq op 'rename))
-           (with-parsed-tramp-file-name filename nil
-             (tramp-flush-file-properties v localname)))
-
-         (when t2
-           (with-parsed-tramp-file-name newname nil
-             (tramp-flush-file-properties v localname))))))))
+       (cond
+        ;; We cannot rename volatile files, as used by Google-drive.
+        ((and (not equal-remote) volatile)
+         (prog1 (copy-file
+                 filename newname ok-if-already-exists keep-date
+                 preserve-uid-gid preserve-extended-attributes)
+           (delete-file filename)))
+
+        ;; We cannot copy or rename directly.
+        ((or (and equal-remote
+                  (tramp-get-connection-property v "direct-copy-failed" nil))
+             (and t1 (not (tramp-gvfs-file-name-p filename)))
+             (and t2 (not (tramp-gvfs-file-name-p newname))))
+         (let ((tmpfile (tramp-compat-make-temp-file filename)))
+           (if (eq op 'copy)
+               (copy-file
+                filename tmpfile t keep-date preserve-uid-gid
+                preserve-extended-attributes)
+             (rename-file filename tmpfile t))
+           (rename-file tmpfile newname ok-if-already-exists)))
+
+        ;; Direct action.
+        (t (with-tramp-progress-reporter
+               v 0 (format "%s %s to %s" msg-operation filename newname)
+             (unless
+                 (and (apply
+                       #'tramp-gvfs-send-command v gvfs-operation
+                       (append
+                        (and (eq op 'copy) (or keep-date preserve-uid-gid)
+                             '("--preserve"))
+                        (list
+                         (tramp-gvfs-url-file-name filename)
+                         (tramp-gvfs-url-file-name newname))))
+                      ;; Some backends do not return a proper error
+                      ;; code in case of direct copy/move.  Apply
+                      ;; sanity checks.
+                      (or (not equal-remote)
+                          (tramp-gvfs-send-command
+                           v "gvfs-info" (tramp-gvfs-url-file-name newname))
+                          (eq op 'copy)
+                          (not (tramp-gvfs-send-command
+                                v "gvfs-info"
+                                (tramp-gvfs-url-file-name filename)))))
+
+               (if (or (not equal-remote)
+                       (and equal-remote
+                            (tramp-get-connection-property
+                             v "direct-copy-failed" nil)))
+                   ;; Propagate the error.
+                   (with-current-buffer (tramp-get-connection-buffer v)
+                     (goto-char (point-min))
+                     (tramp-error-with-buffer
+                      nil v 'file-error
+                      "%s failed, see buffer `%s' for details."
+                      msg-operation (buffer-name)))
+
+                 ;; Some WebDAV server, like the one from QNAP, do
+                 ;; not support direct copy/move.  Try a fallback.
+                 (tramp-set-connection-property v "direct-copy-failed" t)
+                 (tramp-gvfs-do-copy-or-rename-file
+                  op filename newname ok-if-already-exists keep-date
+                  preserve-uid-gid preserve-extended-attributes))))
+
+           (when (and t1 (eq op 'rename))
+             (with-parsed-tramp-file-name filename nil
+               (tramp-flush-file-properties v localname)))
+
+           (when t2
+             (with-parsed-tramp-file-name newname nil
+               (tramp-flush-file-properties v localname)))))))))
 
 (defun tramp-gvfs-handle-copy-file
   (filename newname &optional ok-if-already-exists keep-date
@@ -1158,6 +1172,9 @@ file names."
       ;; There might be a double slash.  Remove this.
       (while (string-match "//" localname)
        (setq localname (replace-match "/" t t localname)))
+      ;; Do not keep "/..".
+      (when (string-match-p "^/\\.\\.?$" localname)
+       (setq localname "/"))
       ;; No tilde characters in file name, do normal
       ;; `expand-file-name' (this does "/./" and "/../").
       (tramp-make-tramp-file-name
@@ -1545,7 +1562,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
   (setq dir (directory-file-name (expand-file-name dir)))
   (with-parsed-tramp-file-name dir nil
     (when (and (null parents) (file-exists-p dir))
-      (tramp-error v 'file-already-exists "Directory already exists %s" dir))
+      (tramp-error v 'file-already-exists dir))
     (tramp-flush-directory-properties v localname)
     (save-match-data
       (let ((ldir (file-name-directory dir)))
@@ -1575,20 +1592,31 @@ If FILE-SYSTEM is non-nil, return file system 
attributes."
     (tramp-run-real-handler
      #'rename-file (list filename newname ok-if-already-exists))))
 
+(defun tramp-gvfs-set-attribute (vec &rest args)
+  "Call \"gio set ...\" if possible."
+  (let ((key (concat "gvfs-set-attribute-" (nth 3 args))))
+    (when (tramp-get-connection-property vec key t)
+      (or (apply #'tramp-gvfs-send-command vec "gvfs-set-attribute" args)
+         (with-current-buffer (tramp-get-connection-buffer vec)
+           (goto-char (point-min))
+           (when (looking-at-p "gio: Operation not supported")
+             (tramp-set-connection-property vec key nil)))
+         nil))))
+
 (defun tramp-gvfs-handle-set-file-modes (filename mode &optional flag)
   "Like `set-file-modes' for Tramp files."
   (with-parsed-tramp-file-name filename nil
     (tramp-flush-file-properties v localname)
-    (tramp-gvfs-send-command
-     v "gvfs-set-attribute" (if (eq flag 'nofollow) "-nt" "-t") "uint32"
+    (tramp-gvfs-set-attribute
+     v (if (eq flag 'nofollow) "-nt" "-t") "uint32"
      (tramp-gvfs-url-file-name filename) "unix::mode" (number-to-string 
mode))))
 
 (defun tramp-gvfs-handle-set-file-times (filename &optional time flag)
   "Like `set-file-times' for Tramp files."
   (with-parsed-tramp-file-name filename nil
     (tramp-flush-file-properties v localname)
-    (tramp-gvfs-send-command
-     v "gvfs-set-attribute" (if (eq flag 'nofollow) "-nt" "-t") "uint64"
+    (tramp-gvfs-set-attribute
+     v (if (eq flag 'nofollow) "-nt" "-t") "uint64"
      (tramp-gvfs-url-file-name filename) "time::modified"
      (format-time-string
       "%s" (if (or (null time)
@@ -1622,12 +1650,12 @@ ID-FORMAT valid values are `string' and `integer'."
   (with-parsed-tramp-file-name filename nil
     (tramp-flush-file-properties v localname)
     (when (natnump uid)
-      (tramp-gvfs-send-command
-       v "gvfs-set-attribute" "-t" "uint32"
+      (tramp-gvfs-set-attribute
+       v "-t" "uint32"
        (tramp-gvfs-url-file-name filename) "unix::uid" (number-to-string uid)))
     (when (natnump gid)
-      (tramp-gvfs-send-command
-       v "gvfs-set-attribute" "-t" "uint32"
+      (tramp-gvfs-set-attribute
+       v "-t" "uint32"
        (tramp-gvfs-url-file-name filename)
        "unix::gid" (number-to-string gid)))))
 
diff --git a/tramp-rclone.el b/tramp-rclone.el
index 8638bb4..a7f4c9b 100644
--- a/tramp-rclone.el
+++ b/tramp-rclone.el
@@ -53,7 +53,12 @@
 (tramp--with-startup
  (add-to-list 'tramp-methods
              `(,tramp-rclone-method
-               (tramp-mount-args nil)
+               ;; Be careful changing "--dir-cache-time", this could
+               ;; delay visibility of files.  Since we use Tramp's
+               ;; internal cache for file attributes, there shouldn't
+               ;; be serious performance penalties when set to 0.
+               (tramp-mount-args
+                ("--no-unicode-normalization" "--dir-cache-time" "0s"))
                (tramp-copyto-args nil)
                (tramp-moveto-args nil)
                (tramp-about-args ("--full"))))
@@ -157,8 +162,8 @@ Operations not mentioned here will be handled by the 
default Emacs primitives.")
 ;;;###tramp-autoload
 (defun tramp-rclone-file-name-handler (operation &rest args)
   "Invoke the rclone handler for OPERATION and ARGS.
-First arg specifies the OPERATION, second arg is a list of arguments to
-pass to the OPERATION."
+First arg specifies the OPERATION, second arg is a list of
+arguments to pass to the OPERATION."
   (if-let ((fn (assoc operation tramp-rclone-file-name-handler-alist)))
       (save-match-data (apply (cdr fn) args))
     (tramp-run-real-handler operation args)))
@@ -215,9 +220,7 @@ file names."
 
       (with-parsed-tramp-file-name (if t1 filename newname) nil
        (unless (file-exists-p filename)
-         (tramp-error
-          v tramp-file-missing
-          "%s file" msg-operation "No such file or directory" filename))
+         (tramp-compat-file-missing v filename))
        (when (and (not ok-if-already-exists) (file-exists-p newname))
          (tramp-error v 'file-already-exists newname))
        (when (and (file-directory-p newname)
@@ -249,24 +252,13 @@ file names."
               "Error %s `%s' `%s'" msg-operation filename newname)))
 
          (when (and t1 (eq op 'rename))
-           (with-parsed-tramp-file-name filename v1
-             (tramp-flush-file-properties v1 v1-localname)
-             (when (tramp-rclone-file-name-p filename)
-               (tramp-rclone-flush-directory-cache v1)
-               ;; The mount point's directory cache might need time
-               ;; to flush.
-               (while (file-exists-p filename)
-                 (tramp-flush-file-properties v1 v1-localname)))))
+           (while (file-exists-p filename)
+             (with-parsed-tramp-file-name filename v1
+               (tramp-flush-file-properties v1 v1-localname))))
 
          (when t2
            (with-parsed-tramp-file-name newname v2
-             (tramp-flush-file-properties v2 v2-localname)
-             (when (tramp-rclone-file-name-p newname)
-               (tramp-rclone-flush-directory-cache v2)
-               ;; The mount point's directory cache might need time
-               ;; to flush.
-               (while (not (file-exists-p newname))
-                 (tramp-flush-file-properties v2 v2-localname))))))))))
+             (tramp-flush-file-properties v2 v2-localname))))))))
 
 (defun tramp-rclone-handle-copy-file
   (filename newname &optional ok-if-already-exists keep-date
@@ -290,13 +282,11 @@ file names."
   "Like `delete-directory' for Tramp files."
   (with-parsed-tramp-file-name (expand-file-name directory) nil
     (tramp-flush-directory-properties v localname)
-    (tramp-rclone-flush-directory-cache v)
     (delete-directory (tramp-rclone-local-file-name directory) recursive 
trash)))
 
 (defun tramp-rclone-handle-delete-file (filename &optional trash)
   "Like `delete-file' for Tramp files."
   (with-parsed-tramp-file-name (expand-file-name filename) nil
-    (tramp-rclone-flush-directory-cache v)
     (delete-file (tramp-rclone-local-file-name filename) trash)
     (tramp-flush-file-properties v localname)))
 
@@ -304,9 +294,7 @@ file names."
     (directory &optional full match nosort count)
   "Like `directory-files' for Tramp files."
   (unless (file-exists-p directory)
-    (tramp-error
-     (tramp-dissect-file-name directory) tramp-file-missing
-     "No such file or directory" directory))
+    (tramp-compat-file-missing (tramp-dissect-file-name directory) directory))
   (when (file-directory-p directory)
     (setq directory (file-name-as-directory (expand-file-name directory)))
     (with-parsed-tramp-file-name directory nil
@@ -424,8 +412,7 @@ file names."
     ;; whole file cache.
     (tramp-flush-file-properties v localname)
     (tramp-flush-directory-properties
-     v (if parents "/" (file-name-directory localname)))
-    (tramp-rclone-flush-directory-cache v)))
+     v (if parents "/" (file-name-directory localname)))))
 
 (defun tramp-rclone-handle-rename-file
   (filename newname &optional ok-if-already-exists)
@@ -471,39 +458,6 @@ file names."
                  mount)
             (match-string 1 mount)))))))
 
-(defun tramp-rclone-flush-directory-cache (vec)
-  "Flush directory cache of VEC mount."
-  (let ((rclone-pid
-        ;; Identify rclone process.
-        (when (tramp-get-connection-process vec)
-          (with-tramp-connection-property
-              (tramp-get-connection-process vec) "rclone-pid"
-            (catch 'pid
-              (dolist
-                  (pid
-                   ;; Until Emacs 25, `process-attributes' could
-                   ;; crash Emacs for some processes.  So we use
-                   ;; "pidof", which might not work everywhere.
-                   (if (<= emacs-major-version 25)
-                       (let ((default-directory
-                               (tramp-compat-temporary-file-directory)))
-                         (mapcar
-                          #'string-to-number
-                          (split-string
-                           (shell-command-to-string "pidof rclone"))))
-                     (list-system-processes)))
-                (and (string-match-p
-                      (regexp-quote
-                       (format "rclone mount %s:" (tramp-file-name-host vec)))
-                      (or (cdr (assoc 'args (process-attributes pid))) ""))
-                     (throw 'pid pid))))))))
-    ;; Send a SIGHUP in order to flush directory cache.
-    (when rclone-pid
-      (tramp-message
-       vec 6 "Send SIGHUP %d: %s"
-       rclone-pid (cdr (assoc 'args (process-attributes rclone-pid))))
-      (signal-process rclone-pid 'SIGHUP))))
-
 (defun tramp-rclone-local-file-name (filename)
   "Return local mount name of FILENAME."
   (setq filename (tramp-compat-file-name-unquote (expand-file-name filename)))
@@ -576,7 +530,7 @@ connection if a previous connection has died for some 
reason."
               `("mount" ,(concat host ":/")
                 ,(tramp-rclone-mount-point vec)
                 ;; This could be nil.
-                ,(tramp-get-method-parameter vec 'tramp-mount-args))))
+                ,@(tramp-get-method-parameter vec 'tramp-mount-args))))
        (while (not (file-exists-p (tramp-make-tramp-file-name vec 'noloc)))
          (tramp-cleanup-connection vec 'keep-debug 'keep-password))
 
@@ -611,9 +565,4 @@ The command is the list of strings ARGS."
 
 (provide 'tramp-rclone)
 
-;;; TODO:
-
-;; * If possible, get rid of "rclone mount".  Maybe it is more
-;;   performant then.
-
 ;;; tramp-rclone.el ends here
diff --git a/tramp-sh.el b/tramp-sh.el
index 2274efd..5730199 100644
--- a/tramp-sh.el
+++ b/tramp-sh.el
@@ -1094,7 +1094,8 @@ component is used as the target of the symlink."
          (unless ln
            (tramp-error
             v 'file-error
-          "Making a symbolic link.  ln(1) does not exist on the remote host."))
+            (concat "Making a symbolic link. "
+                    "ln(1) does not exist on the remote host.")))
 
          ;; Do the 'confirm if exists' thing.
          (when (file-exists-p linkname)
@@ -1724,9 +1725,8 @@ ID-FORMAT valid values are `string' and `integer'."
   "Like `directory-files-and-attributes' for Tramp files."
   (unless id-format (setq id-format 'integer))
   (unless (file-exists-p directory)
-    (tramp-error
-     (tramp-dissect-file-name directory) tramp-file-missing
-     "No such file or directory" directory))
+    (tramp-compat-file-missing
+     (tramp-dissect-file-name directory) directory))
   (when (file-directory-p directory)
     (setq directory (expand-file-name directory))
     (let* ((temp
@@ -1877,8 +1877,9 @@ ID-FORMAT valid values are `string' and `integer'."
               ;; side.
               (unless (looking-at-p "^ok$")
                 (tramp-error
-                 v 'file-error "\
-tramp-sh-handle-file-name-all-completions: internal error accessing `%s': `%s'"
+                 v 'file-error
+                 (concat "tramp-sh-handle-file-name-all-completions: "
+                         "internal error accessing `%s': `%s'")
                  (tramp-shell-quote-argument localname) (buffer-string))))
 
             (while (zerop (forward-line -1))
@@ -1944,9 +1945,7 @@ tramp-sh-handle-file-name-all-completions: internal error 
accessing `%s': `%s'"
        (t2 (tramp-tramp-file-p newname)))
     (with-parsed-tramp-file-name (if t1 dirname newname) nil
       (unless (file-exists-p dirname)
-       (tramp-error
-        v tramp-file-missing
-        "Copying directory" "No such file or directory" dirname))
+       (tramp-compat-file-missing v dirname))
       (if (and (not copy-contents)
               (tramp-get-method-parameter v 'tramp-copy-recursive)
               ;; When DIRNAME and NEWNAME are remote, they must have
@@ -2032,12 +2031,12 @@ file names."
          (length (tramp-compat-file-attribute-size
                   (file-attributes (file-truename filename))))
          (attributes (and preserve-extended-attributes
-                          (apply #'file-extended-attributes (list filename)))))
+                          (apply #'file-extended-attributes (list filename))))
+         (msg-operation (if (eq op 'copy) "Copying" "Renaming")))
 
       (with-parsed-tramp-file-name (if t1 filename newname) nil
        (unless (file-exists-p filename)
-         (tramp-error
-          v tramp-file-missing "No such file or directory" filename))
+         (tramp-compat-file-missing v filename))
        (when (and (not ok-if-already-exists) (file-exists-p newname))
          (tramp-error v 'file-already-exists newname))
        (when (and (file-directory-p newname)
@@ -2045,9 +2044,7 @@ file names."
          (tramp-error v 'file-error "File is a directory %s" newname))
 
        (with-tramp-progress-reporter
-           v 0 (format "%s %s to %s"
-                       (if (eq op 'copy) "Copying" "Renaming")
-                       filename newname)
+           v 0 (format "%s %s to %s" msg-operation filename newname)
 
          (cond
           ;; Both are Tramp files.
@@ -2536,7 +2533,7 @@ The method used must be an out-of-band method."
   (setq dir (expand-file-name dir))
   (with-parsed-tramp-file-name dir nil
     (when (and (null parents) (file-exists-p dir))
-      (tramp-error v 'file-already-exists "Directory already exists %s" dir))
+      (tramp-error v 'file-already-exists dir))
     ;; When PARENTS is non-nil, DIR could be a chain of non-existent
     ;; directories a/b/c/...  Instead of checking, we simply flush the
     ;; whole cache.
@@ -2821,6 +2818,9 @@ the result will be a local, non-Tramp, file name."
       ;; expands to "/".  Remove this.
       (while (string-match "//" localname)
        (setq localname (replace-match "/" t t localname)))
+      ;; Do not keep "/..".
+      (when (string-match-p "^/\\.\\.?$" localname)
+       (setq localname "/"))
       ;; No tilde characters in file name, do normal
       ;; `expand-file-name' (this does "/./" and "/../").
       ;; `default-directory' is bound, because on Windows there would
@@ -2930,16 +2930,11 @@ alternative implementation will be used."
                             elt (default-toplevel-value 'process-environment))
                            (if (string-match-p "=" elt)
                                (setq env (append env `(,elt)))
-                             (if (tramp-get-env-with-u-option v)
-                                 (setq env (append `("-u" ,elt) env))
-                               (setq uenv (cons elt uenv)))))))
+                             (setq uenv (cons elt uenv))))))
+                (env (setenv-internal
+                      env "INSIDE_EMACS" (tramp-inside-emacs) 'keep))
                 (command
                  (when (stringp program)
-                   (setenv-internal
-                    env "INSIDE_EMACS"
-                    (concat (or (getenv "INSIDE_EMACS") emacs-version)
-                            ",tramp:" tramp-version)
-                    'keep)
                    (format "cd %s && %s exec %s %s env %s %s"
                            (tramp-shell-quote-argument localname)
                            (if uenv
@@ -3150,14 +3145,8 @@ alternative implementation will be used."
         (or (member elt (default-toplevel-value 'process-environment))
             (if (string-match-p "=" elt)
                 (setq env (append env `(,elt)))
-              (if (tramp-get-env-with-u-option v)
-                  (setq env (append `("-u" ,elt) env))
-                (setq uenv (cons elt uenv))))))
-      (setenv-internal
-       env "INSIDE_EMACS"
-       (concat (or (getenv "INSIDE_EMACS") emacs-version)
-              ",tramp:" tramp-version)
-       'keep)
+              (setq uenv (cons elt uenv)))))
+      (setenv-internal env "INSIDE_EMACS" (tramp-inside-emacs) 'keep)
       (when env
        (setq command
              (format
@@ -3278,9 +3267,7 @@ alternative implementation will be used."
   "Like `file-local-copy' for Tramp files."
   (with-parsed-tramp-file-name filename nil
     (unless (file-exists-p (file-truename filename))
-      (tramp-error
-       v tramp-file-missing
-       "Cannot make local copy of non-existing file `%s'" filename))
+      (tramp-compat-file-missing v filename))
 
     (let* ((size (tramp-compat-file-attribute-size
                  (file-attributes (file-truename filename))))
@@ -3969,7 +3956,7 @@ Fall back to normal file name handler if no Tramp handler 
exists."
                       "[[:blank:]]+\\([^[:blank:]]+\\)"
                       "\\([[:blank:]]+\\([^\n\r]+\\)\\)?")
               line)
-       (tramp-error proc 'file-notify-error "%s" line))
+       (tramp-error proc 'file-notify-error line))
 
       (let ((object
             (list
@@ -4312,10 +4299,9 @@ file exists and nonzero exit status otherwise."
     (tramp-send-command
      vec (format
          (concat
-          "exec env TERM='%s' INSIDE_EMACS='%s,tramp:%s' "
+          "exec env TERM='%s' INSIDE_EMACS='%s' "
           "ENV=%s %s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s -i")
-          tramp-terminal-type
-          (or (getenv "INSIDE_EMACS") emacs-version) tramp-version
+          tramp-terminal-type (tramp-inside-emacs)
           (or (getenv-internal "ENV" tramp-remote-process-environment) "")
          (if (stringp tramp-histfile-override)
              (format "HISTFILE=%s"
@@ -5950,16 +5936,6 @@ This command is returned only if 
`delete-by-moving-to-trash' is non-nil."
            (tramp-file-local-name tmpfile) (tramp-file-local-name tmpfile)))
        (delete-file tmpfile)))))
 
-(defun tramp-get-env-with-u-option (vec)
-  "Check, whether the remote `env' command supports the -u option."
-  (with-tramp-connection-property vec "env-u-option"
-    (tramp-message vec 5 "Checking, whether `env -u' works")
-    ;; Option "-u" is a GNU extension.
-    (tramp-send-command-and-check
-     vec (format "env FOO=foo env -u FOO 2>%s | grep -qv FOO"
-                 (tramp-get-remote-null-device vec))
-     t)))
-
 ;; Some predefined connection properties.
 (defun tramp-get-inline-compress (vec prop size)
   "Return the compress command related to PROP.
diff --git a/tramp-smb.el b/tramp-smb.el
index c5a74a5..6935955 100644
--- a/tramp-smb.el
+++ b/tramp-smb.el
@@ -342,8 +342,8 @@ This can be used to disable echo etc."
 ;;;###tramp-autoload
 (defun tramp-smb-file-name-handler (operation &rest args)
   "Invoke the SMB related OPERATION and ARGS.
-First arg specifies the OPERATION, second arg is a list of arguments to
-pass to the OPERATION."
+First arg specifies the OPERATION, second arg is a list of
+arguments to pass to the OPERATION."
   (if-let ((fn (assoc operation tramp-smb-file-name-handler-alist)))
       (save-match-data (apply (cdr fn) args))
     (tramp-run-real-handler operation args)))
@@ -430,9 +430,7 @@ pass to the OPERATION."
        (with-tramp-progress-reporter
            v 0 (format "Copying %s to %s" dirname newname)
          (unless (file-exists-p dirname)
-           (tramp-error
-            v tramp-file-missing
-            "Copying directory" "No such file or directory" dirname))
+           (tramp-compat-file-missing v dirname))
          (when (and (file-directory-p newname)
                     (not (directory-name-p newname)))
            (tramp-error v 'file-already-exists newname))
@@ -588,11 +586,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
        (copy-directory filename newname keep-date 'parents 'copy-contents)
 
       (unless (file-exists-p filename)
-       (tramp-error
+       (tramp-compat-file-missing
         (tramp-dissect-file-name
          (if (tramp-tramp-file-p filename) filename newname))
-        tramp-file-missing
-        "Copying file" "No such file or directory" filename))
+        filename))
 
       (if-let ((tmpfile (file-local-copy filename)))
          ;; Remote filename.
@@ -693,9 +690,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
   (directory &optional full match nosort count)
   "Like `directory-files' for Tramp files."
   (unless (file-exists-p directory)
-    (tramp-error
-     (tramp-dissect-file-name directory) tramp-file-missing
-     "No such file or directory" directory))
+    (tramp-compat-file-missing (tramp-dissect-file-name directory) directory))
   (let ((result (mapcar #'directory-file-name
                        (file-name-all-completions "" directory))))
     ;; Discriminate with regexp.
@@ -748,6 +743,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
       ;; Make the file name absolute.
       (unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
        (setq localname (concat "/" localname)))
+     ;; Do not keep "/..".
+      (when (string-match-p "^/\\.\\.?$" localname)
+       (setq localname "/"))
       ;; No tilde characters in file name, do normal
       ;; `expand-file-name' (this does "/./" and "/../").
       (tramp-make-tramp-file-name
@@ -962,9 +960,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
   "Like `file-local-copy' for Tramp files."
   (with-parsed-tramp-file-name (file-truename filename) nil
     (unless (file-exists-p (file-truename filename))
-      (tramp-error
-       v tramp-file-missing
-       "Cannot make local copy of non-existing file `%s'" filename))
+      (tramp-compat-file-missing v filename))
     (let ((tmpfile (tramp-compat-make-temp-file filename)))
       (with-tramp-progress-reporter
          v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
@@ -1153,12 +1149,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
                 ;; of `default-directory'.
                 (let ((start (point)))
                   (insert
-                   (format
-                    "%s"
-                    (file-relative-name
-                     (expand-file-name
-                      (nth 0 x) (file-name-directory filename))
-                     (when full-directory-p (file-name-directory filename)))))
+                   (file-relative-name
+                    (expand-file-name
+                     (nth 0 x) (file-name-directory filename))
+                    (when full-directory-p (file-name-directory filename))))
                   (put-text-property start (point) 'dired-filename t))
 
                 ;; Insert symlink.
@@ -1177,7 +1171,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
     (setq dir (expand-file-name dir default-directory)))
   (with-parsed-tramp-file-name dir nil
     (when (and (null parents) (file-exists-p dir))
-      (tramp-error v 'file-already-exists "Directory already exists %s" dir))
+      (tramp-error v 'file-already-exists dir))
     (let* ((ldir (file-name-directory dir)))
       ;; Make missing directory parts.
       (when (and parents
@@ -1386,9 +1380,7 @@ component is used as the target of the symlink."
   (with-parsed-tramp-file-name
       (if (tramp-tramp-file-p filename) filename newname) nil
     (unless (file-exists-p filename)
-      (tramp-error
-       v tramp-file-missing
-       "Renaming file" "No such file or directory" filename))
+      (tramp-compat-file-missing v filename))
     (when (and (not ok-if-already-exists) (file-exists-p newname))
       (tramp-error v 'file-already-exists newname))
     (when (and (file-directory-p newname)
@@ -1936,7 +1928,7 @@ If ARGUMENT is non-nil, use it as argument for
 
     ;; Check whether we still have the same smbclient version.
     ;; Otherwise, we must delete the connection cache, because
-    ;; capabilities migh have changed.
+    ;; capabilities might have changed.
     (unless (or argument (processp p))
       (let ((default-directory (tramp-compat-temporary-file-directory))
            (command (concat tramp-smb-program " -V")))
@@ -2010,10 +2002,8 @@ If ARGUMENT is non-nil, use it as argument for
          (when port   (setq args (append args (list "-p" port))))
          (when tramp-smb-conf
            (setq args (append args (list "-s" tramp-smb-conf))))
-         (while options
-           (setq args
-                 (append args `("--option" ,(format "%s" (car options))))
-                 options (cdr options)))
+         (dolist (option options)
+           (setq args (append args (list "--option" option))))
          (when argument
            (setq args (append args (list argument))))
 
diff --git a/tramp-sudoedit.el b/tramp-sudoedit.el
index 5bb1546..e181365 100644
--- a/tramp-sudoedit.el
+++ b/tramp-sudoedit.el
@@ -153,8 +153,8 @@ See `tramp-actions-before-shell' for more info.")
 ;;;###tramp-autoload
 (defun tramp-sudoedit-file-name-handler (operation &rest args)
   "Invoke the SUDOEDIT handler for OPERATION and ARGS.
-First arg specifies the OPERATION, second arg is a list of arguments to
-pass to the OPERATION."
+First arg specifies the OPERATION, second arg is a list of
+arguments to pass to the OPERATION."
   (if-let ((fn (assoc operation tramp-sudoedit-file-name-handler-alist)))
       (save-match-data (apply (cdr fn) args))
     (tramp-run-real-handler operation args)))
@@ -243,9 +243,7 @@ absolute file names."
 
       (with-parsed-tramp-file-name (if t1 filename newname) nil
        (unless (file-exists-p filename)
-         (tramp-error
-          v tramp-file-missing
-          "%s file" msg-operation "No such file or directory" filename))
+         (tramp-compat-file-missing v filename))
        (when (and (not ok-if-already-exists) (file-exists-p newname))
          (tramp-error v 'file-already-exists newname))
        (when (and (file-directory-p newname)
@@ -366,6 +364,9 @@ the result will be a local, non-Tramp, file name."
        (when (string-equal uname "~")
          (setq uname (concat uname user)))
        (setq localname (concat uname fname))))
+     ;; Do not keep "/..".
+      (when (string-match-p "^/\\.\\.?$" localname)
+       (setq localname "/"))
     ;; Do normal `expand-file-name' (this does "~user/", "/./" and "/../").
     (tramp-make-tramp-file-name v (expand-file-name localname))))
 
diff --git a/tramp.el b/tramp.el
index 66efe96..1ba5bcc 100644
--- a/tramp.el
+++ b/tramp.el
@@ -1750,7 +1750,7 @@ The outline level is equal to the verbosity of the Tramp 
message."
    (tramp-compat-string-replace "/" " " (tramp-debug-buffer-name vec))
    (tramp-compat-temporary-file-directory)))
 
-(defsubst tramp-debug-message (vec fmt-string &rest arguments)
+(defun tramp-debug-message (vec fmt-string &rest arguments)
   "Append message to debug buffer of VEC.
 Message is formatted with FMT-STRING as control string and the remaining
 ARGUMENTS to actually emit the message (if applicable)."
@@ -2005,7 +2005,7 @@ the resulting error message."
   (unless (eq error-symbol 'void-variable)
     (tramp-error
      (car tramp-current-connection) error-symbol
-     "%s" (mapconcat (lambda (x) (format "%s" x)) data " "))))
+     (mapconcat (lambda (x) (format "%s" x)) data " "))))
 
 (put #'tramp-signal-hook-function 'tramp-suppress-trace t)
 
@@ -3092,9 +3092,9 @@ User is always nil."
 (defun tramp-handle-access-file (filename string)
   "Like `access-file' for Tramp files."
   (unless (file-readable-p (file-truename filename))
-    (tramp-error
-     (tramp-dissect-file-name filename) tramp-file-missing
-     "%s: No such file or directory %s" string filename)))
+    (tramp-compat-file-missing
+     (tramp-dissect-file-name filename)
+     (format "%s: %s" string filename))))
 
 (defun tramp-handle-add-name-to-file
   (filename newname &optional ok-if-already-exists)
@@ -3128,9 +3128,7 @@ User is always nil."
   ;; `copy-directory' creates NEWNAME before running this check.  So
   ;; we do it ourselves.
   (unless (file-exists-p directory)
-    (tramp-error
-     (tramp-dissect-file-name directory) tramp-file-missing
-     "No such file or directory" directory))
+    (tramp-compat-file-missing (tramp-dissect-file-name directory) directory))
   ;; We must do it file-wise.
   (tramp-run-real-handler
    'copy-directory
@@ -3151,9 +3149,7 @@ User is always nil."
 (defun tramp-handle-directory-files (directory &optional full match nosort 
count)
   "Like `directory-files' for Tramp files."
   (unless (file-exists-p directory)
-    (tramp-error
-     (tramp-dissect-file-name directory) tramp-file-missing
-     "No such file or directory" directory))
+    (tramp-compat-file-missing (tramp-dissect-file-name directory) directory))
   (when (file-directory-p directory)
     (setq directory (file-name-as-directory (expand-file-name directory)))
     (let ((temp (nreverse (file-name-all-completions "" directory)))
@@ -3201,6 +3197,9 @@ User is always nil."
     (with-parsed-tramp-file-name name nil
       (unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
        (setq localname (concat "/" localname)))
+      ;; Do not keep "/..".
+      (when (string-match-p "^/\\.\\.?$" localname)
+       (setq localname "/"))
       ;; Do normal `expand-file-name' (this does "/./" and "/../").
       ;; `default-directory' is bound, because on Windows there would
       ;; be problems with UNC shares or Cygwin mounts.
@@ -3250,9 +3249,7 @@ User is always nil."
   "Like `file-local-copy' for Tramp files."
   (with-parsed-tramp-file-name filename nil
     (unless (file-exists-p filename)
-      (tramp-error
-       v tramp-file-missing
-       "Cannot make local copy of non-existing file `%s'" filename))
+      (tramp-compat-file-missing v filename))
     (let ((tmpfile (tramp-compat-make-temp-file filename)))
       (copy-file filename tmpfile 'ok-if-already-exists 'keep-time)
       tmpfile)))
@@ -3462,8 +3459,10 @@ User is always nil."
                      (if (stringp symlink-target)
                          (if (file-remote-p symlink-target)
                              (tramp-compat-file-name-quote symlink-target 'top)
-                           (expand-file-name
-                            symlink-target (file-name-directory v2-localname)))
+                           (tramp-drop-volume-letter
+                            (expand-file-name
+                             symlink-target
+                             (file-name-directory v2-localname))))
                        v2-localname)
                      'nohop)))
             (when (>= numchase numchase-limit)
@@ -3545,9 +3544,7 @@ User is always nil."
     (with-parsed-tramp-file-name filename nil
       (unwind-protect
          (if (not (file-exists-p filename))
-             (tramp-error
-              v tramp-file-missing
-              "File `%s' not found on remote host" filename)
+             (tramp-compat-file-missing v filename)
 
            (with-tramp-progress-reporter
                v 3 (format-message "Inserting `%s'" filename)
@@ -3670,8 +3667,7 @@ User is always nil."
         v 'file-error
         "File `%s' does not include a `.el' or `.elc' suffix" file)))
     (unless (or noerror (file-exists-p file))
-      (tramp-error
-       v tramp-file-missing "Cannot load nonexistent file `%s'" file))
+      (tramp-compat-file-missing v file))
     (if (not (file-exists-p file))
        nil
       (let ((signal-hook-function (unless noerror signal-hook-function))
@@ -3852,10 +3848,7 @@ It does not support `:stderr'."
                             elt (default-toplevel-value 
'process-environment))))
                        (setq env (cons elt env)))))
               (env (setenv-internal
-                    env "INSIDE_EMACS"
-                    (concat (or (getenv "INSIDE_EMACS") emacs-version)
-                            ",tramp:" tramp-version)
-                    'keep))
+                    env "INSIDE_EMACS" (tramp-inside-emacs) 'keep))
               (env (mapcar #'tramp-shell-quote-argument (delq nil env)))
               ;; Quote command.
               (command (mapconcat #'tramp-shell-quote-argument command " "))
diff --git a/trampver.el b/trampver.el
index a7d4a01..c151892 100644
--- a/trampver.el
+++ b/trampver.el
@@ -7,7 +7,7 @@
 ;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
 ;; Package: tramp
-;; Version: 2.5.0.1
+;; Version: 2.5.0.2
 ;; Package-Requires: ((emacs "25.1"))
 ;; Package-Type: multi
 ;; URL: https://www.gnu.org/software/tramp/
@@ -40,7 +40,7 @@
 ;; ./configure" to change them.
 
 ;;;###tramp-autoload
-(defconst tramp-version "2.5.0.1"
+(defconst tramp-version "2.5.0.2"
   "This version of Tramp.")
 
 ;;;###tramp-autoload
@@ -76,10 +76,15 @@
 ;; Check for Emacs version.
 (let ((x   (if (not (string-lessp emacs-version "25.1"))
       "ok"
-    (format "Tramp 2.5.0.1 is not fit for %s"
+    (format "Tramp 2.5.0.2 is not fit for %s"
             (replace-regexp-in-string "\n" "" (emacs-version))))))
   (unless (string-equal "ok" x) (error "%s" x)))
 
+(defun tramp-inside-emacs ()
+  "Version string provided by INSIDE_EMACS enmvironment variable."
+  (concat (or (getenv "INSIDE_EMACS") emacs-version)
+         ",tramp:" tramp-version))
+
 ;; Tramp versions integrated into Emacs.  If a user option declares a
 ;; `:package-version' which doesn't belong to an integrated Tramp
 ;; version, it must be added here as well (see `tramp-syntax', for



reply via email to

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