diff options
| author | Michael Albinus | 2017-11-29 09:37:42 +0100 |
|---|---|---|
| committer | Michael Albinus | 2017-11-29 09:37:42 +0100 |
| commit | 3dd25aeecb157d562f8ab3c3abca9f3f89dec7ae (patch) | |
| tree | c23d07dceba61d5b90e311360024425961a2a528 /lisp | |
| parent | d670a15f254e2f077fa528b3e76d31d2ca415e69 (diff) | |
| download | emacs-3dd25aeecb157d562f8ab3c3abca9f3f89dec7ae.tar.gz emacs-3dd25aeecb157d562f8ab3c3abca9f3f89dec7ae.zip | |
Some minor Tramp corrections
* lisp/net/tramp.el (tramp-handle-directory-file-name):
Handle several trailing slashes correctly.
(tramp-handle-file-selinux-context): New defun.
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Use `tramp-handle-file-selinux-context'.
* test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name):
Extend test.
(tramp-test17-insert-directory): Make check more robust.
(tramp-test42-auto-load): Combine several let forms.
(tramp-test42-delay-load, tramp-test42-recursive-load)
(tramp-test42-remote-load-path, tramp-test43-unload): Rename.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/net/tramp-adb.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 20 |
4 files changed, 15 insertions, 11 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index bf21db2e8d8..8399c02923d 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -137,7 +137,7 @@ It is used for TCP/IP devices." | |||
| 137 | (file-readable-p . tramp-handle-file-exists-p) | 137 | (file-readable-p . tramp-handle-file-exists-p) |
| 138 | (file-regular-p . tramp-handle-file-regular-p) | 138 | (file-regular-p . tramp-handle-file-regular-p) |
| 139 | (file-remote-p . tramp-handle-file-remote-p) | 139 | (file-remote-p . tramp-handle-file-remote-p) |
| 140 | (file-selinux-context . ignore) | 140 | (file-selinux-context . tramp-handle-file-selinux-context) |
| 141 | (file-symlink-p . tramp-handle-file-symlink-p) | 141 | (file-symlink-p . tramp-handle-file-symlink-p) |
| 142 | (file-system-info . tramp-adb-handle-file-system-info) | 142 | (file-system-info . tramp-adb-handle-file-system-info) |
| 143 | (file-truename . tramp-adb-handle-file-truename) | 143 | (file-truename . tramp-adb-handle-file-truename) |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 404af983b50..fe5a98909e0 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -517,7 +517,7 @@ Every entry is a list (NAME ADDRESS).") | |||
| 517 | (file-readable-p . tramp-gvfs-handle-file-readable-p) | 517 | (file-readable-p . tramp-gvfs-handle-file-readable-p) |
| 518 | (file-regular-p . tramp-handle-file-regular-p) | 518 | (file-regular-p . tramp-handle-file-regular-p) |
| 519 | (file-remote-p . tramp-handle-file-remote-p) | 519 | (file-remote-p . tramp-handle-file-remote-p) |
| 520 | (file-selinux-context . ignore) | 520 | (file-selinux-context . tramp-handle-file-selinux-context) |
| 521 | (file-symlink-p . tramp-handle-file-symlink-p) | 521 | (file-symlink-p . tramp-handle-file-symlink-p) |
| 522 | (file-system-info . tramp-gvfs-handle-file-system-info) | 522 | (file-system-info . tramp-gvfs-handle-file-system-info) |
| 523 | (file-truename . tramp-handle-file-truename) | 523 | (file-truename . tramp-handle-file-truename) |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index f35c10b58ab..eb0d6b50731 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -253,7 +253,7 @@ See `tramp-actions-before-shell' for more info.") | |||
| 253 | (file-readable-p . tramp-handle-file-exists-p) | 253 | (file-readable-p . tramp-handle-file-exists-p) |
| 254 | (file-regular-p . tramp-handle-file-regular-p) | 254 | (file-regular-p . tramp-handle-file-regular-p) |
| 255 | (file-remote-p . tramp-handle-file-remote-p) | 255 | (file-remote-p . tramp-handle-file-remote-p) |
| 256 | ;; `file-selinux-context' performed by default handler. | 256 | (file-selinux-context . tramp-handle-file-selinux-context) |
| 257 | (file-symlink-p . tramp-handle-file-symlink-p) | 257 | (file-symlink-p . tramp-handle-file-symlink-p) |
| 258 | (file-system-info . tramp-smb-handle-file-system-info) | 258 | (file-system-info . tramp-smb-handle-file-system-info) |
| 259 | (file-truename . tramp-handle-file-truename) | 259 | (file-truename . tramp-handle-file-truename) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 13277ec6f34..6b0b1da6eb6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -2937,14 +2937,13 @@ User is always nil." | |||
| 2937 | "Like `directory-file-name' for Tramp files." | 2937 | "Like `directory-file-name' for Tramp files." |
| 2938 | ;; If localname component of filename is "/", leave it unchanged. | 2938 | ;; If localname component of filename is "/", leave it unchanged. |
| 2939 | ;; Otherwise, remove any trailing slash from localname component. | 2939 | ;; Otherwise, remove any trailing slash from localname component. |
| 2940 | ;; Method, host, etc, are unchanged. Does it make sense to try | 2940 | ;; Method, host, etc, are unchanged. |
| 2941 | ;; to avoid parsing the filename? | 2941 | (while (with-parsed-tramp-file-name directory nil |
| 2942 | (with-parsed-tramp-file-name directory nil | 2942 | (and (not (zerop (length localname))) |
| 2943 | (if (and (not (zerop (length localname))) | 2943 | (eq (aref localname (1- (length localname))) ?/) |
| 2944 | (eq (aref localname (1- (length localname))) ?/) | 2944 | (not (string= localname "/")))) |
| 2945 | (not (string= localname "/"))) | 2945 | (setq directory (substring directory 0 -1))) |
| 2946 | (substring directory 0 -1) | 2946 | directory) |
| 2947 | directory))) | ||
| 2948 | 2947 | ||
| 2949 | (defun tramp-handle-directory-files (directory &optional full match nosort) | 2948 | (defun tramp-handle-directory-files (directory &optional full match nosort) |
| 2950 | "Like `directory-files' for Tramp files." | 2949 | "Like `directory-files' for Tramp files." |
| @@ -3172,6 +3171,11 @@ User is always nil." | |||
| 3172 | (t (tramp-make-tramp-file-name | 3171 | (t (tramp-make-tramp-file-name |
| 3173 | method user domain host port "" hop))))))))) | 3172 | method user domain host port "" hop))))))))) |
| 3174 | 3173 | ||
| 3174 | (defun tramp-handle-file-selinux-context (_filename) | ||
| 3175 | "Like `file-selinux-context' for Tramp files." | ||
| 3176 | ;; Return nil context. | ||
| 3177 | '(nil nil nil nil)) | ||
| 3178 | |||
| 3175 | (defun tramp-handle-file-symlink-p (filename) | 3179 | (defun tramp-handle-file-symlink-p (filename) |
| 3176 | "Like `file-symlink-p' for Tramp files." | 3180 | "Like `file-symlink-p' for Tramp files." |
| 3177 | (let ((x (tramp-compat-file-attribute-type (file-attributes filename)))) | 3181 | (let ((x (tramp-compat-file-attribute-type (file-attributes filename)))) |