mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-22 18:35:09 +00:00
* 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.
This commit is contained in:
parent
2150b4715f
commit
61addbc212
@ -1,3 +1,14 @@
|
||||
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
|
||||
|
@ -58,6 +58,19 @@
|
||||
(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.
|
||||
@ -204,9 +217,27 @@ If the value is not set for the connection, returns DEFAULT."
|
||||
(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))
|
||||
|
||||
|
@ -52,6 +52,7 @@
|
||||
(require 'format-spec)
|
||||
(require 'shell)
|
||||
|
||||
(require 'trampver)
|
||||
(require 'tramp-loaddefs)
|
||||
|
||||
;; As long as password.el is not part of (X)Emacs, it shouldn't be
|
||||
|
@ -512,6 +512,7 @@ as given in your `~/.profile'."
|
||||
(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)
|
||||
|
Loading…
Reference in New Issue
Block a user