Function: tramp-get-connection-property

tramp-get-connection-property is an autoloaded and byte-compiled function defined in tramp-cache.el.gz.

Signature

(tramp-get-connection-property KEY PROPERTY DEFAULT)

Documentation

Get the named PROPERTY for the connection.

KEY identifies the connection, it is either a process or a tramp-file-name structure. A special case is nil, which is used to cache connection properties of the local machine. If KEY is tramp-cache-undefined, or if the value is not set for the connection, return DEFAULT.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-cache.el.gz
;;; -- Properties --

;;;###tramp-autoload
(defun tramp-get-connection-property (key property default)
  "Get the named PROPERTY for the connection.
KEY identifies the connection, it is either a process or a
`tramp-file-name' structure.  A special case is nil, which is
used to cache connection properties of the local machine.
If KEY is `tramp-cache-undefined', or if the value is not set for
the connection, return DEFAULT."
  (setq key (tramp-file-name-unify key))
  (let* ((hash (tramp-get-hash-table key))
	 (cached (if (hash-table-p hash)
		     (gethash property hash tramp-cache-undefined)
		   tramp-cache-undefined))
	 (value default)
	 cache-used)

    (when (and (not (eq cached tramp-cache-undefined))
	       ;; If the key is an auxiliary process object, check
	       ;; whether the process is still alive.
	       (not (and (processp key) (not (process-live-p key)))))
      (setq value cached
	    cache-used t))
    (tramp-message key 7 "%s %s; cache used: %s" property value cache-used)
    value))