diff options
| author | Michael Albinus | 2013-02-16 18:44:00 +0100 |
|---|---|---|
| committer | Michael Albinus | 2013-02-16 18:44:00 +0100 |
| commit | 61addbc212a08ba146fc7baa7b3c04071f4445fb (patch) | |
| tree | 71e150680dc89b533d86adeb108710e1a075db53 | |
| parent | 2150b4715f3c8963a13535e6b6085dc040396d53 (diff) | |
| download | emacs-61addbc212a08ba146fc7baa7b3c04071f4445fb.tar.gz emacs-61addbc212a08ba146fc7baa7b3c04071f4445fb.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/net/tramp-cache.el | 37 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 1 |
4 files changed, 47 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0718296dffd..dd738ca9430 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2013-02-16 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-cache.el (tramp-connection-properties): New customer | ||
| 4 | option. | ||
| 5 | (tramp-get-connection-property): Use it. | ||
| 6 | |||
| 7 | * net/tramp-compat.el (top): Require 'trampver. | ||
| 8 | |||
| 9 | * net/tramp-sh.el (tramp-remote-process-environment): Set | ||
| 10 | tramp-autoload cookie. | ||
| 11 | |||
| 1 | 2013-02-16 Kevin Ryde <user42@zip.com.au> | 12 | 2013-02-16 Kevin Ryde <user42@zip.com.au> |
| 2 | 13 | ||
| 3 | * info-look.el (info-lookup-select-mode): If major-mode has no | 14 | * info-look.el (info-lookup-select-mode): If major-mode has no |
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index d1ef1739bf7..dc45a57b7c6 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el | |||
| @@ -58,6 +58,19 @@ | |||
| 58 | (defvar tramp-cache-data (make-hash-table :test 'equal) | 58 | (defvar tramp-cache-data (make-hash-table :test 'equal) |
| 59 | "Hash table for remote files properties.") | 59 | "Hash table for remote files properties.") |
| 60 | 60 | ||
| 61 | ;;;###tramp-autoload | ||
| 62 | (defcustom tramp-connection-properties nil | ||
| 63 | "List of static connection properties. | ||
| 64 | Every entry has the form (REGEXP PROPERTY VALUE). The regexp | ||
| 65 | matches remote file names. It can be nil. PROPERTY is a string, | ||
| 66 | and VALUE the corresponding value. They are used, if there is no | ||
| 67 | matching entry in for PROPERTY in `tramp-cache-data'." | ||
| 68 | :group 'tramp | ||
| 69 | :version "24.4" | ||
| 70 | :type '(repeat (list (choice :tag "File Name regexp" regexp (const nil)) | ||
| 71 | (choice :tag " Property" string) | ||
| 72 | (choice :tag " Value" sexp)))) | ||
| 73 | |||
| 61 | (defcustom tramp-persistency-file-name | 74 | (defcustom tramp-persistency-file-name |
| 62 | (cond | 75 | (cond |
| 63 | ;; GNU Emacs. | 76 | ;; GNU Emacs. |
| @@ -204,9 +217,27 @@ If the value is not set for the connection, returns DEFAULT." | |||
| 204 | (setq key (copy-sequence key)) | 217 | (setq key (copy-sequence key)) |
| 205 | (aset key 3 nil)) | 218 | (aset key 3 nil)) |
| 206 | (let* ((hash (gethash key tramp-cache-data)) | 219 | (let* ((hash (gethash key tramp-cache-data)) |
| 207 | (value (if (hash-table-p hash) | 220 | (value |
| 208 | (gethash property hash default) | 221 | (catch 'result |
| 209 | default))) | 222 | (or |
| 223 | ;; Check for dynamic properties. | ||
| 224 | (and | ||
| 225 | (hash-table-p hash) | ||
| 226 | (maphash | ||
| 227 | (lambda (x y) (when (equal x property) (throw 'result y))) | ||
| 228 | hash)) | ||
| 229 | ;; Check for static properties. | ||
| 230 | (and | ||
| 231 | (vectorp key) | ||
| 232 | (dolist (elt tramp-connection-properties) | ||
| 233 | (when (and (string-match | ||
| 234 | (or (nth 0 elt) "") | ||
| 235 | (tramp-make-tramp-file-name | ||
| 236 | (aref key 0) (aref key 1) (aref key 2) nil)) | ||
| 237 | (string-equal (or (nth 1 elt) "") (or property ""))) | ||
| 238 | (throw 'result (nth 2 elt))))) | ||
| 239 | ;; The default value. | ||
| 240 | default)))) | ||
| 210 | (tramp-message key 7 "%s %s" property value) | 241 | (tramp-message key 7 "%s %s" property value) |
| 211 | value)) | 242 | value)) |
| 212 | 243 | ||
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 12510bf7fab..81c4d5ccced 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | (require 'format-spec) | 52 | (require 'format-spec) |
| 53 | (require 'shell) | 53 | (require 'shell) |
| 54 | 54 | ||
| 55 | (require 'trampver) | ||
| 55 | (require 'tramp-loaddefs) | 56 | (require 'tramp-loaddefs) |
| 56 | 57 | ||
| 57 | ;; As long as password.el is not part of (X)Emacs, it shouldn't be | 58 | ;; As long as password.el is not part of (X)Emacs, it shouldn't be |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 001a27f3b2e..9be22352b23 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -512,6 +512,7 @@ as given in your `~/.profile'." | |||
| 512 | (const :tag "Private Directories" tramp-own-remote-path) | 512 | (const :tag "Private Directories" tramp-own-remote-path) |
| 513 | (string :tag "Directory")))) | 513 | (string :tag "Directory")))) |
| 514 | 514 | ||
| 515 | ;;;###tramp-autoload | ||
| 515 | (defcustom tramp-remote-process-environment | 516 | (defcustom tramp-remote-process-environment |
| 516 | `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_ALL=C" | 517 | `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_ALL=C" |
| 517 | ,(format "TERM=%s" tramp-terminal-type) | 518 | ,(format "TERM=%s" tramp-terminal-type) |