aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2017-09-11 17:12:32 +0200
committerMichael Albinus2017-09-11 17:12:32 +0200
commit7004545244ea5efbe7a37db72431f982c70576e6 (patch)
treece64bd36195091d72a4a2ef86eb80d624be4fcc5 /test
parent29963648dd11d53088f753e4f9b0491a7b981c0f (diff)
downloademacs-7004545244ea5efbe7a37db72431f982c70576e6.tar.gz
emacs-7004545244ea5efbe7a37db72431f982c70576e6.zip
Further optimization in Tramp's file name decomposition
* lisp/net/tramp.el (tramp-syntax): Recompute all file name components. Call `custom-set-variables' after loading. (tramp-build-prefix-format, tramp-build-prefix-regexp) (tramp-build-method-regexp) (tramp-build-postfix-method-format) (tramp-build-postfix-method-regexp) (tramp-build-prefix-ipv6-format) (tramp-build-prefix-ipv6-regexp) (tramp-build-postfix-ipv6-format) (tramp-build-postfix-ipv6-regexp) (tramp-build-postfix-host-format) (tramp-build-postfix-host-regexp) (tramp-build-file-name-regexp) (tramp-build-completion-file-name-regexp): New defuns. (tramp-prefix-format, tramp-prefix-regexp) (tramp-method-regexp, tramp-postfix-method-format) (tramp-postfix-method-regexp, tramp-prefix-ipv6-format) (tramp-prefix-ipv6-regexp, tramp-postfix-ipv6-format) (tramp-postfix-ipv6-regexp, tramp-postfix-host-format) (tramp-postfix-host-regexp) (tramp-remote-file-name-spec-regexp) (tramp-file-name-structure, tramp-file-name-regexp) (tramp-completion-file-name-regexp): Convert defuns into defvars. (tramp-prefix-regexp-alist) (tramp-postfix-method-regexp-alist) (tramp-prefix-ipv6-regexp-alist) (tramp-postfix-ipv6-regexp-alist) (tramp-postfix-host-regexp-alist) (tramp-remote-file-name-spec-regexp-alist): Remove. (tramp-build-remote-file-name-spec-regexp) (tramp-build-file-name-structure): Simplify. (tramp-completion-file-name-regexp-alist): New defconst. (tramp-tramp-file-p, tramp-dissect-file-name) (tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name) (tramp-rfn-eshadow-update-overlay-regexp) (tramp-register-file-name-handlers) (tramp-completion-handle-file-name-all-completions) (tramp-completion-dissect-file-name, tramp-clear-passwd): * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler): * lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered) (tramp-compute-multi-hops): Use variables but functions for file name components. * test/lisp/net/tramp-tests.el (tramp-test24-file-name-completion): Use variables but functions for file name components.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 4139d50ff01..13e2e30cab4 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -2852,16 +2852,16 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
2852 (tramp-change-syntax syntax) 2852 (tramp-change-syntax syntax)
2853 (let ;; This is needed for the `simplified' syntax. 2853 (let ;; This is needed for the `simplified' syntax.
2854 ((method-marker 2854 ((method-marker
2855 (if (zerop (length (tramp-method-regexp))) 2855 (if (zerop (length tramp-method-regexp))
2856 "" tramp-default-method-marker)) 2856 "" tramp-default-method-marker))
2857 ;; This is needed for the `separate' syntax. 2857 ;; This is needed for the `separate' syntax.
2858 (prefix-format (substring (tramp-prefix-format) 1))) 2858 (prefix-format (substring tramp-prefix-format 1)))
2859 ;; Complete method name. 2859 ;; Complete method name.
2860 (unless (or (zerop (length method)) 2860 (unless (or (zerop (length method))
2861 (zerop (length (tramp-method-regexp)))) 2861 (zerop (length tramp-method-regexp)))
2862 (should 2862 (should
2863 (member 2863 (member
2864 (concat prefix-format method (tramp-postfix-method-format)) 2864 (concat prefix-format method tramp-postfix-method-format)
2865 (file-name-all-completions 2865 (file-name-all-completions
2866 (concat prefix-format (substring method 0 1)) "/")))) 2866 (concat prefix-format (substring method 0 1)) "/"))))
2867 ;; Complete host name for default method. With gvfs 2867 ;; Complete host name for default method. With gvfs
@@ -2873,25 +2873,25 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
2873 (should 2873 (should
2874 (member 2874 (member
2875 (concat 2875 (concat
2876 prefix-format method-marker (tramp-postfix-method-format) 2876 prefix-format method-marker tramp-postfix-method-format
2877 host (tramp-postfix-host-format)) 2877 host tramp-postfix-host-format)
2878 (file-name-all-completions 2878 (file-name-all-completions
2879 (concat 2879 (concat
2880 prefix-format method-marker (tramp-postfix-method-format) 2880 prefix-format method-marker tramp-postfix-method-format
2881 (substring host 0 1)) 2881 (substring host 0 1))
2882 "/"))))) 2882 "/")))))
2883 ;; Complete host name. 2883 ;; Complete host name.
2884 (unless (or (zerop (length method)) 2884 (unless (or (zerop (length method))
2885 (zerop (length (tramp-method-regexp))) 2885 (zerop (length tramp-method-regexp))
2886 (zerop (length host)) 2886 (zerop (length host))
2887 (tramp--test-gvfs-p method)) 2887 (tramp--test-gvfs-p method))
2888 (should 2888 (should
2889 (member 2889 (member
2890 (concat 2890 (concat
2891 prefix-format method (tramp-postfix-method-format) 2891 prefix-format method tramp-postfix-method-format
2892 host (tramp-postfix-host-format)) 2892 host tramp-postfix-host-format)
2893 (file-name-all-completions 2893 (file-name-all-completions
2894 (concat prefix-format method (tramp-postfix-method-format)) 2894 (concat prefix-format method tramp-postfix-method-format)
2895 "/")))))) 2895 "/"))))))
2896 2896
2897 ;; Cleanup. 2897 ;; Cleanup.