diff options
| -rw-r--r-- | doc/lispref/files.texi | 4 | ||||
| -rw-r--r-- | lisp/net/tramp-adb.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 8 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 53 |
6 files changed, 62 insertions, 6 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 70c7177e064..e189da9fbe2 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -1154,7 +1154,9 @@ on Mac OS X. | |||
| 1154 | Currently this function always returns @code{nil} on platforms other | 1154 | Currently this function always returns @code{nil} on platforms other |
| 1155 | than MS-DOS, MS-Windows, Cygwin, and Mac OS X. It does not detect | 1155 | than MS-DOS, MS-Windows, Cygwin, and Mac OS X. It does not detect |
| 1156 | case-insensitivity of mounted filesystems, such as Samba shares or | 1156 | case-insensitivity of mounted filesystems, such as Samba shares or |
| 1157 | NFS-mounted Windows volumes. | 1157 | NFS-mounted Windows volumes. On remote hosts, it assumes @code{t} for |
| 1158 | the @samp{smb} method. For all other connection methods, runtime | ||
| 1159 | tests are performed. | ||
| 1158 | @end defun | 1160 | @end defun |
| 1159 | 1161 | ||
| 1160 | @defun file-in-directory-p file dir | 1162 | @defun file-in-directory-p file dir |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 1aae0ecfffd..f03f50bb009 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -126,6 +126,7 @@ It is used for TCP/IP devices." | |||
| 126 | (file-modes . tramp-handle-file-modes) | 126 | (file-modes . tramp-handle-file-modes) |
| 127 | (file-name-all-completions . tramp-adb-handle-file-name-all-completions) | 127 | (file-name-all-completions . tramp-adb-handle-file-name-all-completions) |
| 128 | (file-name-as-directory . tramp-handle-file-name-as-directory) | 128 | (file-name-as-directory . tramp-handle-file-name-as-directory) |
| 129 | (file-name-case-insensitive-p . tramp-handle-file-name-case-insensitive-p) | ||
| 129 | (file-name-completion . tramp-handle-file-name-completion) | 130 | (file-name-completion . tramp-handle-file-name-completion) |
| 130 | (file-name-directory . tramp-handle-file-name-directory) | 131 | (file-name-directory . tramp-handle-file-name-directory) |
| 131 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) | 132 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index a84097cfc4d..d87de467c67 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -480,6 +480,7 @@ Every entry is a list (NAME ADDRESS).") | |||
| 480 | (file-modes . tramp-handle-file-modes) | 480 | (file-modes . tramp-handle-file-modes) |
| 481 | (file-name-all-completions . tramp-gvfs-handle-file-name-all-completions) | 481 | (file-name-all-completions . tramp-gvfs-handle-file-name-all-completions) |
| 482 | (file-name-as-directory . tramp-handle-file-name-as-directory) | 482 | (file-name-as-directory . tramp-handle-file-name-as-directory) |
| 483 | (file-name-case-insensitive-p . tramp-handle-file-name-case-insensitive-p) | ||
| 483 | (file-name-completion . tramp-handle-file-name-completion) | 484 | (file-name-completion . tramp-handle-file-name-completion) |
| 484 | (file-name-directory . tramp-handle-file-name-directory) | 485 | (file-name-directory . tramp-handle-file-name-directory) |
| 485 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) | 486 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 1682b16fe02..9496ebf7563 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -1027,6 +1027,7 @@ of command line.") | |||
| 1027 | (file-modes . tramp-handle-file-modes) | 1027 | (file-modes . tramp-handle-file-modes) |
| 1028 | (file-name-all-completions . tramp-sh-handle-file-name-all-completions) | 1028 | (file-name-all-completions . tramp-sh-handle-file-name-all-completions) |
| 1029 | (file-name-as-directory . tramp-handle-file-name-as-directory) | 1029 | (file-name-as-directory . tramp-handle-file-name-as-directory) |
| 1030 | (file-name-case-insensitive-p . tramp-handle-file-name-case-insensitive-p) | ||
| 1030 | (file-name-completion . tramp-handle-file-name-completion) | 1031 | (file-name-completion . tramp-handle-file-name-completion) |
| 1031 | (file-name-directory . tramp-handle-file-name-directory) | 1032 | (file-name-directory . tramp-handle-file-name-directory) |
| 1032 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) | 1033 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 7c600702cae..61796a25bb3 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -49,7 +49,9 @@ | |||
| 49 | ;; This is just a guess. We don't know whether the share "C$" | 49 | ;; This is just a guess. We don't know whether the share "C$" |
| 50 | ;; is available for public use, and whether the user has write | 50 | ;; is available for public use, and whether the user has write |
| 51 | ;; access. | 51 | ;; access. |
| 52 | (tramp-tmpdir "/C$/Temp")))) | 52 | (tramp-tmpdir "/C$/Temp") |
| 53 | ;; Another guess. We might implement a better check later on. | ||
| 54 | (tramp-case-insensitive t)))) | ||
| 53 | 55 | ||
| 54 | ;; Add a default for `tramp-default-method-alist'. Rule: If there is | 56 | ;; Add a default for `tramp-default-method-alist'. Rule: If there is |
| 55 | ;; a domain in USER, it must be the SMB method. | 57 | ;; a domain in USER, it must be the SMB method. |
| @@ -243,6 +245,7 @@ See `tramp-actions-before-shell' for more info.") | |||
| 243 | (file-modes . tramp-handle-file-modes) | 245 | (file-modes . tramp-handle-file-modes) |
| 244 | (file-name-all-completions . tramp-smb-handle-file-name-all-completions) | 246 | (file-name-all-completions . tramp-smb-handle-file-name-all-completions) |
| 245 | (file-name-as-directory . tramp-handle-file-name-as-directory) | 247 | (file-name-as-directory . tramp-handle-file-name-as-directory) |
| 248 | (file-name-case-insensitive-p . tramp-handle-file-name-case-insensitive-p) | ||
| 246 | (file-name-completion . tramp-handle-file-name-completion) | 249 | (file-name-completion . tramp-handle-file-name-completion) |
| 247 | (file-name-directory . tramp-handle-file-name-directory) | 250 | (file-name-directory . tramp-handle-file-name-directory) |
| 248 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) | 251 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) |
| @@ -501,7 +504,8 @@ pass to the OPERATION." | |||
| 501 | ;; target. | 504 | ;; target. |
| 502 | (make-directory | 505 | (make-directory |
| 503 | (expand-file-name | 506 | (expand-file-name |
| 504 | ".." (concat tmpdir localname)) 'parents) | 507 | ".." (concat tmpdir localname)) |
| 508 | 'parents) | ||
| 505 | (make-symbolic-link | 509 | (make-symbolic-link |
| 506 | newname (directory-file-name (concat tmpdir localname)))) | 510 | newname (directory-file-name (concat tmpdir localname)))) |
| 507 | 511 | ||
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5d56fdf1104..b0391ec7714 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -255,6 +255,11 @@ pair of the form (KEY VALUE). The following KEYs are defined: | |||
| 255 | In general, the global default value shall be used, but for | 255 | In general, the global default value shall be used, but for |
| 256 | some methods, like \"su\" or \"sudo\", a shorter timeout | 256 | some methods, like \"su\" or \"sudo\", a shorter timeout |
| 257 | might be desirable. | 257 | might be desirable. |
| 258 | * `tramp-case-insensitive' | ||
| 259 | Whether the remote file system handles file names case insensitive. | ||
| 260 | Only a non-nil value counts, the default value nil means to | ||
| 261 | perform further checks on the remote host. See | ||
| 262 | `tramp-connection-properties' for a way to overwrite this. | ||
| 258 | 263 | ||
| 259 | What does all this mean? Well, you should specify `tramp-login-program' | 264 | What does all this mean? Well, you should specify `tramp-login-program' |
| 260 | for all methods; this program is used to log in to the remote site. Then, | 265 | for all methods; this program is used to log in to the remote site. Then, |
| @@ -1919,8 +1924,7 @@ ARGS are the arguments OPERATION has been called with." | |||
| 1919 | file-accessible-directory-p file-attributes | 1924 | file-accessible-directory-p file-attributes |
| 1920 | file-directory-p file-executable-p file-exists-p | 1925 | file-directory-p file-executable-p file-exists-p |
| 1921 | file-local-copy file-modes | 1926 | file-local-copy file-modes |
| 1922 | file-name-as-directory file-name-case-insensitive-p | 1927 | file-name-as-directory file-name-directory |
| 1923 | file-name-directory | ||
| 1924 | file-name-nondirectory file-name-sans-versions | 1928 | file-name-nondirectory file-name-sans-versions |
| 1925 | file-ownership-preserved-p file-readable-p | 1929 | file-ownership-preserved-p file-readable-p |
| 1926 | file-regular-p file-remote-p file-symlink-p file-truename | 1930 | file-regular-p file-remote-p file-symlink-p file-truename |
| @@ -1931,7 +1935,9 @@ ARGS are the arguments OPERATION has been called with." | |||
| 1931 | unhandled-file-name-directory vc-registered | 1935 | unhandled-file-name-directory vc-registered |
| 1932 | ;; Emacs 24+ only. | 1936 | ;; Emacs 24+ only. |
| 1933 | file-acl file-notify-add-watch file-selinux-context | 1937 | file-acl file-notify-add-watch file-selinux-context |
| 1934 | set-file-acl set-file-selinux-context)) | 1938 | set-file-acl set-file-selinux-context |
| 1939 | ;; Emacs 26+ only. | ||
| 1940 | file-name-case-insensitive-p)) | ||
| 1935 | (if (file-name-absolute-p (nth 0 args)) | 1941 | (if (file-name-absolute-p (nth 0 args)) |
| 1936 | (nth 0 args) | 1942 | (nth 0 args) |
| 1937 | (expand-file-name (nth 0 args)))) | 1943 | (expand-file-name (nth 0 args)))) |
| @@ -2888,6 +2894,47 @@ User is always nil." | |||
| 2888 | 'file-name-as-directory (list (or (tramp-file-name-localname v) "")))) | 2894 | 'file-name-as-directory (list (or (tramp-file-name-localname v) "")))) |
| 2889 | (tramp-file-name-hop v)))) | 2895 | (tramp-file-name-hop v)))) |
| 2890 | 2896 | ||
| 2897 | (defun tramp-handle-file-name-case-insensitive-p (filename) | ||
| 2898 | "Like `file-name-case-insensitive-p' for Tramp files." | ||
| 2899 | ;; We make it a connection property, assuming that all file systems | ||
| 2900 | ;; on the remote host behave similar. This might be wrong for | ||
| 2901 | ;; mounted NFS directories or SMB/AFP shares; such more granular | ||
| 2902 | ;; tests will be added in case they are needed. | ||
| 2903 | (setq filename (expand-file-name filename)) | ||
| 2904 | (with-parsed-tramp-file-name filename nil | ||
| 2905 | (or ;; Maybe there is a default value. | ||
| 2906 | (tramp-get-method-parameter v 'tramp-case-insensitive) | ||
| 2907 | |||
| 2908 | ;; There isn't. So we must check. | ||
| 2909 | (with-tramp-connection-property v "case-insensitive" | ||
| 2910 | ;; The idea is to compare a file with lower case letters with | ||
| 2911 | ;; the same file with upper case letters. | ||
| 2912 | (let ((candidate (directory-file-name filename)) | ||
| 2913 | tmpfile) | ||
| 2914 | ;; Check, whether we find an existing file with lower case | ||
| 2915 | ;; letters. This avoids us to create a temporary file. | ||
| 2916 | (while (and (string-match "[a-z]" (file-remote-p candidate 'localname)) | ||
| 2917 | (not (file-exists-p candidate))) | ||
| 2918 | (setq candidate | ||
| 2919 | (directory-file-name (file-name-directory candidate)))) | ||
| 2920 | ;; Nothing found, so we must use a temporary file for | ||
| 2921 | ;; comparision. `make-nearby-temp-file' is added to Emacs | ||
| 2922 | ;; 26+ like `file-name-case-insensitive-p', so there is no | ||
| 2923 | ;; compatibility problem calling it. | ||
| 2924 | (unless (string-match "[a-z]" (file-remote-p candidate 'localname)) | ||
| 2925 | (setq tmpfile | ||
| 2926 | (let ((default-directory (file-name-directory filename))) | ||
| 2927 | (tramp-compat-funcall 'make-nearby-temp-file "tramp.")) | ||
| 2928 | candidate tmpfile)) | ||
| 2929 | ;; Check for the existence of the same file with upper case letters. | ||
| 2930 | (unwind-protect | ||
| 2931 | (file-exists-p | ||
| 2932 | (concat | ||
| 2933 | (file-remote-p candidate) | ||
| 2934 | (upcase (file-remote-p candidate 'localname)))) | ||
| 2935 | ;; Cleanup. | ||
| 2936 | (when tmpfile (delete-file tmpfile)))))))) | ||
| 2937 | |||
| 2891 | (defun tramp-handle-file-name-completion | 2938 | (defun tramp-handle-file-name-completion |
| 2892 | (filename directory &optional predicate) | 2939 | (filename directory &optional predicate) |
| 2893 | "Like `file-name-completion' for Tramp files." | 2940 | "Like `file-name-completion' for Tramp files." |