`((,(tramp-file-name-regexp) . tramp-vc-file-name-handler))))
;; Here we collect only file names, which need an operation.
- (ignore-errors (tramp-run-real-handler 'vc-registered (list file)))
+ (tramp-with-demoted-errors
+ v "Error in 1st pass of `vc-registered': %s"
+ (tramp-run-real-handler 'vc-registered (list file)))
(tramp-message v 10 "\n%s" tramp-vc-registered-file-names)
;; Send just one command, in order to fill the cache.
v vc-hg-program (tramp-get-remote-path v)))))
(setq vc-handled-backends (remq 'Hg vc-handled-backends)))
;; Run.
- (ignore-errors
+ (tramp-with-demoted-errors
+ v "Error in 2nd pass of `vc-registered': %s"
(tramp-run-real-handler 'vc-registered (list file))))))))
;;;###tramp-autoload
(when (tramp-file-name-equal-p vec (car tramp-current-connection))
(setcdr tramp-current-connection (current-time)))))))
+(defmacro tramp-with-demoted-errors (vec-or-proc format &rest body)
+ "Execute BODY while redirecting the error message to `tramp-message'.
+BODY is executed like wrapped by `with-demoted-errors'. FORMAT
+is a format-string containing a %-sequence meaning to substitute
+the resulting error message."
+ (declare (debug (symbolp body))
+ (indent 2))
+ (let ((err (make-symbol "err")))
+ `(condition-case-unless-debug ,err
+ (progn ,@body)
+ (error (tramp-message ,vec-or-proc 3 ,format ,err) nil))))
+
(defmacro with-parsed-tramp-file-name (filename var &rest body)
"Parse a Tramp filename and make components available in the body.