[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f7e3139 1/2: * lisp/net/tramp.el (tramp-accept-process-output): P

From: Michael Albinus
Subject: master f7e3139 1/2: * lisp/net/tramp.el (tramp-accept-process-output): Propagate `quit' signal.
Date: Fri, 13 Mar 2020 05:55:45 -0400 (EDT)

branch: master
commit f7e313956a3799da658b3a988e9645ee8a57bef3
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    * lisp/net/tramp.el (tramp-accept-process-output): Propagate `quit' signal.
 lisp/net/tramp.el | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index c498f8c..3ce2225 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4195,18 +4195,21 @@ performed successfully.  Any other value means an 
 (defun tramp-accept-process-output (proc &optional timeout)
   "Like `accept-process-output' for Tramp processes.
 This is needed in order to hide `last-coding-system-used', which is set
-for process communication also."
+for process communication also.
+If the user quits via `C-g', it is propagated up to `tramp-file-name-handler'."
   (with-current-buffer (process-buffer proc)
     (let ((inhibit-read-only t)
-      ;; JUST-THIS-ONE is set due to Bug#12145.
-      (tramp-message
-       proc 10 "%s %s %s %s\n%s"
-       proc timeout (process-status proc)
-       (with-local-quit
-        (setq result (accept-process-output proc timeout nil t)))
-       (buffer-string))
+      ;; JUST-THIS-ONE is set due to Bug#12145.  `with-local-quit'
+      ;; returns t in order to report success.
+      (if (with-local-quit
+           (setq result (accept-process-output proc timeout nil t)) t)
+         (tramp-message
+          proc 10 "%s %s %s %s\n%s"
+          proc timeout (process-status proc) result (buffer-string))
+       ;; Propagate quit.
+       (keyboard-quit))
 (defun tramp-search-regexp (regexp)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]