Function: tramp-get-hash-table

tramp-get-hash-table is an autoloaded and 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
;;;###tramp-autoload
(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."
  ;; (declare (tramp-suppress-trace t))
  (let ((tramp-verbose 0))
    (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))
		  ;; Mark it as taken from `tramp-connection-properties'.
		  (tramp-set-connection-property
		   key (propertize (nth 1 elt) 'tramp-default t) (nth 2 elt)))))
	    hash)))))