emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114151: Remove URL syntax.


From: Michael Albinus
Subject: [Emacs-diffs] trunk r114151: Remove URL syntax.
Date: Fri, 06 Sep 2013 08:23:36 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114151
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Fri 2013-09-06 10:23:30 +0200
message:
  Remove URL syntax.
  
  * net/tramp.el (tramp-syntax, tramp-prefix-format)
  (tramp-postfix-method-format, tramp-prefix-ipv6-format)
  (tramp-postfix-ipv6-format, tramp-prefix-port-format)
  (tramp-postfix-host-format, tramp-file-name-regexp)
  (tramp-completion-file-name-regexp)
  (tramp-completion-dissect-file-name)
  (tramp-handle-substitute-in-file-name): Remove 'url case.
  (tramp-file-name-regexp-url)
  (tramp-completion-file-name-regexp-url): Remove constants.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp.el              tramp.el-20091113204419-o5vbwnq5f7feedwu-2427
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-09-06 01:38:45 +0000
+++ b/lisp/ChangeLog    2013-09-06 08:23:30 +0000
@@ -1,3 +1,17 @@
+2013-09-06  Michael Albinus  <address@hidden>
+
+       Remove URL syntax.
+
+       * net/tramp.el (tramp-syntax, tramp-prefix-format)
+       (tramp-postfix-method-format, tramp-prefix-ipv6-format)
+       (tramp-postfix-ipv6-format, tramp-prefix-port-format)
+       (tramp-postfix-host-format, tramp-file-name-regexp)
+       (tramp-completion-file-name-regexp)
+       (tramp-completion-dissect-file-name)
+       (tramp-handle-substitute-in-file-name): Remove 'url case.
+       (tramp-file-name-regexp-url)
+       (tramp-completion-file-name-regexp-url): Remove constants.
+
 2013-09-06  Glenn Morris  <address@hidden>
 
        * replace.el (replace-string): Doc fix re start/end.  (Bug#15275)

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2013-09-03 16:23:10 +0000
+++ b/lisp/net/tramp.el 2013-09-06 08:23:30 +0000
@@ -690,7 +690,7 @@
 ;; Tramp only knows how to deal with `file-name-handler-alist', not
 ;; the other places.
 
-;; Currently, we have the choice between 'ftp, 'sep, and 'url.
+;; Currently, we have the choice between 'ftp and 'sep.
 ;;;###autoload
 (defcustom tramp-syntax
   (if (featurep 'xemacs) 'sep 'ftp)
@@ -699,20 +699,15 @@
 It can have the following values:
 
   'ftp -- Ange-FTP respective EFS like syntax (GNU Emacs default)
-  'sep -- Syntax as defined for XEmacs (not available yet for GNU Emacs)
-  'url -- URL-like syntax."
+  'sep -- Syntax as defined for XEmacs."
   :group 'tramp
-  :type (if (featurep 'xemacs)
-           '(choice (const :tag "EFS"    ftp)
-                    (const :tag "XEmacs" sep)
-                    (const :tag "URL"    url))
-         '(choice (const :tag "Ange-FTP" ftp)
-                  (const :tag "URL"      url))))
+  :version "24.4"
+  :type `(choice (const :tag  ,(if (featurep 'xemacs) "EFS" "Ange-FTP") ftp)
+                (const :tag "XEmacs" sep)))
 
 (defconst tramp-prefix-format
   (cond ((equal tramp-syntax 'ftp) "/")
        ((equal tramp-syntax 'sep) "/[")
-       ((equal tramp-syntax 'url) "/")
        (t (error "Wrong `tramp-syntax' defined")))
   "String matching the very beginning of Tramp file names.
 Used in `tramp-make-tramp-file-name'.")
@@ -729,7 +724,6 @@
 (defconst tramp-postfix-method-format
   (cond ((equal tramp-syntax 'ftp) ":")
        ((equal tramp-syntax 'sep) "/")
-       ((equal tramp-syntax 'url) "://")
        (t (error "Wrong `tramp-syntax' defined")))
   "String matching delimiter between method and user or host names.
 Used in `tramp-make-tramp-file-name'.")
@@ -776,7 +770,6 @@
 (defconst tramp-prefix-ipv6-format
   (cond ((equal tramp-syntax 'ftp) "[")
        ((equal tramp-syntax 'sep) "")
-       ((equal tramp-syntax 'url) "[")
        (t (error "Wrong `tramp-syntax' defined")))
   "String matching left hand side of IPv6 addresses.
 Used in `tramp-make-tramp-file-name'.")
@@ -796,7 +789,6 @@
 (defconst tramp-postfix-ipv6-format
   (cond ((equal tramp-syntax 'ftp) "]")
        ((equal tramp-syntax 'sep) "")
-       ((equal tramp-syntax 'url) "]")
        (t (error "Wrong `tramp-syntax' defined")))
   "String matching right hand side of IPv6 addresses.
 Used in `tramp-make-tramp-file-name'.")
@@ -809,7 +801,6 @@
 (defconst tramp-prefix-port-format
   (cond ((equal tramp-syntax 'ftp) "#")
        ((equal tramp-syntax 'sep) "#")
-       ((equal tramp-syntax 'url) ":")
        (t (error "Wrong `tramp-syntax' defined")))
   "String matching delimiter between host names and port numbers.")
 
@@ -838,7 +829,6 @@
 (defconst tramp-postfix-host-format
   (cond ((equal tramp-syntax 'ftp) ":")
        ((equal tramp-syntax 'sep) "]")
-       ((equal tramp-syntax 'url) "")
        (t (error "Wrong `tramp-syntax' defined")))
   "String matching delimiter between host names and localnames.
 Used in `tramp-make-tramp-file-name'.")
@@ -909,15 +899,9 @@
 See `tramp-file-name-structure' for more explanations.")
 
 ;;;###autoload
-(defconst tramp-file-name-regexp-url "\\`/[^/|:]+://"
-  "Value for `tramp-file-name-regexp' for URL-like remoting.
-See `tramp-file-name-structure' for more explanations.")
-
-;;;###autoload
 (defconst tramp-file-name-regexp
   (cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified)
        ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate)
-       ((equal tramp-syntax 'url) tramp-file-name-regexp-url)
        (t (error "Wrong `tramp-syntax' defined")))
   "Regular expression matching file names handled by Tramp.
 This regexp should match Tramp file names but no other file names.
@@ -952,16 +936,9 @@
 See `tramp-file-name-structure' for more explanations.")
 
 ;;;###autoload
-(defconst tramp-completion-file-name-regexp-url
-  "\\`/[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?\\'"
-  "Value for `tramp-completion-file-name-regexp' for URL-like remoting.
-See `tramp-file-name-structure' for more explanations.")
-
-;;;###autoload
 (defconst tramp-completion-file-name-regexp
   (cond ((equal tramp-syntax 'ftp) tramp-completion-file-name-regexp-unified)
        ((equal tramp-syntax 'sep) tramp-completion-file-name-regexp-separate)
-       ((equal tramp-syntax 'url) tramp-completion-file-name-regexp-url)
        (t (error "Wrong `tramp-syntax' defined")))
   "Regular expression matching file names handled by Tramp completion.
 This regexp should match partial Tramp file names only.
@@ -2542,64 +2519,40 @@
                        tramp-prefix-ipv6-regexp
                        "\\(" tramp-completion-ipv6-regexp x-nil   "\\)$")
                nil 1 2 nil))
-        ;; "/method:user" "/[method/user" "/method://user"
+        ;; "/method:user" "/[method/user"
         (tramp-completion-file-name-structure7
          (list (concat tramp-prefix-regexp
                        "\\(" tramp-method-regexp "\\)" 
tramp-postfix-method-regexp
                        "\\(" tramp-user-regexp x-nil   "\\)$")
                1 2 nil nil))
-        ;; "/method:host" "/[method/host" "/method://host"
+        ;; "/method:host" "/[method/host"
         (tramp-completion-file-name-structure8
          (list (concat tramp-prefix-regexp
                        "\\(" tramp-method-regexp "\\)" 
tramp-postfix-method-regexp
                        "\\(" tramp-host-regexp x-nil   "\\)$")
                1 nil 2 nil))
-        ;; "/method:[ipv6" "/[method/ipv6" "/method://[ipv6"
+        ;; "/method:[ipv6" "/[method/ipv6"
         (tramp-completion-file-name-structure9
          (list (concat tramp-prefix-regexp
                        "\\(" tramp-method-regexp "\\)" 
tramp-postfix-method-regexp
                        tramp-prefix-ipv6-regexp
                        "\\(" tramp-completion-ipv6-regexp x-nil   "\\)$")
                1 nil 2 nil))
-        ;; "/method:address@hidden" "/[method/address@hidden" 
"/method://address@hidden"
+        ;; "/method:address@hidden" "/[method/address@hidden"
         (tramp-completion-file-name-structure10
          (list (concat tramp-prefix-regexp
                        "\\(" tramp-method-regexp "\\)" 
tramp-postfix-method-regexp
                        "\\(" tramp-user-regexp "\\)"   
tramp-postfix-user-regexp
                        "\\(" tramp-host-regexp x-nil   "\\)$")
                1 2 3 nil))
-        ;; "/method:address@hidden" "/[method/address@hidden" 
"/method://address@hidden"
+        ;; "/method:address@hidden" "/[method/address@hidden"
         (tramp-completion-file-name-structure11
          (list (concat tramp-prefix-regexp
                        "\\(" tramp-method-regexp "\\)" 
tramp-postfix-method-regexp
                        "\\(" tramp-user-regexp "\\)"   
tramp-postfix-user-regexp
                        tramp-prefix-ipv6-regexp
                        "\\(" tramp-completion-ipv6-regexp x-nil   "\\)$")
-               1 2 3 nil))
-        ;; "/method: "/method:/"
-        (tramp-completion-file-name-structure12
-         (list
-          (if (equal tramp-syntax 'url)
-              (concat tramp-prefix-regexp
-                      "\\(" tramp-method-regexp "\\)"
-                      "\\(" (substring tramp-postfix-method-regexp 0 1)
-                      "\\|" (substring tramp-postfix-method-regexp 1 2) "\\)"
-                      "\\(" "\\)$")
-            ;; Should not match if not URL syntax.
-            (concat tramp-prefix-regexp "/$"))
-          1 3 nil nil))
-        ;; "/method: "/method:/"
-        (tramp-completion-file-name-structure13
-         (list
-          (if (equal tramp-syntax 'url)
-              (concat tramp-prefix-regexp
-                      "\\(" tramp-method-regexp "\\)"
-                      "\\(" (substring tramp-postfix-method-regexp 0 1)
-                      "\\|" (substring tramp-postfix-method-regexp 1 2) "\\)"
-                      "\\(" "\\)$")
-            ;; Should not match if not URL syntax.
-            (concat tramp-prefix-regexp "/$"))
-          1 nil 3 nil)))
+               1 2 3 nil)))
 
     (mapc (lambda (structure)
       (add-to-list 'result
@@ -2616,8 +2569,6 @@
        tramp-completion-file-name-structure9
        tramp-completion-file-name-structure10
        tramp-completion-file-name-structure11
-       tramp-completion-file-name-structure12
-       tramp-completion-file-name-structure13
        tramp-file-name-structure))
 
     (delq nil result)))
@@ -3289,35 +3240,19 @@
 
 (defun tramp-handle-substitute-in-file-name (filename)
   "Like `substitute-in-file-name' for Tramp files.
-\"//\" and \"/~\" substitute only in the local filename part.
-If the URL Tramp syntax is chosen, \"//\" as method delimiter and \"/~\" at
-beginning of local filename are not substituted."
+\"//\" and \"/~\" substitute only in the local filename part."
   ;; First, we must replace environment variables.
   (setq filename (tramp-replace-environment-variables filename))
   (with-parsed-tramp-file-name filename nil
-    (if (equal tramp-syntax 'url)
-       ;; We need to check localname only.  The other parts cannot contain
-       ;; "//" or "/~".
-       (if (and (> (length localname) 1)
-                (or (string-match "//" localname)
-                    (string-match "/~" localname 1)))
-           (tramp-run-real-handler 'substitute-in-file-name (list filename))
-         (tramp-make-tramp-file-name
-          (when method (substitute-in-file-name method))
-          (when user (substitute-in-file-name user))
-          (when host (substitute-in-file-name host))
-          (when localname
-            (tramp-run-real-handler
-             'substitute-in-file-name (list localname)))))
-      ;; Ignore in LOCALNAME everything before "//" or "/~".
-      (when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" 
localname))
-       (setq filename
-             (concat (file-remote-p filename)
-                     (replace-match "\\1" nil nil localname)))
-       ;; "/m:h:~" does not work for completion.  We use "/m:h:~/".
-       (when (string-match "~$" filename)
-         (setq filename (concat filename "/"))))
-      (tramp-run-real-handler 'substitute-in-file-name (list filename)))))
+    ;; Ignore in LOCALNAME everything before "//" or "/~".
+    (when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" localname))
+      (setq filename
+           (concat (file-remote-p filename)
+                   (replace-match "\\1" nil nil localname)))
+      ;; "/m:h:~" does not work for completion.  We use "/m:h:~/".
+      (when (string-match "~$" filename)
+       (setq filename (concat filename "/"))))
+    (tramp-run-real-handler 'substitute-in-file-name (list filename))))
 
 (defun tramp-handle-unhandled-file-name-directory (_filename)
   "Like `unhandled-file-name-directory' for Tramp files."


reply via email to

[Prev in Thread] Current Thread [Next in Thread]