]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve Tramp error handling
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 14 Nov 2021 13:41:58 +0000 (14:41 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 14 Nov 2021 13:41:58 +0000 (14:41 +0100)
* doc/misc/tramp.texi (Frequently Asked Questions): Add another
`remote-file-error'.

* lisp/net/tramp.el (tramp-find-foreign-file-name-handler):
Improve error handling.

doc/misc/tramp.texi
lisp/net/tramp.el

index 819670a5088bd049b4cac3458512516d5fa1f4b4..0825e85e4d3b5d095a230c341207fbbada392410 100644 (file)
@@ -5222,6 +5222,28 @@ time being you can suppress this error by the following code in your
 @end lisp
 
 
+@item
+I get an error @samp{Remote file error: Not a valid Tramp file name
+function `tramp-FOO-file-name-p'}
+
+@value{tramp} has changed the signature of an internal function.
+External packages implementing an own @value{tramp} backend must
+follow this change.  Please report this problem to the author of that
+package.
+
+For the running session, @value{tramp} disables the external package,
+and you can continue to work.  If you don't want to see this error
+while activating @value{tramp}, you can suppress it by the same code
+as above in your @file{~/.emacs}:
+
+@lisp
+@group
+(setq debug-ignored-errors
+      (cons 'remote-file-error debug-ignored-errors))
+@end group
+@end lisp
+
+
 @item
 How to disable other packages from calling @value{tramp}?
 
index 876bbb2c5452b2559fabd4b4930e4cbe7ba79ad7..5fcf7f9b6509c6fac5a960027b04f01837613513 100644 (file)
@@ -2552,13 +2552,20 @@ Must be handled by the callers."
   (when (tramp-tramp-file-p filename)
     (let ((handler tramp-foreign-file-name-handler-alist)
           (vec (tramp-dissect-file-name filename))
-         elt res)
+         elt func res)
       (while handler
        (setq elt (car handler)
              handler (cdr handler))
         ;; Previously, this function was called with FILENAME, but now
         ;; it's called with the VEC.
-        (when (with-demoted-errors "Error: %S" (funcall (car elt) vec))
+        (when (condition-case nil
+                 (funcall (setq func (car elt)) vec)
+               (error
+                (setcar elt #'ignore)
+                (unless (member 'remote-file-error debug-ignored-errors)
+                  (tramp-error
+                   vec 'remote-file-error
+                   "Not a valid Tramp file name function `%s'" func))))
          (setq handler nil
                res (cdr elt))))
       res)))