Function: tramp-dump-connection-properties
tramp-dump-connection-properties is a byte-compiled function defined
in tramp-cache.el.gz.
Signature
(tramp-dump-connection-properties)
Documentation
Write persistent connection properties into file tramp-persistency-file-name.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp-cache.el.gz
(defun tramp-dump-connection-properties ()
"Write persistent connection properties into file \
`tramp-persistency-file-name'."
(declare (tramp-suppress-trace t))
;; We shouldn't fail, otherwise Emacs might not be able to be closed.
(ignore-errors
(when (and (hash-table-p tramp-cache-data)
(not (zerop (hash-table-count tramp-cache-data)))
tramp-cache-data-changed
(stringp tramp-persistency-file-name))
(let ((cache (copy-hash-table tramp-cache-data))
print-length print-level)
;; Remove `tramp-null-hop'.
(remhash tramp-null-hop cache)
;; If there is the key "login-as", we don't save, because all
;; other properties might depend on the login name, and we
;; want to give the possibility to use another login name
;; later on. Key "started" exists for the "ftp" method only,
;; which must not be kept persistent.
(maphash
(lambda (key value)
(if (and (tramp-file-name-p key) (hash-table-p value)
(not (string-equal
(tramp-file-name-method key) tramp-archive-method))
(not (tramp-file-name-localname key))
(not (gethash "login-as" value))
(not (gethash "started" value)))
(progn
(dolist (k (hash-table-keys value))
;; Suppress ephemeral properties.
(when (or (string-prefix-p " " k)
(get-text-property 0 'tramp-default k))
(remhash k value)))
(unless (hash-table-keys value)
(remhash key cache)))
(remhash key cache)))
cache)
;; Dump it.
(with-temp-file tramp-persistency-file-name
(insert
(format ";; -*- lisp-data -*- <%s %s>\n"
(time-stamp-string "%02y/%02m/%02d %02H:%02M:%02S")
tramp-persistency-file-name)
";; Tramp connection history. Don't change this file.\n"
";; Run `M-x tramp-cleanup-all-connections' instead.\n\n"
(with-output-to-string
(pp (read (format "(%s)" (tramp-cache-print cache)))))))))))