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 |
;; In 'ange-ftp-file-exists-p`, 'file-exists-p` is called in case of |
104 |
'tramp-completion-file-name-handler |
;; symlinks. So we cannot disable the file-name-handler this case. |
105 |
(and (eq inhibit-file-name-operation operation) |
((and |
106 |
inhibit-file-name-handlers))) |
(equal operation 'file-exists-p) |
107 |
(inhibit-file-name-operation operation)) |
(file-symlink-p (car args))) |
108 |
(apply 'ange-ftp-hook-function operation args)))) |
(apply 'ange-ftp-hook-function operation args)) |
109 |
|
;; Normally, the handlers must be discarded |
110 |
|
(t (let* ((inhibit-file-name-handlers |
111 |
|
(list 'tramp-file-name-handler |
112 |
|
'tramp-completion-file-name-handler |
113 |
|
(and (eq inhibit-file-name-operation operation) |
114 |
|
inhibit-file-name-handlers))) |
115 |
|
(inhibit-file-name-operation operation)) |
116 |
|
(apply 'ange-ftp-hook-function operation args))))))) |
117 |
|
|
118 |
(defun tramp-ftp-file-name-p (filename) |
(defun tramp-ftp-file-name-p (filename) |
119 |
"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." |