summaryrefslogtreecommitdiff
path: root/lisp/net/tramp.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2017-02-12 10:59:03 +0000
committerAlan Mackenzie <acm@muc.de>2017-02-12 10:59:03 +0000
commitf4d5b687150810129b7a1d5b006e31ccf82b691b (patch)
tree4229b13800349032697daae3904dc3773e6b7a80 /lisp/net/tramp.el
parentd5514332d4a6092673ce1f78fadcae0c57f7be64 (diff)
parent148100d98319499f0ac6f57b8be08cbd14884a5c (diff)
downloademacs-comment-cache.tar.gz
Merge branch 'master' into comment-cachecomment-cache
Diffstat (limited to 'lisp/net/tramp.el')
-rw-r--r--lisp/net/tramp.el30
1 files changed, 24 insertions, 6 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index fc7fdd30850..48dcd5edd11 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3614,18 +3614,36 @@ connection buffer."
;;; Utility functions:
-(defun tramp-accept-process-output (&optional proc timeout timeout-msecs)
+(defun tramp-accept-process-output (proc 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."
+ ;; FIXME: There are problems, when an asynchronous process runs in
+ ;; parallel, and also timers are active. See
+ ;; <http://lists.gnu.org/archive/html/tramp-devel/2017-01/msg00010.html>.
+ (when (and timer-event-last
+ (string-prefix-p "*tramp/" (process-name proc))
+ (let (result)
+ (maphash
+ (lambda (key _value)
+ (and (processp key)
+ (not (string-prefix-p "*tramp/" (process-name key)))
+ (tramp-compat-process-live-p key)
+ (setq result t)))
+ tramp-cache-data)
+ result))
+ (sit-for 0.01 'nodisp))
(with-current-buffer (process-buffer proc)
(let (buffer-read-only last-coding-system-used)
;; Under Windows XP, accept-process-output doesn't return
- ;; sometimes. So we add an additional timeout.
- (with-timeout ((or timeout 1))
- (accept-process-output proc timeout timeout-msecs (and proc t)))
- (tramp-message proc 10 "%s %s\n%s"
- proc (process-status proc) (buffer-string)))))
+ ;; sometimes. So we add an additional timeout. JUST-THIS-ONE
+ ;; is set due to Bug#12145.
+ (tramp-message
+ proc 10 "%s %s %s\n%s"
+ proc (process-status proc)
+ (with-timeout (timeout)
+ (accept-process-output proc timeout nil t))
+ (buffer-string)))))
(defun tramp-check-for-regexp (proc regexp)
"Check, whether REGEXP is contained in process buffer of PROC.