From 1924ea8c2970a51f30e75ff370e61313e35b3a64 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 2 Jun 2014 15:51:35 +0200 Subject: [PATCH] * net/tramp.el (with-tramp-progress-reporter, tramp-call-process): Add traces. --- lisp/ChangeLog | 3 ++- lisp/net/tramp.el | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 54ecd84e08b..10de84b3c41 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,7 @@ 2014-06-02 Michael Albinus - * net/tramp.el (tramp-call-process): Add traces. + * net/tramp.el (with-tramp-progress-reporter, tramp-call-process): + Add traces. 2014-06-02 Wilson Snyder diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5164c4b32bb..9be0cbe10a9 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1676,7 +1676,8 @@ without a visible progress reporter." (prog1 (progn ,@body) (setq cookie "done")) ;; Stop progress reporter. (if tm (tramp-compat-funcall 'cancel-timer tm)) - (tramp-message ,vec ,level "%s...%s" ,message cookie))))) + (tramp-message ,vec ,level "%s...%s" ,message cookie) + (when (string-equal "failed" cookie) (tramp-backtrace ,vec)))))) (tramp-compat-font-lock-add-keywords 'emacs-lisp-mode '("\\")) @@ -4128,13 +4129,17 @@ Furthermore, traces are written with verbosity of 6." (tramp-message v 6 "`%s %s' %s %s" program (mapconcat 'identity args " ") infile destination) - (with-temp-buffer - (setq result - (apply - 'call-process program infile (or destination t) display args)) - (with-current-buffer - (if (bufferp destination) destination (current-buffer)) - (tramp-message v 6 "%d\n%s" result (buffer-string)))) + (condition-case err + (with-temp-buffer + (setq result + (apply + 'call-process program infile (or destination t) display args)) + (with-current-buffer + (if (bufferp destination) destination (current-buffer)) + (tramp-message v 6 "%d\n%s" result (buffer-string)))) + (error + (setq result 1) + (tramp-message v 6 "%d\n%s" result (error-message-string err)))) result)) ;;;###tramp-autoload -- 2.39.2