Commit 69061fd1 authored by Michael Albinus's avatar Michael Albinus

Add new Tramp syntax

* lisp/net/tramp-cmds.el (tramp-change-syntax): New defun.

* lisp/net/tramp.el (tramp-syntax): Change default to `def'.
Add :set function.
(tramp-prefix-port-format): Simplify.
(tramp-file-name-regexp-separate): Remove.
(tramp-initial-file-name-regexp)
(tramp-completion-file-name-regexp-old-style)
(tramp-initial-completion-file-name-regexp): New defconst.
(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)
(tramp-rfn-eshadow-update-overlay-regexp): Change them to be defuns.
(tramp-tramp-file-p, tramp-find-method)
(tramp-dissect-file-name, tramp-make-tramp-file-name)
(tramp-completion-make-tramp-file-name)
(tramp-rfn-eshadow-update-overlay)
(tramp-register-autoload-file-name-handlers)
(tramp-register-file-name-handlers)
(tramp-unload-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 them.
parent c1fa0722
......@@ -37,6 +37,20 @@
(defvar reporter-eval-buffer)
(defvar reporter-prompt-for-summary-p)
;;;###autoload
(defun tramp-change-syntax (&optional syntax)
"Change Tramp syntax.
SYNTAX can be one of the symbols `def' (default), `ftp' (ange-ftp like)
or `sep' (XEmacs like)."
(interactive
(let ((input (completing-read
"Enter Tramp syntax: " '(def ftp sep) nil t
(symbol-name tramp-syntax))))
(unless (string-equal input "")
(list (intern input)))))
(when syntax
(custom-set-variables `(tramp-syntax ',syntax))))
(defun tramp-list-tramp-buffers ()
"Return a list of all Tramp connection buffers."
(append
......
......@@ -122,10 +122,10 @@ pass to the OPERATION."
(or (boundp 'ange-ftp-name-format)
(let (file-name-handler-alist) (require 'ange-ftp)))
(let ((ange-ftp-name-format
(list (nth 0 tramp-file-name-structure)
(nth 3 tramp-file-name-structure)
(nth 2 tramp-file-name-structure)
(nth 4 tramp-file-name-structure)))
(list (nth 0 (tramp-file-name-structure))
(nth 3 (tramp-file-name-structure))
(nth 2 (tramp-file-name-structure))
(nth 4 (tramp-file-name-structure))))
;; ange-ftp uses `ange-ftp-ftp-name-arg' and `ange-ftp-ftp-name-res'
;; for optimization in `ange-ftp-ftp-name'. If Tramp wasn't active,
;; there could be incorrect values from previous calls in case the
......
......@@ -3445,7 +3445,7 @@ the result will be a local, non-Tramp, file name."
(let (tramp-vc-registered-file-names
(remote-file-name-inhibit-cache (current-time))
(file-name-handler-alist
`((,tramp-file-name-regexp . tramp-vc-file-name-handler))))
`((,(tramp-file-name-regexp) . tramp-vc-file-name-handler))))
;; Here we collect only file names, which need an operation.
(ignore-errors (tramp-run-real-handler 'vc-registered (list file)))
......@@ -4482,7 +4482,7 @@ Goes through the list `tramp-inline-compress-commands'."
(let ((user (tramp-file-name-user item))
(host (tramp-file-name-host item))
(proxy (concat
tramp-prefix-format proxy tramp-postfix-host-format)))
(tramp-prefix-format) proxy (tramp-postfix-host-format))))
(tramp-message
vec 5 "Add proxy (\"%s\" \"%s\" \"%s\")"
(and (stringp host) (regexp-quote host))
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment