Mercurial > emacs
comparison lisp/net/tramp-ftp.el @ 91015:b83d0dadb2a7
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 857-865)
- Update from CVS
- Merge from emacs--rel--22
- Update from CVS: lisp/emacs-lisp/avl-tree.el: New file.
- Remove RCS keywords
* emacs--rel--22 (patch 97-100)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 246-247)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-252
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 29 Aug 2007 05:03:40 +0000 |
parents | 539530fa389c 6e5814967ffb |
children | bdb3fe0ba9fa |
comparison
equal
deleted
inserted
replaced
91014:2392e6a45952 | 91015:b83d0dadb2a7 |
---|---|
28 ;; Most of them are displaced from tramp.el. | 28 ;; Most of them are displaced from tramp.el. |
29 | 29 |
30 ;;; Code: | 30 ;;; Code: |
31 | 31 |
32 (require 'tramp) | 32 (require 'tramp) |
33 (autoload 'tramp-set-connection-property "tramp-cache") | |
33 | 34 |
34 (eval-when-compile (require 'custom)) | 35 (eval-when-compile (require 'custom)) |
35 | 36 |
36 ;; Disable Ange-FTP from file-name-handler-alist. | 37 ;; Disable Ange-FTP from file-name-handler-alist. |
37 ;; To handle EFS, the following functions need to be dealt with: | 38 ;; To handle EFS, the following functions need to be dealt with: |
135 ;; "ftp" method is used in the Tramp file name. So we unset | 136 ;; "ftp" method is used in the Tramp file name. So we unset |
136 ;; those values. | 137 ;; those values. |
137 (ange-ftp-ftp-name-arg "") | 138 (ange-ftp-ftp-name-arg "") |
138 (ange-ftp-ftp-name-res nil)) | 139 (ange-ftp-ftp-name-res nil)) |
139 (cond | 140 (cond |
140 ;; If argument is a symlink, `file-directory-p' and `file-exists-p' | 141 ;; If argument is a symlink, `file-directory-p' and |
141 ;; call the traversed file recursively. So we cannot disable the | 142 ;; `file-exists-p' call the traversed file recursively. So we |
142 ;; file-name-handler this case. | 143 ;; cannot disable the file-name-handler this case. We set the |
144 ;; connection property "started" in order to put the remote | |
145 ;; location into the cache, which is helpful for further | |
146 ;; completion. | |
143 ((memq operation '(file-directory-p file-exists-p)) | 147 ((memq operation '(file-directory-p file-exists-p)) |
144 (apply 'ange-ftp-hook-function operation args)) | 148 (if (apply 'ange-ftp-hook-function operation args) |
145 ;; Normally, the handlers must be discarded | 149 (with-parsed-tramp-file-name (car args) nil |
146 (t (let* ((inhibit-file-name-handlers | 150 (tramp-set-connection-property v "started" t)) |
147 (list 'tramp-file-name-handler | 151 nil)) |
148 'tramp-completion-file-name-handler | 152 ;; Normally, the handlers must be discarded. |
149 (and (eq inhibit-file-name-operation operation) | 153 (t (let* ((inhibit-file-name-handlers |
150 inhibit-file-name-handlers))) | 154 (list 'tramp-file-name-handler |
151 (inhibit-file-name-operation operation)) | 155 'tramp-completion-file-name-handler |
152 (apply 'ange-ftp-hook-function operation args))))))) | 156 (and (eq inhibit-file-name-operation operation) |
157 inhibit-file-name-handlers))) | |
158 (inhibit-file-name-operation operation)) | |
159 (apply 'ange-ftp-hook-function operation args))))))) | |
153 | 160 |
154 (defun tramp-ftp-file-name-p (filename) | 161 (defun tramp-ftp-file-name-p (filename) |
155 "Check if it's a filename that should be forwarded to Ange-FTP." | 162 "Check if it's a filename that should be forwarded to Ange-FTP." |
156 (let ((v (tramp-dissect-file-name filename))) | 163 (let ((v (tramp-dissect-file-name filename))) |
157 (string= (tramp-file-name-method v) tramp-ftp-method))) | 164 (string= (tramp-file-name-method v) tramp-ftp-method))) |