Function: tramp-direct-async-process-p

tramp-direct-async-process-p is a byte-compiled function defined in tramp.el.gz.

Signature

(tramp-direct-async-process-p &rest ARGS)

Documentation

Whether direct async make-process can be called.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defun tramp-direct-async-process-p (&rest args)
  "Whether direct async `make-process' can be called."
  (let ((v (tramp-dissect-file-name default-directory))
	(buffer (plist-get args :buffer))
	(stderr (plist-get args :stderr)))
    ;; Since Tramp 2.7.1.  In a future release, we'll ignore this
    ;; connection property.
    (when (and (not (tramp-compat-connection-local-p
		     tramp-direct-async-process))
	       (tramp-connection-property-p v "direct-async-process"))
      (let ((msg (concat
		  "Connection property \"direct-async-process\" is deprecated, "
		  "use connection-local variable `tramp-direct-async-process'\n"
		  "See (info \"(tramp) Improving performance of "
		  "asynchronous remote processes\")")))
	(if (tramp-get-connection-property
	     tramp-null-hop "direct-async-process-warned")
	    (tramp-message v 2 msg)
	  (tramp-set-connection-property
	   tramp-null-hop "direct-async-process-warned" t)
	  (tramp-warning v msg))))

    (and ;; The method supports it.
         (tramp-get-method-parameter v 'tramp-direct-async)
	 ;; It has been indicated.  We don't use the global value of
	 ;; `tramp-direct-async-process'.
	 (or (and (tramp-compat-connection-local-p tramp-direct-async-process)
		  (tramp-compat-connection-local-value
		   tramp-direct-async-process))
	     ;; Deprecated setting.
             (tramp-get-connection-property v "direct-async-process"))
	 ;; There's no multi-hop.
	 (or (not (tramp-multi-hop-p v))
	     (null (cdr (tramp-compute-multi-hops v))))
	 ;; There's no remote stdout or stderr file.
	 (or (not (stringp buffer)) (not (tramp-tramp-file-p buffer)))
	 (or (not (stringp stderr)) (not (tramp-tramp-file-p stderr))))))