94 |
(save-match-data |
(save-match-data |
95 |
(or (boundp 'ange-ftp-name-format) |
(or (boundp 'ange-ftp-name-format) |
96 |
(require 'ange-ftp)) |
(require 'ange-ftp)) |
97 |
(let* ((ange-ftp-name-format |
(let ((ange-ftp-name-format |
98 |
(list (nth 0 tramp-file-name-structure) |
(list (nth 0 tramp-file-name-structure) |
99 |
(nth 3 tramp-file-name-structure) |
(nth 3 tramp-file-name-structure) |
100 |
(nth 2 tramp-file-name-structure) |
(nth 2 tramp-file-name-structure) |
101 |
(nth 4 tramp-file-name-structure))) |
(nth 4 tramp-file-name-structure)))) |
102 |
(inhibit-file-name-handlers |
(cond |
103 |
(list 'tramp-file-name-handler |
;; If argument is a symlink, 'file-directory-p` and 'file-exists-p` |
104 |
'tramp-completion-file-name-handler |
;; call the traversed file recursively. So we cannot disable the |
105 |
(and (eq inhibit-file-name-operation operation) |
;;file-name-handler this case. |
106 |
inhibit-file-name-handlers))) |
((memq operation '(file-directory-p file-exists-p)) |
107 |
(inhibit-file-name-operation operation)) |
(apply 'ange-ftp-hook-function operation args)) |
108 |
(apply 'ange-ftp-hook-function operation args)))) |
;; Normally, the handlers must be discarded |
109 |
|
(t (let* ((inhibit-file-name-handlers |
110 |
|
(list 'tramp-file-name-handler |
111 |
|
'tramp-completion-file-name-handler |
112 |
|
(and (eq inhibit-file-name-operation operation) |
113 |
|
inhibit-file-name-handlers))) |
114 |
|
(inhibit-file-name-operation operation)) |
115 |
|
(apply 'ange-ftp-hook-function operation args))))))) |
116 |
|
|
117 |
(defun tramp-ftp-file-name-p (filename) |
(defun tramp-ftp-file-name-p (filename) |
118 |
"Check if it's a filename that should be forwarded to Ange-FTP." |
"Check if it's a filename that should be forwarded to Ange-FTP." |
134 |
|
|
135 |
;; * In case of "/ftp:host:file" this works only for functions which |
;; * In case of "/ftp:host:file" this works only for functions which |
136 |
;; are defined in `tramp-file-name-handler-alist'. Call has to be |
;; are defined in `tramp-file-name-handler-alist'. Call has to be |
137 |
;; pretended in `tramp-file-name-handler' otherwise. Looks like |
;; pretended in `tramp-file-name-handler' otherwise. |
138 |
;; `ange-ftp-completion-hook-function' and `ange-ftp-hook-function' |
;; Furthermore, there are no backup files on FTP hosts. |
|
;; are active temporarily in `file-name-handler-alist'. |
|
|
;; Furthermore, there are no backup files on FTP hosts this case. |
|
139 |
;; Worth further investigations. |
;; Worth further investigations. |
140 |
|
|
141 |
;;; tramp-ftp.el ends here |
;;; tramp-ftp.el ends here |