+2013-02-16 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-cache.el (tramp-connection-properties): New customer
+ option.
+ (tramp-get-connection-property): Use it.
+
+ * net/tramp-compat.el (top): Require 'trampver.
+
+ * net/tramp-sh.el (tramp-remote-process-environment): Set
+ tramp-autoload cookie.
+
2013-02-16 Kevin Ryde <user42@zip.com.au>
* info-look.el (info-lookup-select-mode): If major-mode has no
(defvar tramp-cache-data (make-hash-table :test 'equal)
"Hash table for remote files properties.")
+;;;###tramp-autoload
+(defcustom tramp-connection-properties nil
+ "List of static connection properties.
+Every entry has the form (REGEXP PROPERTY VALUE). The regexp
+matches remote file names. It can be nil. PROPERTY is a string,
+and VALUE the corresponding value. They are used, if there is no
+matching entry in for PROPERTY in `tramp-cache-data'."
+ :group 'tramp
+ :version "24.4"
+ :type '(repeat (list (choice :tag "File Name regexp" regexp (const nil))
+ (choice :tag " Property" string)
+ (choice :tag " Value" sexp))))
+
(defcustom tramp-persistency-file-name
(cond
;; GNU Emacs.
(setq key (copy-sequence key))
(aset key 3 nil))
(let* ((hash (gethash key tramp-cache-data))
- (value (if (hash-table-p hash)
- (gethash property hash default)
- default)))
+ (value
+ (catch 'result
+ (or
+ ;; Check for dynamic properties.
+ (and
+ (hash-table-p hash)
+ (maphash
+ (lambda (x y) (when (equal x property) (throw 'result y)))
+ hash))
+ ;; Check for static properties.
+ (and
+ (vectorp key)
+ (dolist (elt tramp-connection-properties)
+ (when (and (string-match
+ (or (nth 0 elt) "")
+ (tramp-make-tramp-file-name
+ (aref key 0) (aref key 1) (aref key 2) nil))
+ (string-equal (or (nth 1 elt) "") (or property "")))
+ (throw 'result (nth 2 elt)))))
+ ;; The default value.
+ default))))
(tramp-message key 7 "%s %s" property value)
value))
(const :tag "Private Directories" tramp-own-remote-path)
(string :tag "Directory"))))
+;;;###tramp-autoload
(defcustom tramp-remote-process-environment
`("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_ALL=C"
,(format "TERM=%s" tramp-terminal-type)