JD Smith <jdtsm...@gmail.com> writes:

Hi,

> Seems to be a good solution to avoid stomping on other default
> settings.  One small issue I've found.  The "step 2" of enabling
> direct-async is:
>
>     (add-to-list 'tramp-connection-properties (list "/ssh:"
>     "direct-async" t))
>
> But that applies to _all_ ssh connections.  I need to apply this
> locally only to processes started by my package.  I don't think making
> this variable buffer local will work given the way it's ingested into
> the config hash.  If you have an idea there, I'd appreciate hearing.

OK, let's do some Tramp voodoo. Try the following snippet:

--8<---------------cut here---------------start------------->8---
(let ((connection-local-profile-alist
       (cons
        '(direct-async-process-profile (tramp-direct-async-process . t))
        connection-local-profile-alist))
      (connection-local-criteria-alist
       (cons
        '((:application tramp) direct-async-process-profile)
        connection-local-criteria-alist))
      (vec (tramp-dissect-file-name default-directory)))
  (with-tramp-saved-connection-property vec "direct-async"
    (tramp-set-connection-property vec "direct-async" t)
    BODY))
--8<---------------cut here---------------end--------------->8---

This should do everything you need, with respect to connect-local
variables and connection properties.

Best regards, Michael.

Reply via email to