aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/net/tramp.el107
2 files changed, 35 insertions, 86 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cfee5834fe3..03352a93e6f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12013-09-06 Michael Albinus <michael.albinus@gmx.de>
2
3 Remove URL syntax.
4
5 * net/tramp.el (tramp-syntax, tramp-prefix-format)
6 (tramp-postfix-method-format, tramp-prefix-ipv6-format)
7 (tramp-postfix-ipv6-format, tramp-prefix-port-format)
8 (tramp-postfix-host-format, tramp-file-name-regexp)
9 (tramp-completion-file-name-regexp)
10 (tramp-completion-dissect-file-name)
11 (tramp-handle-substitute-in-file-name): Remove 'url case.
12 (tramp-file-name-regexp-url)
13 (tramp-completion-file-name-regexp-url): Remove constants.
14
12013-09-06 Glenn Morris <rgm@gnu.org> 152013-09-06 Glenn Morris <rgm@gnu.org>
2 16
3 * replace.el (replace-string): Doc fix re start/end. (Bug#15275) 17 * replace.el (replace-string): Doc fix re start/end. (Bug#15275)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 6c3ae376dc3..727536b2e10 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -690,7 +690,7 @@ Useful for \"rsync\" like methods.")
690;; Tramp only knows how to deal with `file-name-handler-alist', not 690;; Tramp only knows how to deal with `file-name-handler-alist', not
691;; the other places. 691;; the other places.
692 692
693;; Currently, we have the choice between 'ftp, 'sep, and 'url. 693;; Currently, we have the choice between 'ftp and 'sep.
694;;;###autoload 694;;;###autoload
695(defcustom tramp-syntax 695(defcustom tramp-syntax
696 (if (featurep 'xemacs) 'sep 'ftp) 696 (if (featurep 'xemacs) 'sep 'ftp)
@@ -699,20 +699,15 @@ Useful for \"rsync\" like methods.")
699It can have the following values: 699It can have the following values:
700 700
701 'ftp -- Ange-FTP respective EFS like syntax (GNU Emacs default) 701 'ftp -- Ange-FTP respective EFS like syntax (GNU Emacs default)
702 'sep -- Syntax as defined for XEmacs (not available yet for GNU Emacs) 702 'sep -- Syntax as defined for XEmacs."
703 'url -- URL-like syntax."
704 :group 'tramp 703 :group 'tramp
705 :type (if (featurep 'xemacs) 704 :version "24.4"
706 '(choice (const :tag "EFS" ftp) 705 :type `(choice (const :tag ,(if (featurep 'xemacs) "EFS" "Ange-FTP") ftp)
707 (const :tag "XEmacs" sep) 706 (const :tag "XEmacs" sep)))
708 (const :tag "URL" url))
709 '(choice (const :tag "Ange-FTP" ftp)
710 (const :tag "URL" url))))
711 707
712(defconst tramp-prefix-format 708(defconst tramp-prefix-format
713 (cond ((equal tramp-syntax 'ftp) "/") 709 (cond ((equal tramp-syntax 'ftp) "/")
714 ((equal tramp-syntax 'sep) "/[") 710 ((equal tramp-syntax 'sep) "/[")
715 ((equal tramp-syntax 'url) "/")
716 (t (error "Wrong `tramp-syntax' defined"))) 711 (t (error "Wrong `tramp-syntax' defined")))
717 "String matching the very beginning of Tramp file names. 712 "String matching the very beginning of Tramp file names.
718Used in `tramp-make-tramp-file-name'.") 713Used in `tramp-make-tramp-file-name'.")
@@ -729,7 +724,6 @@ Should always start with \"^\". Derived from `tramp-prefix-format'.")
729(defconst tramp-postfix-method-format 724(defconst tramp-postfix-method-format
730 (cond ((equal tramp-syntax 'ftp) ":") 725 (cond ((equal tramp-syntax 'ftp) ":")
731 ((equal tramp-syntax 'sep) "/") 726 ((equal tramp-syntax 'sep) "/")
732 ((equal tramp-syntax 'url) "://")
733 (t (error "Wrong `tramp-syntax' defined"))) 727 (t (error "Wrong `tramp-syntax' defined")))
734 "String matching delimiter between method and user or host names. 728 "String matching delimiter between method and user or host names.
735Used in `tramp-make-tramp-file-name'.") 729Used in `tramp-make-tramp-file-name'.")
@@ -776,7 +770,6 @@ Derived from `tramp-postfix-user-format'.")
776(defconst tramp-prefix-ipv6-format 770(defconst tramp-prefix-ipv6-format
777 (cond ((equal tramp-syntax 'ftp) "[") 771 (cond ((equal tramp-syntax 'ftp) "[")
778 ((equal tramp-syntax 'sep) "") 772 ((equal tramp-syntax 'sep) "")
779 ((equal tramp-syntax 'url) "[")
780 (t (error "Wrong `tramp-syntax' defined"))) 773 (t (error "Wrong `tramp-syntax' defined")))
781 "String matching left hand side of IPv6 addresses. 774 "String matching left hand side of IPv6 addresses.
782Used in `tramp-make-tramp-file-name'.") 775Used in `tramp-make-tramp-file-name'.")
@@ -796,7 +789,6 @@ Derived from `tramp-prefix-ipv6-format'.")
796(defconst tramp-postfix-ipv6-format 789(defconst tramp-postfix-ipv6-format
797 (cond ((equal tramp-syntax 'ftp) "]") 790 (cond ((equal tramp-syntax 'ftp) "]")
798 ((equal tramp-syntax 'sep) "") 791 ((equal tramp-syntax 'sep) "")
799 ((equal tramp-syntax 'url) "]")
800 (t (error "Wrong `tramp-syntax' defined"))) 792 (t (error "Wrong `tramp-syntax' defined")))
801 "String matching right hand side of IPv6 addresses. 793 "String matching right hand side of IPv6 addresses.
802Used in `tramp-make-tramp-file-name'.") 794Used in `tramp-make-tramp-file-name'.")
@@ -809,7 +801,6 @@ Derived from `tramp-postfix-ipv6-format'.")
809(defconst tramp-prefix-port-format 801(defconst tramp-prefix-port-format
810 (cond ((equal tramp-syntax 'ftp) "#") 802 (cond ((equal tramp-syntax 'ftp) "#")
811 ((equal tramp-syntax 'sep) "#") 803 ((equal tramp-syntax 'sep) "#")
812 ((equal tramp-syntax 'url) ":")
813 (t (error "Wrong `tramp-syntax' defined"))) 804 (t (error "Wrong `tramp-syntax' defined")))
814 "String matching delimiter between host names and port numbers.") 805 "String matching delimiter between host names and port numbers.")
815 806
@@ -838,7 +829,6 @@ Derived from `tramp-postfix-hop-format'.")
838(defconst tramp-postfix-host-format 829(defconst tramp-postfix-host-format
839 (cond ((equal tramp-syntax 'ftp) ":") 830 (cond ((equal tramp-syntax 'ftp) ":")
840 ((equal tramp-syntax 'sep) "]") 831 ((equal tramp-syntax 'sep) "]")
841 ((equal tramp-syntax 'url) "")
842 (t (error "Wrong `tramp-syntax' defined"))) 832 (t (error "Wrong `tramp-syntax' defined")))
843 "String matching delimiter between host names and localnames. 833 "String matching delimiter between host names and localnames.
844Used in `tramp-make-tramp-file-name'.") 834Used in `tramp-make-tramp-file-name'.")
@@ -909,15 +899,9 @@ XEmacs uses a separate filename syntax for Tramp and EFS.
909See `tramp-file-name-structure' for more explanations.") 899See `tramp-file-name-structure' for more explanations.")
910 900
911;;;###autoload 901;;;###autoload
912(defconst tramp-file-name-regexp-url "\\`/[^/|:]+://"
913 "Value for `tramp-file-name-regexp' for URL-like remoting.
914See `tramp-file-name-structure' for more explanations.")
915
916;;;###autoload
917(defconst tramp-file-name-regexp 902(defconst tramp-file-name-regexp
918 (cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified) 903 (cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified)
919 ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate) 904 ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate)
920 ((equal tramp-syntax 'url) tramp-file-name-regexp-url)
921 (t (error "Wrong `tramp-syntax' defined"))) 905 (t (error "Wrong `tramp-syntax' defined")))
922 "Regular expression matching file names handled by Tramp. 906 "Regular expression matching file names handled by Tramp.
923This regexp should match Tramp file names but no other file names. 907This regexp should match Tramp file names but no other file names.
@@ -952,16 +936,9 @@ XEmacs uses a separate filename syntax for Tramp and EFS.
952See `tramp-file-name-structure' for more explanations.") 936See `tramp-file-name-structure' for more explanations.")
953 937
954;;;###autoload 938;;;###autoload
955(defconst tramp-completion-file-name-regexp-url
956 "\\`/[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?\\'"
957 "Value for `tramp-completion-file-name-regexp' for URL-like remoting.
958See `tramp-file-name-structure' for more explanations.")
959
960;;;###autoload
961(defconst tramp-completion-file-name-regexp 939(defconst tramp-completion-file-name-regexp
962 (cond ((equal tramp-syntax 'ftp) tramp-completion-file-name-regexp-unified) 940 (cond ((equal tramp-syntax 'ftp) tramp-completion-file-name-regexp-unified)
963 ((equal tramp-syntax 'sep) tramp-completion-file-name-regexp-separate) 941 ((equal tramp-syntax 'sep) tramp-completion-file-name-regexp-separate)
964 ((equal tramp-syntax 'url) tramp-completion-file-name-regexp-url)
965 (t (error "Wrong `tramp-syntax' defined"))) 942 (t (error "Wrong `tramp-syntax' defined")))
966 "Regular expression matching file names handled by Tramp completion. 943 "Regular expression matching file names handled by Tramp completion.
967This regexp should match partial Tramp file names only. 944This regexp should match partial Tramp file names only.
@@ -2542,64 +2519,40 @@ They are collected by `tramp-completion-dissect-file-name1'."
2542 tramp-prefix-ipv6-regexp 2519 tramp-prefix-ipv6-regexp
2543 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") 2520 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$")
2544 nil 1 2 nil)) 2521 nil 1 2 nil))
2545 ;; "/method:user" "/[method/user" "/method://user" 2522 ;; "/method:user" "/[method/user"
2546 (tramp-completion-file-name-structure7 2523 (tramp-completion-file-name-structure7
2547 (list (concat tramp-prefix-regexp 2524 (list (concat tramp-prefix-regexp
2548 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp 2525 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
2549 "\\(" tramp-user-regexp x-nil "\\)$") 2526 "\\(" tramp-user-regexp x-nil "\\)$")
2550 1 2 nil nil)) 2527 1 2 nil nil))
2551 ;; "/method:host" "/[method/host" "/method://host" 2528 ;; "/method:host" "/[method/host"
2552 (tramp-completion-file-name-structure8 2529 (tramp-completion-file-name-structure8
2553 (list (concat tramp-prefix-regexp 2530 (list (concat tramp-prefix-regexp
2554 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp 2531 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
2555 "\\(" tramp-host-regexp x-nil "\\)$") 2532 "\\(" tramp-host-regexp x-nil "\\)$")
2556 1 nil 2 nil)) 2533 1 nil 2 nil))
2557 ;; "/method:[ipv6" "/[method/ipv6" "/method://[ipv6" 2534 ;; "/method:[ipv6" "/[method/ipv6"
2558 (tramp-completion-file-name-structure9 2535 (tramp-completion-file-name-structure9
2559 (list (concat tramp-prefix-regexp 2536 (list (concat tramp-prefix-regexp
2560 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp 2537 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
2561 tramp-prefix-ipv6-regexp 2538 tramp-prefix-ipv6-regexp
2562 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") 2539 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$")
2563 1 nil 2 nil)) 2540 1 nil 2 nil))
2564 ;; "/method:user@host" "/[method/user@host" "/method://user@host" 2541 ;; "/method:user@host" "/[method/user@host"
2565 (tramp-completion-file-name-structure10 2542 (tramp-completion-file-name-structure10
2566 (list (concat tramp-prefix-regexp 2543 (list (concat tramp-prefix-regexp
2567 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp 2544 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
2568 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp 2545 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp
2569 "\\(" tramp-host-regexp x-nil "\\)$") 2546 "\\(" tramp-host-regexp x-nil "\\)$")
2570 1 2 3 nil)) 2547 1 2 3 nil))
2571 ;; "/method:user@[ipv6" "/[method/user@ipv6" "/method://user@[ipv6" 2548 ;; "/method:user@[ipv6" "/[method/user@ipv6"
2572 (tramp-completion-file-name-structure11 2549 (tramp-completion-file-name-structure11
2573 (list (concat tramp-prefix-regexp 2550 (list (concat tramp-prefix-regexp
2574 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp 2551 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
2575 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp 2552 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp
2576 tramp-prefix-ipv6-regexp 2553 tramp-prefix-ipv6-regexp
2577 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") 2554 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$")
2578 1 2 3 nil)) 2555 1 2 3 nil)))
2579 ;; "/method: "/method:/"
2580 (tramp-completion-file-name-structure12
2581 (list
2582 (if (equal tramp-syntax 'url)
2583 (concat tramp-prefix-regexp
2584 "\\(" tramp-method-regexp "\\)"
2585 "\\(" (substring tramp-postfix-method-regexp 0 1)
2586 "\\|" (substring tramp-postfix-method-regexp 1 2) "\\)"
2587 "\\(" "\\)$")
2588 ;; Should not match if not URL syntax.
2589 (concat tramp-prefix-regexp "/$"))
2590 1 3 nil nil))
2591 ;; "/method: "/method:/"
2592 (tramp-completion-file-name-structure13
2593 (list
2594 (if (equal tramp-syntax 'url)
2595 (concat tramp-prefix-regexp
2596 "\\(" tramp-method-regexp "\\)"
2597 "\\(" (substring tramp-postfix-method-regexp 0 1)
2598 "\\|" (substring tramp-postfix-method-regexp 1 2) "\\)"
2599 "\\(" "\\)$")
2600 ;; Should not match if not URL syntax.
2601 (concat tramp-prefix-regexp "/$"))
2602 1 nil 3 nil)))
2603 2556
2604 (mapc (lambda (structure) 2557 (mapc (lambda (structure)
2605 (add-to-list 'result 2558 (add-to-list 'result
@@ -2616,8 +2569,6 @@ They are collected by `tramp-completion-dissect-file-name1'."
2616 tramp-completion-file-name-structure9 2569 tramp-completion-file-name-structure9
2617 tramp-completion-file-name-structure10 2570 tramp-completion-file-name-structure10
2618 tramp-completion-file-name-structure11 2571 tramp-completion-file-name-structure11
2619 tramp-completion-file-name-structure12
2620 tramp-completion-file-name-structure13
2621 tramp-file-name-structure)) 2572 tramp-file-name-structure))
2622 2573
2623 (delq nil result))) 2574 (delq nil result)))
@@ -3289,35 +3240,19 @@ User is always nil."
3289 3240
3290(defun tramp-handle-substitute-in-file-name (filename) 3241(defun tramp-handle-substitute-in-file-name (filename)
3291 "Like `substitute-in-file-name' for Tramp files. 3242 "Like `substitute-in-file-name' for Tramp files.
3292\"//\" and \"/~\" substitute only in the local filename part. 3243\"//\" and \"/~\" substitute only in the local filename part."
3293If the URL Tramp syntax is chosen, \"//\" as method delimiter and \"/~\" at
3294beginning of local filename are not substituted."
3295 ;; First, we must replace environment variables. 3244 ;; First, we must replace environment variables.
3296 (setq filename (tramp-replace-environment-variables filename)) 3245 (setq filename (tramp-replace-environment-variables filename))
3297 (with-parsed-tramp-file-name filename nil 3246 (with-parsed-tramp-file-name filename nil
3298 (if (equal tramp-syntax 'url) 3247 ;; Ignore in LOCALNAME everything before "//" or "/~".
3299 ;; We need to check localname only. The other parts cannot contain 3248 (when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" localname))
3300 ;; "//" or "/~". 3249 (setq filename
3301 (if (and (> (length localname) 1) 3250 (concat (file-remote-p filename)
3302 (or (string-match "//" localname) 3251 (replace-match "\\1" nil nil localname)))
3303 (string-match "/~" localname 1))) 3252 ;; "/m:h:~" does not work for completion. We use "/m:h:~/".
3304 (tramp-run-real-handler 'substitute-in-file-name (list filename)) 3253 (when (string-match "~$" filename)
3305 (tramp-make-tramp-file-name 3254 (setq filename (concat filename "/"))))
3306 (when method (substitute-in-file-name method)) 3255 (tramp-run-real-handler 'substitute-in-file-name (list filename))))
3307 (when user (substitute-in-file-name user))
3308 (when host (substitute-in-file-name host))
3309 (when localname
3310 (tramp-run-real-handler
3311 'substitute-in-file-name (list localname)))))
3312 ;; Ignore in LOCALNAME everything before "//" or "/~".
3313 (when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" localname))
3314 (setq filename
3315 (concat (file-remote-p filename)
3316 (replace-match "\\1" nil nil localname)))
3317 ;; "/m:h:~" does not work for completion. We use "/m:h:~/".
3318 (when (string-match "~$" filename)
3319 (setq filename (concat filename "/"))))
3320 (tramp-run-real-handler 'substitute-in-file-name (list filename)))))
3321 3256
3322(defun tramp-handle-unhandled-file-name-directory (_filename) 3257(defun tramp-handle-unhandled-file-name-directory (_filename)
3323 "Like `unhandled-file-name-directory' for Tramp files." 3258 "Like `unhandled-file-name-directory' for Tramp files."