summaryrefslogtreecommitdiff
path: root/lisp/net/tramp.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2013-01-21 10:49:43 +0100
committerMichael Albinus <michael.albinus@gmx.de>2013-01-21 10:49:43 +0100
commita36e2d260d235ab0a6b2f0c6f393b65b41eb8a93 (patch)
tree4f5c78e9cb825a6a7398c2f4f13ab0ace9188ee4 /lisp/net/tramp.el
parent88c7dfa37000245fa2fdb6cf6fc6b425dd7c7ee3 (diff)
downloademacs-a36e2d260d235ab0a6b2f0c6f393b65b41eb8a93.tar.gz
emacs-a36e2d260d235ab0a6b2f0c6f393b65b41eb8a93.tar.bz2
emacs-a36e2d260d235ab0a6b2f0c6f393b65b41eb8a93.zip
Improve XEmacs compatibility.
* net/tramp.el (tramp-replace-environment-variables): Make it a defun. * net/tramp-adb.el (top): Require `time-date'. (tramp-adb-ls-output-time-less-p): Use `tramp-time-less-p'. (tramp-adb-handle-copy-file, tramp-adb-handle-rename-file): Use `tramp-file-name-handler'. (tramp-adb-maybe-open-connection): Use `tramp-compat-set-process-query-on-exit-flag'. * net/tramp-sh.el (tramp-sh-handle-file-acl): Use `tramp-compat-funcall'. * net/tramp-smb.el (tramp-smb-handle-file-acl): Use `looking-at' and `tramp-compat-funcall'.
Diffstat (limited to 'lisp/net/tramp.el')
-rw-r--r--lisp/net/tramp.el37
1 files changed, 16 insertions, 21 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 2c4aac0ac8a..69e82de3f7f 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1779,28 +1779,23 @@ value of `default-file-modes', without execute permissions."
(or (file-modes filename)
(logand (default-file-modes) (tramp-compat-octal-to-decimal "0666"))))
-(defalias 'tramp-replace-environment-variables
- (if (ignore-errors
- (equal "${ tramp?}"
- (tramp-compat-funcall
- 'substitute-env-vars "${ tramp?}" 'only-defined)))
- (lambda (filename)
- "Like `substitute-env-vars' with `only-defined' non-nil."
- (tramp-compat-funcall 'substitute-env-vars filename 'only-defined))
- (lambda (filename)
- "Replace environment variables in FILENAME.
+(defun tramp-replace-environment-variables (filename)
+ "Replace environment variables in FILENAME.
Return the string with the replaced variables."
- (save-match-data
- (let ((idx (string-match "$\\(\\w+\\)" filename)))
- ;; `$' is coded as `$$'.
- (when (and idx
- (or (zerop idx) (not (eq ?$ (aref filename (1- idx)))))
- (getenv (match-string 1 filename)))
- (setq filename
- (replace-match
- (substitute-in-file-name (match-string 0 filename))
- t nil filename)))
- filename)))))
+ (or (ignore-errors
+ (tramp-compat-funcall 'substitute-env-vars filename 'only-defined))
+ ;; We need an own implementation.
+ (save-match-data
+ (let ((idx (string-match "$\\(\\w+\\)" filename)))
+ ;; `$' is coded as `$$'.
+ (when (and idx
+ (or (zerop idx) (not (eq ?$ (aref filename (1- idx)))))
+ (getenv (match-string 1 filename)))
+ (setq filename
+ (replace-match
+ (substitute-in-file-name (match-string 0 filename))
+ t nil filename)))
+ filename))))
;; In XEmacs, electricity is implemented via a key map for ?/ and ?~,
;; which calls corresponding functions (see minibuf.el).