branch: externals/tramp
commit 306ca5a231de66682f91676485ac6353c735d4fb
Author: Michael Albinus <[email protected]>
Commit: Michael Albinus <[email protected]>

    Tramp ELPA version 2.7.2 released
---
 README              |   6 +--
 test/tramp-tests.el | 107 ++++++++++++++++++++++++++++++----------------------
 texi/tramp.texi     |  17 +++++----
 texi/trampver.texi  |   2 +-
 tramp-archive.el    |   7 ++++
 tramp-gvfs.el       |  18 +++++++++
 tramp-sh.el         |   5 +--
 tramp.el            |  10 ++++-
 trampver.el         |   6 +--
 9 files changed, 114 insertions(+), 64 deletions(-)

diff --git a/README b/README
index 939c9c06f6..a7efa93107 100644
--- a/README
+++ b/README
@@ -32,11 +32,11 @@ Emacs 28 or older
 
    • Remove all byte-compiled Tramp files
 
-          $ rm -f ~/.emacs.d/elpa/tramp-2.7.1.5/tramp*.elc
+          $ rm -f ~/.emacs.d/elpa/tramp-2.7.2/tramp*.elc
 
    • Start Emacs with Tramp's source files
 
-          $ emacs -L ~/.emacs.d/elpa/tramp-2.7.1.5 -l tramp
+          $ emacs -L ~/.emacs.d/elpa/tramp-2.7.2 -l tramp
 
      This should not give you the error.
 
@@ -50,7 +50,7 @@ Mitigation of a bug in Emacs 29.1
 ---------------------------------
 
 Due to a bug in Emacs 29.1, you must apply the following change prior
