From: Michael Albinus Date: Wed, 15 Jun 2022 08:57:56 +0000 (+0200) Subject: Improve Tramp debugging X-Git-Tag: emacs-29.0.90~1447^2~1743 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8fca44da816af3d8f3dde2cea871c7563961ef69;p=emacs.git Improve Tramp debugging * lisp/net/tramp-cache.el (tramp-list-connections): Fix docstring. * lisp/net/tramp.el (tramp-backtrace): New optional arg FORCE. --- diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index dc1e3d28b58..a0cbfed64ea 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -427,7 +427,7 @@ used to cache connection properties of the local machine." ;;;###tramp-autoload (defun tramp-list-connections () - "Return all known `tramp-file-name' structs according to `tramp-cache'." + "Return all active `tramp-file-name' structs according to `tramp-cache-data'." (let ((tramp-verbose 0)) (delq nil (mapcar (lambda (key) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index cee8897b4f6..e4b14cfbc24 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2148,15 +2148,17 @@ applicable)." (put #'tramp-message 'tramp-suppress-trace t) -(defsubst tramp-backtrace (&optional vec-or-proc) +(defsubst tramp-backtrace (&optional vec-or-proc force) "Dump a backtrace into the debug buffer. -If VEC-OR-PROC is nil, the buffer *debug tramp* is used. This -function is meant for debugging purposes." - (when (>= tramp-verbose 10) - (if vec-or-proc - (tramp-message - vec-or-proc 10 "\n%s" (with-output-to-string (backtrace))) - (with-output-to-temp-buffer "*debug tramp*" (backtrace))))) +If VEC-OR-PROC is nil, the buffer *debug tramp* is used. FORCE +forces the backtrace even if `tramp-verbose' is less than 10. +This function is meant for debugging purposes." + (let ((tramp-verbose (if force 10 tramp-verbose))) + (when (>= tramp-verbose 10) + (if vec-or-proc + (tramp-message + vec-or-proc 10 "\n%s" (with-output-to-string (backtrace))) + (with-output-to-temp-buffer "*debug tramp*" (backtrace)))))) (put #'tramp-backtrace 'tramp-suppress-trace t)