bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#70959: Tramp connection property can interact weirdly with cache


From: Michael Albinus
Subject: bug#70959: Tramp connection property can interact weirdly with cache
Date: Sat, 18 May 2024 20:43:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Dmitry Gutov <dmitry@gutov.dev> writes:

> Hi Michael,

Hi Dmitry,

>> You would do something like
>> --8<---------------cut here---------------start------------->8---
>> (connection-local-set-profile-variables 'remote-direct-async
>>     '((tramp-direct-async-process . t)))
>> (connection-local-set-profiles
>>     '(:application tramp :machine "randomhost") 'remote-direct-async)
>> --8<---------------cut here---------------end--------------->8---
>> `remote-direct-async' is a profile name you could choose
>> yourself. `tramp-direct-async-process' would be the respective Tramp
>> variable.
>
> That looks very reasonable. One bonus is that the machine is specified
> by the hostname only.
>
> Which would avoid the difficulty of tweaking the regexp (e.g. I had a
> problem - on a different machine - that my url included a port, and
> that needed to be reflected in the regexp as well).

Try the following patch and the config as shown above.

diff --git a/lisp/tramp.el b/lisp/tramp.el
index f024ebec..814d33e6 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -4847,6 +4847,8 @@ a connection-local variable."
   (when (process-command proc)
     (tramp-message vec 6 "%s" (string-join (process-command proc) " "))))

+(defvar tramp-direct-async-process nil)
+
 (defun tramp-direct-async-process-p (&rest args)
   "Whether direct async `make-process' can be called."
   (let ((v (tramp-dissect-file-name default-directory))
@@ -4855,7 +4857,7 @@ a connection-local variable."
     (and ;; The method supports it.
          (tramp-get-method-parameter v 'tramp-direct-async)
         ;; It has been indicated.
-         (tramp-get-connection-property v "direct-async-process")
+        (connection-local-value tramp-direct-async-process)
         ;; There's no multi-hop.
         (or (not (tramp-multi-hop-p v))
             (null (cdr (tramp-compute-multi-hops v))))
Best regards, Michael.

reply via email to

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