;;; tramp-cache.el --- file information caching for Tramp
-;; Copyright (C) 2000, 2005, 2006, 2007, 2008, 2009,
-;; 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2005-2011 Free Software Foundation, Inc.
;; Author: Daniel Pittman <daniel@inanna.danann.net>
;; Michael Albinus <michael.albinus@gmx.de>
;; - localname is NIL. This are reusable properties. Examples:
;; "remote-shell" identifies the POSIX shell to be called on the
;; remote host, or "perl" is the command to be called on the remote
-;; host, when starting a Perl script. These properties are saved in
+;; host when starting a Perl script. These properties are saved in
;; the file `tramp-persistency-file-name'.
;;
;; - localname is a string. This are temporary properties, which are
'directory-file-name (list directory))))
(tramp-message vec 8 "%s" directory)
(maphash
- '(lambda (key value)
+ (lambda (key value)
(when (and (stringp (tramp-file-name-localname key))
(string-match directory (tramp-file-name-localname key)))
(remhash key tramp-cache-data)))
(add-hook 'eshell-pre-command-hook 'tramp-flush-file-function)
(add-hook 'kill-buffer-hook 'tramp-flush-file-function)
(add-hook 'tramp-cache-unload-hook
- '(lambda ()
+ (lambda ()
(remove-hook 'before-revert-hook
'tramp-flush-file-function)
(remove-hook 'eshell-pre-command-hook
(when (hash-table-p table)
(let (result)
(maphash
- '(lambda (key value)
+ (lambda (key value)
(let ((tmp (format
"(%s %s)"
(if (processp key)
"Return a list of all known connection vectors according to `tramp-cache'."
(let (result)
(maphash
- '(lambda (key value)
+ (lambda (key value)
(when (and (vectorp key) (null (aref key 3)))
(add-to-list 'result key)))
tramp-cache-data)
(let ((cache (copy-hash-table tramp-cache-data)))
;; Remove temporary data.
(maphash
- '(lambda (key value)
+ (lambda (key value)
(if (and (vectorp key) (not (tramp-file-name-localname key)))
(progn
(remhash "process-name" value)
(write-region
(point-min) (point-max) tramp-persistency-file-name))))))
-(add-hook 'kill-emacs-hook 'tramp-dump-connection-properties)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'tramp-dump-connection-properties))
(add-hook 'tramp-cache-unload-hook
- '(lambda ()
+ (lambda ()
(remove-hook 'kill-emacs-hook
'tramp-dump-connection-properties)))
for all methods. Resulting data are derived from connection history."
(let (res)
(maphash
- '(lambda (key value)
+ (lambda (key value)
(if (and (vectorp key)
(string-equal method (tramp-file-name-method key))
(not (tramp-file-name-localname key)))