emacs-diffs
[Top][All Lists]
Advanced

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

master 8aba549: Improve Tramp error handling


From: Michael Albinus
Subject: master 8aba549: Improve Tramp error handling
Date: Sun, 14 Nov 2021 08:42:06 -0500 (EST)

branch: master
commit 8aba549263e2660b4ac4f1026b23fbc5caef8168
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Improve Tramp error handling
    
    * 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 | 22 ++++++++++++++++++++++
 lisp/net/tramp.el   | 11 +++++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 819670a..0825e85 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -5223,6 +5223,28 @@ time being you can suppress this error by the following 
code in your
 
 
 @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}?
 
 There are packages that call @value{tramp} without the user ever
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 876bbb2..5fcf7f9 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -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)))



reply via email to

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