From: Michael Albinus Date: Thu, 14 Feb 2013 13:32:04 +0000 (+0100) Subject: * net/tramp.el (tramp-debug-message): Add X-Git-Tag: emacs-24.3.90~173^2~7^2~41 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5267e6d3f62bb58473e9d7bbb485b470a4d2400d;p=emacs.git * net/tramp.el (tramp-debug-message): Add `tramp-condition-case-unless-debug'. (tramp-debug-on-error): New defvar. (tramp-condition-case-unless-debug): New defun. (tramp-file-name-handler): Use it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5be2e29ff6d..5a752fe0c3a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-02-14 Michael Albinus + + * net/tramp.el (tramp-debug-message): Add + `tramp-condition-case-unless-debug'. + (tramp-debug-on-error): New defvar. + (tramp-condition-case-unless-debug): New defun. + (tramp-file-name-handler): Use it. + 2013-02-14 Juri Linkov * info.el (Info-isearch-filter): Treat non-nil values of diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index a4250f94988..89648b0e9a9 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1399,6 +1399,7 @@ ARGS to actually emit the message (if applicable)." "tramp-compat-condition-case-unless-debug" "tramp-compat-funcall" "tramp-compat-with-temp-message" + "tramp-condition-case-unless-debug" "tramp-debug-message" "tramp-error" "tramp-error-with-buffer" @@ -2011,6 +2012,15 @@ ARGS are the arguments OPERATION has been called with." res (cdr elt)))) res)))) +(defvar tramp-debug-on-error nil + "Like `debug-on-error' but used Tramp internal.") + +(defmacro tramp-condition-case-unless-debug + (var bodyform &rest handlers) + "Like `condition-case-unless-debug' but `tramp-debug-on-error'." + `(let ((debug-on-error tramp-debug-on-error)) + (tramp-compat-condition-case-unless-debug ,var ,bodyform ,@handlers))) + ;; Main function. ;;;###autoload (defun tramp-file-name-handler (operation &rest args) @@ -2026,7 +2036,7 @@ Falls back to normal file name handler if no Tramp file name handler exists." (with-parsed-tramp-file-name filename nil ;; Call the backend function. (if foreign - (tramp-compat-condition-case-unless-debug err + (tramp-condition-case-unless-debug err (let ((sf (symbol-function foreign)) result) ;; Some packages set the default directory to a @@ -2079,7 +2089,7 @@ Falls back to normal file name handler if no Tramp file name handler exists." ;; in order to give the user a chance to correct the ;; file name in the minibuffer. ;; In order to get a full backtrace, one could apply - ;; (setq debug-on-error t debug-on-signal t) + ;; (setq tramp-debug-on-error t) (error (cond ((and completion (zerop (length localname))