Function: tramp-get-hash-table

tramp-get-hash-table is a byte-compiled function defined in tramp-cache.el.gz.

Signature

(tramp-get-hash-table KEY)

Documentation

Return the hash table for KEY.

If it doesn't exist yet, it is created and initialized with matching entries of tramp-connection-properties. If KEY is tramp-cache-undefined, don't create anything, and return nil.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-cache.el.gz
(defun tramp-get-hash-table (key)
  "Return the hash table for KEY.
If it doesn't exist yet, it is created and initialized with
matching entries of `tramp-connection-properties'.
If KEY is `tramp-cache-undefined', don't create anything, and return nil."
  (unless (eq key tramp-cache-undefined)
    (or (gethash key tramp-cache-data)
	(let ((hash
	       (puthash key (make-hash-table :test #'equal) tramp-cache-data)))
	  (when (tramp-file-name-p key)
	    (dolist (elt tramp-connection-properties)
	      (when (string-match-p
		     (or (nth 0 elt) "")
		     (tramp-make-tramp-file-name key 'noloc))
		(tramp-set-connection-property key (nth 1 elt) (nth 2 elt)))))
	  hash))))