diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/net/tramp-cmds.el | 4 | ||||
-rw-r--r-- | lisp/net/tramp.el | 24 |
2 files changed, 22 insertions, 6 deletions
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 1572c2f3e3c..d30d22021a5 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -57,7 +57,9 @@ SYNTAX can be one of the symbols `default' (default), (all-completions "*tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list)))) (all-completions - "*debug tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list)))))) + "*debug tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list)))) + (all-completions + "*trace tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list)))))) (defun tramp-list-remote-buffers () "Return a list of all buffers with remote `default-directory'." diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 9fec1514221..62df2890cb1 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1665,6 +1665,8 @@ See `tramp-dissect-file-name' for details." (format "*tramp/%s %s@%s*" method user-domain host-port) (format "*tramp/%s %s*" method host-port)))) +(put #'tramp-buffer-name 'tramp-suppress-trace t) + (defun tramp-make-tramp-file-name (&rest args) "Construct a Tramp file name from ARGS. @@ -1889,13 +1891,22 @@ The outline level is equal to the verbosity of the Tramp message." (put #'tramp-get-debug-buffer 'tramp-suppress-trace t) (defun tramp-get-debug-file-name (vec) - "Get the debug buffer for VEC." + "Get the debug file name for VEC." (expand-file-name (tramp-compat-string-replace "/" " " (tramp-debug-buffer-name vec)) (tramp-compat-temporary-file-directory))) (put #'tramp-get-debug-file-name 'tramp-suppress-trace t) +(defun tramp-trace-buffer-name (vec) + "A name for the trace buffer for VEC." + (tramp-compat-string-replace "debug" "trace" (tramp-debug-buffer-name vec))) + +(put #'tramp-trace-buffer-name 'tramp-suppress-trace t) + +(defvar tramp-trace-functions nil + "A list of non-Tramp functions to be trace with tramp-verbose > 10.") + (defun tramp-debug-message (vec fmt-string &rest arguments) "Append message to debug buffer of VEC. Message is formatted with FMT-STRING as control string and the remaining @@ -1922,10 +1933,13 @@ ARGUMENTS to actually emit the message (if applicable)." (or tramp-repository-version ""))))) ;; Traces. (when (>= tramp-verbose 11) - (dolist (elt (all-completions "tramp-" obarray 'functionp)) - (let ((fn (intern elt))) - (unless (get fn 'tramp-suppress-trace) - (trace-function-background fn))))) + (dolist + (elt + (append + (mapcar #'intern (all-completions "tramp-" obarray 'functionp)) + tramp-trace-functions)) + (unless (get elt 'tramp-suppress-trace) + (trace-function-background elt)))) ;; Delete debug file. (when (and tramp-debug-to-file (tramp-get-debug-file-name vec)) (ignore-errors (delete-file (tramp-get-debug-file-name vec))))) |