* net/tramp.el (tramp-find-foreign-file-name-handler): Check also

host.
(tramp-maybe-send-script): Apply `member' but `memq'.
(tramp-advice-file-expand-wildcards): Simplify implementation.
This commit is contained in:
Michael Albinus 2007-10-08 20:07:16 +00:00
parent 8ea4c22f84
commit 1834b39f16
2 changed files with 22 additions and 12 deletions

View file

@ -1,3 +1,10 @@
2007-10-08 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-find-foreign-file-name-handler): Check also
host.
(tramp-maybe-send-script): Apply `member' but `memq'.
(tramp-advice-file-expand-wildcards): Simplify implementation.
2007-10-08 Juanma Barranquero <lekktu@gmail.com> 2007-10-08 Juanma Barranquero <lekktu@gmail.com>
* follow.el (follow-mode): Don't run hooks twice. Use `when'. * follow.el (follow-mode): Don't run hooks twice. Use `when'.

View file

@ -2140,9 +2140,9 @@ target of the symlink differ."
;; If FILENAME is a Tramp name, use just the localname component. ;; If FILENAME is a Tramp name, use just the localname component.
(when (tramp-tramp-file-p filename) (when (tramp-tramp-file-p filename)
(setq filename (tramp-file-name-localname (setq filename
(tramp-dissect-file-name (tramp-file-name-localname
(expand-file-name filename))))) (tramp-dissect-file-name (expand-file-name filename)))))
;; Right, they are on the same host, regardless of user, method, etc. ;; Right, they are on the same host, regardless of user, method, etc.
;; We now make the link on the remote machine. This will occur as the user ;; We now make the link on the remote machine. This will occur as the user
@ -4352,6 +4352,9 @@ ARGS are the arguments OPERATION has been called with."
;; When we are not fully sure that filename completion is safe, ;; When we are not fully sure that filename completion is safe,
;; we should not return a handler. ;; we should not return a handler.
(when (or (tramp-file-name-method v) (tramp-file-name-user v) (when (or (tramp-file-name-method v) (tramp-file-name-user v)
(and (tramp-file-name-host v)
(not (member (tramp-file-name-host v)
(mapcar 'car tramp-methods))))
(not (tramp-completion-mode-p))) (not (tramp-completion-mode-p)))
(while handler (while handler
(setq elt (car handler) (setq elt (car handler)
@ -5116,7 +5119,7 @@ User is always nil."
Only send the definition if it has not already been done." Only send the definition if it has not already been done."
(let* ((p (tramp-get-connection-process vec)) (let* ((p (tramp-get-connection-process vec))
(scripts (tramp-get-connection-property p "scripts" nil))) (scripts (tramp-get-connection-property p "scripts" nil)))
(unless (memq name scripts) (unless (member name scripts)
(tramp-message vec 5 "Sending script `%s'..." name) (tramp-message vec 5 "Sending script `%s'..." name)
;; The script could contain a call of Perl. This is masked with `%s'. ;; The script could contain a call of Perl. This is masked with `%s'.
(tramp-send-command-and-check (tramp-send-command-and-check
@ -7193,19 +7196,19 @@ Only works for Bourne-like shells."
;; CCC: This check is now also really awful; we should search all ;; CCC: This check is now also really awful; we should search all
;; of the filename format, not just the prefix. ;; of the filename format, not just the prefix.
(when (string-match "\\[" tramp-prefix-format) (when (string-match "\\[" tramp-prefix-format)
(defadvice file-expand-wildcards (around tramp-fix activate) (defadvice file-expand-wildcards
(around tramp-advice-file-expand-wildcards activate)
(let ((name (ad-get-arg 0))) (let ((name (ad-get-arg 0)))
(if (tramp-tramp-file-p name) (if (tramp-tramp-file-p name)
;; If it's a Tramp file, dissect it and look if wildcards ;; If it's a Tramp file, dissect it and look if wildcards
;; need to be expanded at all. ;; need to be expanded at all.
(let ((v (tramp-dissect-file-name name))) (if (string-match
(if (string-match "[[*?]" (tramp-file-name-localname v)) "[[*?]"
(let ((res ad-do-it)) (tramp-file-name-localname (tramp-dissect-file-name name)))
(setq ad-return-value (or res (list name)))) (setq ad-return-value (or ad-do-it (list name)))
(setq ad-return-value (list name)))) (setq ad-return-value (list name)))
;; If it is not a Tramp file, just run the original function. ;; If it is not a Tramp file, just run the original function.
(let ((res ad-do-it)) (setq ad-return-value (or ad-do-it (list name))))))
(setq ad-return-value (or res (list name)))))))
(add-hook 'tramp-unload-hook (add-hook 'tramp-unload-hook
'(lambda () (ad-unadvise 'file-expand-wildcards)))) '(lambda () (ad-unadvise 'file-expand-wildcards))))