]> git.eshelyaron.com Git - emacs.git/commitdiff
Do not propagate Tramp errors to the main thread
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 30 Aug 2018 12:30:49 +0000 (14:30 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 30 Aug 2018 12:30:49 +0000 (14:30 +0200)
* 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.

lisp/files.el
lisp/net/tramp-compat.el
lisp/net/tramp.el

index 87d77911350f9eafd69e9b8520b5a1b96aaf25f1..8ed683d8d963ec0c8ab4f02b4ef8e98838d820ff 100644 (file)
@@ -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))))
 
index bb6fc186988fa2d1dc4c115edc75382b8d53922b..2a5939f2143a0814a7103e9ec83b756799dc4ea9 100644 (file)
@@ -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.
index 62c9f9ab7aa56f8d28c7789cbc19de63210789f6..c87cb2271dc8c066c292c4b05421783ceeeb7fb1 100644 (file)
@@ -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