-installation or upgrading Tramp 2.7.1.5 from GNU ELPA:
+installation or upgrading Tramp 2.7.2 from GNU ELPA:
 
      (when (string-equal emacs-version "29.1")
        (with-current-buffer
diff --git a/test/tramp-tests.el b/test/tramp-tests.el
index d864fd2e96..caed6d54ff 100644
--- a/test/tramp-tests.el
+++ b/test/tramp-tests.el
@@ -181,6 +181,7 @@ A resource file is in the resource directory as per
 
 (setq auth-source-cache-expiry nil
       auth-source-save-behavior nil
+      ert-batch-backtrace-right-margin nil
       password-cache-expiry nil
       remote-file-name-inhibit-cache nil
       tramp-allow-unsafe-temporary-files t
@@ -6912,34 +6913,40 @@ INPUT, if non-nil, is a string sent to the process."
             (should-not (with-no-warnings (file-locked-p tmp-name1)))
 
             ;; `kill-buffer' removes the lock.
-           (with-no-warnings (lock-file tmp-name1))
-           (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
-            (with-temp-buffer
-              (set-visited-file-name tmp-name1)
-              (insert "foo")
-             (should (buffer-modified-p))
-             (cl-letf (((symbol-function #'read-from-minibuffer)
-                         (lambda (&rest _args) "yes")))
-                (kill-buffer)))
-           (should-not (with-no-warnings (file-locked-p tmp-name1)))
+           ;; `kill-buffer--possibly-save' exists since Emacs 29.1.
+           (when (fboundp 'kill-buffer--possibly-save)
+             (with-no-warnings (lock-file tmp-name1))
+             (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+              (with-temp-buffer
+               (set-visited-file-name tmp-name1)
+               (insert "foo")
+               (should (buffer-modified-p))
+               ;; Modifying `read-from-minibuffer' doesn't work on MS Windows.
+               (cl-letf (((symbol-function #'kill-buffer--possibly-save)
+                          #'tramp-compat-always))
+                  (kill-buffer)))
+             (should-not (with-no-warnings (file-locked-p tmp-name1))))
 
             ;; `kill-buffer' should not remove the lock when the
             ;; connection is broken.  See Bug#61663.
-           (with-no-warnings (lock-file tmp-name1))
-           (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
-            (with-temp-buffer
-              (set-visited-file-name tmp-name1)
-              (insert "foo")
-             (should (buffer-modified-p))
-             (tramp-cleanup-connection
-              tramp-test-vec 'keep-debug 'keep-password)
-             (cl-letf (((symbol-function #'read-from-minibuffer)
-                         (lambda (&rest _args) "yes")))
-                (kill-buffer)))
-           ;; A new connection changes process id, and also the
-           ;; lock file contents.  But it still exists.
-           (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
-           (should (stringp (with-no-warnings (file-locked-p tmp-name1))))
+           ;; `kill-buffer--possibly-save' exists since Emacs 29.1.
+           (when (fboundp 'kill-buffer--possibly-save)
+             (with-no-warnings (lock-file tmp-name1))
+             (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+              (with-temp-buffer
+               (set-visited-file-name tmp-name1)
+               (insert "foo")
+               (should (buffer-modified-p))
+               (tramp-cleanup-connection
+                tramp-test-vec 'keep-debug 'keep-password)
+               ;; Modifying `read-from-minibuffer' doesn't work on MS Windows.
+               (cl-letf (((symbol-function #'kill-buffer--possibly-save)
+                          #'tramp-compat-always))
+                  (kill-buffer)))
+             ;; A new connection changes process id, and also the
+             ;; lock file contents.  But it still exists.
+             (tramp-cleanup-connection tramp-test-vec 'keep-debug 
'keep-password)
+             (should (stringp (with-no-warnings (file-locked-p tmp-name1)))))
 
            ;; When `remote-file-name-inhibit-locks' is set, nothing happens.
            (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
@@ -6962,35 +6969,43 @@ INPUT, if non-nil, is a string sent to the process."
 
            ;; Steal the file lock.
            (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
-           (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?s)))
+           ;; Modifying `read-char' doesn't work on MS Windows.
+           (cl-letf (((symbol-function #'ask-user-about-lock)
+                      #'tramp-compat-always))
              (with-no-warnings (lock-file tmp-name1)))
            (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
 
            ;; Ignore the file lock.
            (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
-           (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?p)))
+           ;; Modifying `read-char' doesn't work on MS Windows.
+           (cl-letf (((symbol-function #'ask-user-about-lock) #'ignore))
              (with-no-warnings (lock-file tmp-name1)))
            (should (stringp (with-no-warnings (file-locked-p tmp-name1))))
 
-           ;; Quit the file lock machinery.
-           (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
-           (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?q)))
-             (with-no-warnings
+           ;; Quit the file lock machinery.  There are problems with
+           ;; "sftp" and "podman", so we test on Emacs 29.1 only.
+           (when (tramp--test-emacs29-p )
+             (tramp-cleanup-connection tramp-test-vec 'keep-debug 
'keep-password)
+             ;; Modifying `read-char' doesn't work on MS Windows.
+             (cl-letf (((symbol-function #'ask-user-about-lock)
+                        (lambda (&rest args)
+                          (signal 'file-locked args))))
+               (with-no-warnings
+                 (should-error
+                  (lock-file tmp-name1)
+                  :type 'file-locked))
+               ;; The same for `write-region'.
                (should-error
-                (lock-file tmp-name1)
-                :type 'file-locked))
-             ;; The same for `write-region'.
-             (should-error
-              (write-region "foo" nil tmp-name1)
-              :type 'file-locked)
-             (should-error
-              (write-region "foo" nil tmp-name1 nil nil tmp-name1)
-               :type 'file-locked)
-             ;; The same for `set-visited-file-name'.
-              (with-temp-buffer
-               (should-error
-                 (set-visited-file-name tmp-name1)
-                :type 'file-locked)))
+                (write-region "foo" nil tmp-name1)
+                :type 'file-locked)
+               (should-error
+                (write-region "foo" nil tmp-name1 nil nil tmp-name1)
+                :type 'file-locked)
+               ;; The same for `set-visited-file-name'.
+               (with-temp-buffer
+                 (should-error
+                   (set-visited-file-name tmp-name1)
+                  :type 'file-locked))))
            (should (stringp (with-no-warnings (file-locked-p tmp-name1)))))
 
        ;; Cleanup.
@@ -7692,7 +7707,7 @@ This requires restrictions of file name syntax."
        ;; to U+1FFFF).
        "🌈🍒👋")
 
-      (when (tramp--test-expensive-test-p)
+      (when (and (tramp--test-expensive-test-p) (not 
(tramp--test-windows-nt-p)))
        (delete-dups
         (mapcar
          ;; Use all available language specific snippets.
diff --git a/texi/tramp.texi b/texi/tramp.texi
index edc258cb5a..747bc8f79d 100644
--- a/texi/tramp.texi
+++ b/texi/tramp.texi
@@ -1366,9 +1366,12 @@ Desktop, @uref{https://en.wikipedia.org/wiki/GVFS}.  
Remote files on
 @acronym{GVFS} are mounted locally through @acronym{FUSE} and
 @value{tramp} uses this locally mounted directory internally.
 
-Emacs uses the D-Bus mechanism to communicate with @acronym{GVFS}@.
-Emacs must have the message bus system, D-Bus integration active,
-@pxref{Top, , D-Bus, dbus}.
+Emacs uses the D-Bus mechanism to communicate with @acronym{GVFS}@.  It
+must have been compiled with D-Bus support, @pxref{Top, , D-Bus, dbus}.
+
+@vindex tramp-gvfs-enabled
+The @code{tramp-gvfs-enabled} variable, being non-@code{nil}, signals
+that @value{tramp} can use @acronym{GVFS}-based methods.
 
 @table @asis
 @cindex method @option{afp}
@@ -1531,10 +1534,10 @@ for accessing the system storage, you should use it.
 
 @vindex tramp-sshfs-program
 On local hosts which have installed the @command{sshfs} client for
-mounting a file system based on @command{sftp}, this method can be
-used, see
-@uref{https://github.com/libfuse/sshfs/blob/master/README.rst/}.  If
-the @command{sshfs} program isn't found in your @env{PATH} environment
+mounting a file system based on the @command{sftp} subsystem of
+@command{ssh}, this method can be used, see
+@uref{https://github.com/libfuse/sshfs/blob/master/README.md}.  If the
+@command{sshfs} program isn't found in your @env{PATH} environment
 variable, you can tell @value{tramp} its absolute path via the user
 option @code{tramp-sshfs-program}.
 
diff --git a/texi/trampver.texi b/texi/trampver.texi
index d47b115277..ab46de3f0d 100644
--- a/texi/trampver.texi
+++ b/texi/trampver.texi
@@ -7,7 +7,7 @@
 
 @c In the  Tramp GIT, the version number and the bug report address
 @c are auto-frobbed from configure.ac.
-@set trampver 2.7.1.5
+@set trampver 2.7.2
 @set trampurl https://www.gnu.org/software/tramp/
 @set tramp-bug-report-address tramp-devel@@gnu.org
 @set emacsver 27.1
diff --git a/tramp-archive.el b/tramp-archive.el
index 59c4223794..36ee9607bf 100644
--- a/tramp-archive.el
+++ b/tramp-archive.el
@@ -426,6 +426,7 @@ arguments to pass to the OPERATION."
 
 ;; File name conversions.
 
+;;;###tramp-autoload
 (defun tramp-archive-file-name-p (name)
   "Return t if NAME is a string with archive file name syntax."
   (and (stringp name)
@@ -581,6 +582,12 @@ offered."
   "Return NAME in GVFS syntax."
   (tramp-make-tramp-file-name (tramp-archive-dissect-file-name name)))
 
+;; This is used in GNU ELPA package tramp-locproc.el.
+(defun tramp-archive-local-file-name (filename)
+  "Return local mount name of FILENAME."
+  (let ((tramp-methods (cons `(,tramp-archive-method) tramp-methods)))
+    (tramp-gvfs-local-file-name (tramp-archive-gvfs-file-name filename))))
+
 
 ;; File name primitives.
 
diff --git a/tramp-gvfs.el b/tramp-gvfs.el
index 8a1f080155..38dc8e30a8 100644
--- a/tramp-gvfs.el
+++ b/tramp-gvfs.el
@@ -1774,6 +1774,24 @@ a downcased host name only."
        (string-match (rx bol (+ alnum) "://" (group (+ (not (any "/:"))))) url)
        (match-string 1 url)))
 
+;; This is used in GNU ELPA package tramp-locproc.el.
+(defun tramp-gvfs-local-file-name (filename)
+  "Return local mount name of FILENAME."
+  (setq filename (file-name-unquote (expand-file-name filename)))
+  (with-parsed-tramp-file-name filename nil
+    (with-tramp-file-property v localname "local-file-name"
+      ;; As long as we call `tramp-gvfs-maybe-open-connection' here,
+      ;; we cache the result.
+      (tramp-gvfs-maybe-open-connection v)
+      (let ((quoted (file-name-quoted-p localname))
+           (localname (file-name-unquote localname)))
+       (funcall
+        (if quoted #'file-name-quote #'identity)
+        (expand-file-name
+         (if (file-name-absolute-p localname)
+             (substring localname 1) localname)
+         (tramp-get-file-property v "/" "fuse-mountpoint")))))))
+
 
 ;; D-Bus GVFS functions.
 
diff --git a/tramp-sh.el b/tramp-sh.el
index c6563ac87d..87946de9ab 100644
--- a/tramp-sh.el
+++ b/tramp-sh.el
@@ -3276,8 +3276,7 @@ will be used."
               (setq ret (tramp-send-command-and-check
                         v (format
                            "cd %s && %s"
-                           (tramp-unquote-shell-quote-argument localname)
-                           command)
+                           (tramp-shell-quote-argument localname) command)
                         t t t))
            (unless (natnump ret) (setq ret 1))
            ;; We should add the output anyway.
@@ -5679,7 +5678,7 @@ Nonexistent directories are removed from spec."
        (dolist (cmd
                ;; Prefer GNU ls on *BSD and macOS.
                 (if (tramp-check-remote-uname vec tramp-bsd-unames)
-                   '( "gls" "ls" "gnuls") '("ls" "gnuls" "gls")))
+                   '("gls" "ls" "gnuls") '("ls" "gnuls" "gls")))
         (let ((dl (tramp-get-remote-path vec))
               result)
           (while (and dl (setq result (tramp-find-executable vec cmd dl t t)))
diff --git a/tramp.el b/tramp.el
index 0638d7660b..dd1cf27310 100644
--- a/tramp.el
+++ b/tramp.el
@@ -1883,8 +1883,14 @@ See `tramp-dissect-file-name' for details."
 ;;;###tramp-autoload
 (defsubst tramp-string-empty-or-nil-p (string)
   "Check whether STRING is empty or nil."
+  ;; (declare (tramp-suppress-trace t))
   (or (null string) (string= string "")))
 
+;; We cannot use the `declare' form for `tramp-suppress-trace' in
+;; autoloaded functions, because the tramp-loaddefs.el generation
+;; would fail.
+(function-put #'tramp-string-empty-or-nil-p 'tramp-suppress-trace t)
+
 (defun tramp-buffer-name (vec)
   "A name for the connection buffer VEC."
   (declare (tramp-suppress-trace t))
@@ -3675,7 +3681,9 @@ on the same host.  Otherwise, TARGET is quoted."
         (setf ,target (tramp-file-local-name (expand-file-name ,target))))
        ;; There could be a cyclic link.
        (tramp-flush-file-properties
-       v (expand-file-name ,target (tramp-file-local-name default-directory))))
+       v (tramp-drop-volume-letter
+          (expand-file-name
+           ,target (tramp-file-local-name default-directory)))))
 
      ;; If TARGET is still remote, quote it.
      (if (tramp-tramp-file-p ,target)
diff --git a/trampver.el b/trampver.el
index 98bd738000..cb52b1c5d5 100644
--- a/trampver.el
+++ b/trampver.el
@@ -7,7 +7,7 @@
 ;; Maintainer: Michael Albinus <[email protected]>
 ;; Keywords: comm, processes
 ;; Package: tramp
-;; Version: 2.7.1.5
+;; Version: 2.7.2
 ;; Package-Requires: ((emacs "27.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.7.1.5"
+(defconst tramp-version "2.7.2"
   "This version of Tramp.")
 
 ;;;###tramp-autoload
@@ -76,7 +76,7 @@
 ;; Check for Emacs version.
 (let ((x   (if (not (string-version-lessp emacs-version "27.1"))
       "ok"
-    (format "Tramp 2.7.1.5 is not fit for %s"
+    (format "Tramp 2.7.2 is not fit for %s"
             (replace-regexp-in-string "\n" "" (emacs-version))))))
   (unless (string-equal "ok" x) (error "%s" x)))
 

Reply via email to