aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2011-10-25 14:50:03 +0200
committerMichael Albinus2011-10-25 14:50:03 +0200
commit3f04efd64d76ea897cb3b27f971777c66042a23b (patch)
tree3d118a1d47e30e4721198f9f6358523efffce5e1
parent81a0a2681d063e0282f91ac91883ca2a06c529db (diff)
downloademacs-3f04efd64d76ea897cb3b27f971777c66042a23b.tar.gz
emacs-3f04efd64d76ea897cb3b27f971777c66042a23b.zip
* net/tramp-sh.el (tramp-sh-handle-file-directory-p): Return t for
filenames "/method:foo:".
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/tramp-sh.el17
2 files changed, 12 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 32e46b2c172..95113007f27 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-10-25 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-sh.el (tramp-sh-handle-file-directory-p): Return t for
4 filenames "/method:foo:".
5
12011-10-25 Stefan Monnier <monnier@iro.umontreal.ca> 62011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * comint.el (comint-get-old-input-default): Fix use-prompt-regexp case 8 * comint.el (comint-get-old-input-default): Fix use-prompt-regexp case
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 56424f79476..55732194bc8 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1594,17 +1594,14 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1594 1594
1595(defun tramp-sh-handle-file-directory-p (filename) 1595(defun tramp-sh-handle-file-directory-p (filename)
1596 "Like `file-directory-p' for Tramp files." 1596 "Like `file-directory-p' for Tramp files."
1597 ;; Care must be taken that this function returns `t' for symlinks
1598 ;; pointing to directories. Surely the most obvious implementation
1599 ;; would be `test -d', but that returns false for such symlinks.
1600 ;; CCC: Stefan Monnier says that `test -d' follows symlinks. And
1601 ;; I now think he's right. So we could be using `test -d', couldn't
1602 ;; we?
1603 ;;
1604 ;; Alternatives: `cd %s', `test -d %s'
1605 (with-parsed-tramp-file-name filename nil 1597 (with-parsed-tramp-file-name filename nil
1606 (with-file-property v localname "file-directory-p" 1598 ;; `file-directory-p' is used as predicate for filename completion.
1607 (tramp-run-test "-d" filename)))) 1599 ;; Sometimes, when a connection is not established yet, it is
1600 ;; desirable to return t immediately for "/method:foo:". It can
1601 ;; be expected that this is always a directory.
1602 (or (zerop (length localname))
1603 (with-file-property v localname "file-directory-p"
1604 (tramp-run-test "-d" filename)))))
1608 1605
1609(defun tramp-sh-handle-file-writable-p (filename) 1606(defun tramp-sh-handle-file-writable-p (filename)
1610 "Like `file-writable-p' for Tramp files." 1607 "Like `file-writable-p' for Tramp files."