emacs-diffs
[Top][All Lists]
Advanced

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

master 6c60ecd 1/2: Fix problem in Tramp running two async processes in


From: Michael Albinus
Subject: master 6c60ecd 1/2: Fix problem in Tramp running two async processes in parallel
Date: Tue, 16 Mar 2021 13:40:36 -0400 (EDT)

branch: master
commit 6c60ecd2d632ad41851e91cc53036a679c391194
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Fix problem in Tramp running two async processes in parallel
    
    * lisp/net/tramp-integration.el
    (tramp-compile-disable-ssh-controlmaster-options): New defun.  Add
    it to `compilation-mode-hook'.  (Bug#45518)
    
    * lisp/progmodes/compile.el (compilation-get-file-structure):
    Revert commit 4ce5646d59, it isn't needed.
---
 lisp/net/tramp-integration.el | 21 +++++++++++++++++++--
 lisp/progmodes/compile.el     |  7 +------
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el
index 5adc4ce..9d4dd7d 100644
--- a/lisp/net/tramp-integration.el
+++ b/lisp/net/tramp-integration.el
@@ -261,6 +261,23 @@ NAME must be equal to `tramp-current-connection'."
                  (delete (info-lookup->mode-cache 'symbol ',mode)
                          (info-lookup->topic-cache 'symbol))))))))
 
+;;; Integration of compile.el:
+
+;; Compilation processes use `accept-process-output' such a way that
+;; Tramp's parallel `accept-process-output' blocks.  See last part of
+;; Bug#45518.  So we don't use ssh ControlMaster options.
+(defun tramp-compile-disable-ssh-controlmaster-options ()
+  "Don't allow ssh ControlMaster while compiling."
+  (setq-local tramp-use-ssh-controlmaster-options nil))
+
+(with-eval-after-load 'compile
+  (add-hook 'compilation-mode-hook
+           #'tramp-compile-disable-ssh-controlmaster-options)
+  (add-hook 'tramp-integration-unload-hook
+           (lambda ()
+             (remove-hook 'compilation-start-hook
+                          #'tramp-compile-disable-ssh-controlmaster-options))))
+
 ;;; Default connection-local variables for Tramp:
 ;; `connection-local-set-profile-variables' and
 ;; `connection-local-set-profiles' exists since Emacs 26.1.
@@ -277,7 +294,7 @@ NAME must be equal to `tramp-current-connection'."
 
 (tramp-compat-funcall
  'connection-local-set-profiles
- `(:application tramp)
+ '(:application tramp)
  'tramp-connection-local-default-system-profile)
 
 (defconst tramp-connection-local-default-shell-variables
@@ -293,7 +310,7 @@ NAME must be equal to `tramp-current-connection'."
 (with-eval-after-load 'shell
   (tramp-compat-funcall
    'connection-local-set-profiles
-   `(:application tramp)
+   '(:application tramp)
    'tramp-connection-local-default-shell-profile))
 
 (add-hook 'tramp-unload-hook
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 48b5ee9..d23c77e 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -3040,12 +3040,7 @@ TRUE-DIRNAME is the `file-truename' of DIRNAME, if 
given."
            ;; Get the specified directory from FILE.
            (spec-directory
              (if (cdr file)
-                 ;; This function is active in `compilation-filter'.
-                 ;; There could be problems to call `file-truename'
-                 ;; for remote compilation processes.
-                (if (file-remote-p default-directory)
-                    (concat comint-file-name-prefix (cdr file))
-                  (file-truename (concat comint-file-name-prefix (cdr 
file)))))))
+                (file-truename (concat comint-file-name-prefix (cdr file))))))
 
        ;; Check for a comint-file-name-prefix and prepend it if appropriate.
        ;; (This is very useful for compilation-minor-mode in an rlogin-mode



reply via email to

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