diff options
author | Michael Albinus <albinus@detlef> | 2010-06-12 10:59:37 +0200 |
---|---|---|
committer | Michael Albinus <albinus@detlef> | 2010-06-12 10:59:37 +0200 |
commit | b81a0b569166c9aa39a00d861ab5a154f3dbdea3 (patch) | |
tree | 018e3fbfa9edb4f24ecb3ff8622274b97acf1612 /lisp/net/tramp-compat.el | |
parent | 5877cf48548c283d33af3a82d8b160c45a321c81 (diff) | |
download | emacs-b81a0b569166c9aa39a00d861ab5a154f3dbdea3.tar.gz |
* net/tramp.el (tramp-remote-process-environment): Protect version
string by apostroph.
(tramp-shell-prompt-pattern): Do not use a shy group in case of
XEmacs.
(tramp-file-name-for-operation): Add `call-process-region'.
(tramp-set-process-query-on-exit-flag): Fix wrong parentheses.
* net/tramp-compat.el (top): Do not autoload
`tramp-handle-file-remote-p'. Load tramp-util.el and tramp-vc.el
only when `start-file-process' is not bound.
(tramp-advice-file-expand-wildcards): Do not use
`tramp-handle-file-remote-p'.
(tramp-compat-make-temp-file): Handle the case, that
`make-temp-file' has no third argument EXTENSION.
Diffstat (limited to 'lisp/net/tramp-compat.el')
-rw-r--r-- | lisp/net/tramp-compat.el | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index a1ec3c9b89d..484d2be7abe 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -44,33 +44,31 @@ (autoload 'tramp-tramp-file-p "tramp") (autoload 'tramp-file-name-handler "tramp") - (autoload 'tramp-handle-file-remote-p "tramp") - - ;; tramp-util offers integration into other (X)Emacs packages like - ;; compile.el, gud.el etc. Not necessary in Emacs 23. - (eval-after-load "tramp" - ;; We check whether `start-file-process' is an alias. - '(when (or (not (fboundp 'start-file-process)) - (symbolp (symbol-function 'start-file-process))) - (require 'tramp-util) - (add-hook 'tramp-unload-hook - '(lambda () - (when (featurep 'tramp-util) - (unload-feature 'tramp-util 'force)))))) - - ;; Make sure that we get integration with the VC package. When it - ;; is loaded, we need to pull in the integration module. Not - ;; necessary in Emacs 23. - (eval-after-load "vc" + + ;; We check whether `start-file-process' is bound. + (unless (fboundp 'start-file-process) + + ;; tramp-util offers integration into other (X)Emacs packages like + ;; compile.el, gud.el etc. Not necessary in Emacs 23. (eval-after-load "tramp" - ;; We check whether `start-file-process' is an alias. - '(when (or (not (fboundp 'start-file-process)) - (symbolp (symbol-function 'start-file-process))) - (require 'tramp-vc) + '(progn + (require 'tramp-util) (add-hook 'tramp-unload-hook '(lambda () - (when (featurep 'tramp-vc) - (unload-feature 'tramp-vc 'force))))))) + (when (featurep 'tramp-util) + (unload-feature 'tramp-util 'force)))))) + + ;; Make sure that we get integration with the VC package. When it + ;; is loaded, we need to pull in the integration module. Not + ;; necessary in Emacs 23. + (eval-after-load "vc" + (eval-after-load "tramp" + '(progn + (require 'tramp-vc) + (add-hook 'tramp-unload-hook + '(lambda () + (when (featurep 'tramp-vc) + (unload-feature 'tramp-vc 'force)))))))) ;; Avoid byte-compiler warnings if the byte-compiler supports this. ;; Currently, XEmacs supports this. @@ -176,7 +174,8 @@ (if (and (tramp-tramp-file-p name) (not (string-match - "[[*?]" (tramp-handle-file-remote-p name 'localname)))) + "[[*?]" (tramp-compat-funcall + 'file-remote-p name 'localname)))) (setq ad-return-value (list name)) ;; Otherwise, just run the original function. ad-do-it))) @@ -236,22 +235,23 @@ Add the extension of FILENAME, if existing." (tramp-compat-temporary-file-directory))) (extension (file-name-extension filename t)) result) - (if (fboundp 'make-temp-file) + (condition-case nil (setq result (tramp-compat-funcall 'make-temp-file prefix dir-flag extension)) - ;; We use our own implementation, taken from files.el. - (while - (condition-case () - (progn - (setq result (concat (make-temp-name prefix) extension)) - (if dir-flag - (make-directory result) - (write-region "" nil result nil 'silent)) - nil) - (file-already-exists t)) - ;; The file was somehow created by someone else between - ;; `make-temp-name' and `write-region', let's try again. - nil)) + (error + ;; We use our own implementation, taken from files.el. + (while + (condition-case () + (progn + (setq result (concat (make-temp-name prefix) extension)) + (if dir-flag + (make-directory result) + (write-region "" nil result nil 'silent)) + nil) + (file-already-exists t)) + ;; The file was somehow created by someone else between + ;; `make-temp-name' and `write-region', let's try again. + nil))) result)) ;; `most-positive-fixnum' does not exist in XEmacs. |