From: Michael Albinus Date: Thu, 30 Aug 2018 12:30:49 +0000 (+0200) Subject: Do not propagate Tramp errors to the main thread X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=279618b685ca3e0787d65afcd8007e3ba8c565b5;p=emacs.git Do not propagate Tramp errors to the main thread * lisp/files.el (find-file-noselect): Use `with-demoted-errors' for the joined threads. * lisp/net/tramp-compat.el (tramp-compat-signal): Remove. * lisp/net/tramp.el (tramp-error, tramp-file-name-handler): Do not propagate the error to the main thread. --- diff --git a/lisp/files.el b/lisp/files.el index 87d77911350..8ed683d8d96 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2229,7 +2229,8 @@ every file will be loaded in an own thread." (with-mutex vc-mutex (thread-yield) (dolist (thread threads result) - (setq result (cons (thread-join thread) result))))) + (setq result (with-demoted-errors + (cons (thread-join thread) result)))))) (mapcar #'find-file-noselect files)))) diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index bb6fc186988..2a5939f2143 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -250,13 +250,6 @@ If NAME is a remote file name, the local part of NAME is unquoted." "Yield the CPU to another thread." (tramp-compat-funcall 'thread-yield)) -(defsubst tramp-compat-signal (error-symbol data) - "Signal an error to the main thread." - (when tramp-compat-main-thread - (tramp-compat-funcall - 'thread-signal tramp-compat-main-thread error-symbol data)) - (signal error-symbol data)) - ;; Mutexes have entered Emacs 26.1. Once we use only Emacs 26+, we ;; must check (mutexp mutex), because the other functions might still ;; not exist when Emacs is configured --without-threads. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 62c9f9ab7aa..c87cb2271dc 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1702,7 +1702,7 @@ function is meant for debugging purposes." "Emit an error. VEC-OR-PROC identifies the connection to use, SIGNAL is the signal identifier to be raised, remaining arguments passed to -`tramp-message'. Finally, signal SIGNAL is raised to the main thread." +`tramp-message'. Finally, signal SIGNAL is raised." (let (tramp-message-show-message) (tramp-backtrace vec-or-proc) (unless arguments @@ -1718,8 +1718,7 @@ signal identifier to be raised, remaining arguments passed to (list signal (get signal 'error-message) (apply #'format-message fmt-string arguments))))) - (tramp-compat-signal - signal (list (apply #'format-message fmt-string arguments))))) + (signal signal (list (apply #'format-message fmt-string arguments))))) (defsubst tramp-error-with-buffer (buf vec-or-proc signal fmt-string &rest arguments) @@ -2342,8 +2341,8 @@ If Emacs is compiled --with-threads, the body is protected by a mutex." (tramp-message v 1 "Interrupt received in operation %s" (cons operation args))) - ;; Propagate the quit signal. - (tramp-compat-signal (car err) (cdr err))) + ;; Propagate the signal. + (signal (car err) (cdr err))) ;; When we are in completion mode, some failed ;; operations shall return at least a default @@ -2362,7 +2361,7 @@ If Emacs is compiled --with-threads, the body is protected by a mutex." '(expand-file-name file-name-as-directory))) filename) ;; Propagate the error. - (t (tramp-compat-signal (car err) (cdr err)))))) + (t (signal (car err) (cdr err)))))) ;; Nothing to do for us. However, since we are in ;; `tramp-mode', we must suppress the volume letter