[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r111809: * net/tramp-cache.el (tramp-
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r111809: * net/tramp-cache.el (tramp-connection-properties): New customer option. |
Date: |
Sat, 16 Feb 2013 18:44:00 +0100 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 111809
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Sat 2013-02-16 18:44:00 +0100
message:
* 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.
modified:
lisp/ChangeLog
lisp/net/tramp-cache.el
lisp/net/tramp-compat.el
lisp/net/tramp-sh.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-02-16 17:20:43 +0000
+++ b/lisp/ChangeLog 2013-02-16 17:44:00 +0000
@@ -1,3 +1,14 @@
+2013-02-16 Michael Albinus <address@hidden>
+
+ * 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 <address@hidden>
* info-look.el (info-lookup-select-mode): If major-mode has no
=== modified file 'lisp/net/tramp-cache.el'
--- a/lisp/net/tramp-cache.el 2013-01-01 09:11:05 +0000
+++ b/lisp/net/tramp-cache.el 2013-02-16 17:44:00 +0000
@@ -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 @@
(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))
=== modified file 'lisp/net/tramp-compat.el'
--- a/lisp/net/tramp-compat.el 2013-02-12 14:35:10 +0000
+++ b/lisp/net/tramp-compat.el 2013-02-16 17:44:00 +0000
@@ -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
=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el 2013-02-13 16:23:15 +0000
+++ b/lisp/net/tramp-sh.el 2013-02-16 17:44:00 +0000
@@ -512,6 +512,7 @@
(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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r111809: * net/tramp-cache.el (tramp-connection-properties): New customer option.,
Michael Albinus <=