[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/net/tramp.el
From: |
Kai Großjohann |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/net/tramp.el |
Date: |
Thu, 11 Jul 2002 15:59:08 -0400 |
Index: emacs/lisp/net/tramp.el
diff -c emacs/lisp/net/tramp.el:1.7 emacs/lisp/net/tramp.el:1.8
*** emacs/lisp/net/tramp.el:1.7 Wed Jul 3 14:42:23 2002
--- emacs/lisp/net/tramp.el Thu Jul 11 15:59:07 2002
***************
*** 774,787 ****
:group 'tramp
:type '(repeat (list string function string)))
! (defcustom tramp-default-method "rcp"
"*Default method to use for transferring files.
See `tramp-methods' for possibilities.
! Also see `tramp-default-method-alist'."
:group 'tramp
:type 'string)
! (defcustom tramp-default-method-alist nil
"*Default method to use for specific user/host pairs.
This is an alist of items (HOST USER METHOD). The first matching item
specifies the method to use for a file name which does not specify a
--- 774,797 ----
:group 'tramp
:type '(repeat (list string function string)))
! (defcustom tramp-default-method "sm"
! ;;(if (featurep 'xemacs) "sm" "ftp")
"*Default method to use for transferring files.
See `tramp-methods' for possibilities.
! Also see `tramp-default-method-alist'.
!
! Emacs uses a unified filename syntax for Tramp and Ange-FTP.
! For backward compatibility, the default value of this variable
! is \"ftp\" on Emacs. But XEmacs uses a separate filename syntax
! for Tramp and EFS, so there the default method is \"sm\"."
:group 'tramp
:type 'string)
! (defcustom tramp-default-method-alist
! (if (featurep 'xemacs)
! nil
! '(("\\`ftp\\." "" "ftp")
! ("" "\\`\\(anonymous\\|ftp\\)\\'" "ftp")))
"*Default method to use for specific user/host pairs.
This is an alist of items (HOST USER METHOD). The first matching item
specifies the method to use for a file name which does not specify a
***************
*** 877,888 ****
;; File name format.
! (defcustom tramp-file-name-structure
(list (concat "\\`/\\[\\(\\([a-zA-Z0-9]+\\)/\\)?" ;method
"\\(\\([-a-zA-Z0-9_#/:]+\\)@\\)?" ;user
"\\([-a-zA-Z0-9_#/:@.]+\\)\\]" ;host
"\\(.*\\)\\'") ;path
2 4 5 6)
"*List of five elements (REGEXP METHOD USER HOST FILE), detailing \
the tramp file name structure.
--- 887,917 ----
;; File name format.
! (defconst tramp-file-name-structure-unified
! (list (concat "\\`/\\(\\([a-zA-Z0-9]+\\):\\)?" ;method
! "\\(\\([^:@/]+\\)@\\)?" ;user
! "\\([^:/]+\\):" ;host
! "\\(.*\\)\\'") ;path
! 2 4 5 6)
! "Default value for `tramp-file-name-structure' for unified remoting.
! On Emacs (not XEmacs), the Tramp and Ange-FTP packages use a unified
! filename space. This value is used for this unified namespace.")
!
! (defconst tramp-file-name-structure-separate
(list (concat "\\`/\\[\\(\\([a-zA-Z0-9]+\\)/\\)?" ;method
"\\(\\([-a-zA-Z0-9_#/:]+\\)@\\)?" ;user
"\\([-a-zA-Z0-9_#/:@.]+\\)\\]" ;host
"\\(.*\\)\\'") ;path
2 4 5 6)
+ "Default value for `tramp-file-name-structure' for separate remoting.
+ On XEmacs, the Tramp and EFS packages use a separate namespace for
+ remote filenames. This value is used in that case. It is designed
+ not to clash with the EFS filename syntax.")
+
+ (defcustom tramp-file-name-structure
+ (if (featurep 'xemacs)
+ tramp-file-name-structure-separate
+ tramp-file-name-structure-unified)
"*List of five elements (REGEXP METHOD USER HOST FILE), detailing \
the tramp file name structure.
***************
*** 906,912 ****
(integer :tag "Paren pair for file name ")))
;;;###autoload
! (defcustom tramp-file-name-regexp "\\`/\\[.*\\]"
"*Regular expression matching file names handled by tramp.
This regexp should match tramp file names but no other file names.
\(When tramp.el is loaded, this regular expression is prepended to
--- 935,958 ----
(integer :tag "Paren pair for file name ")))
;;;###autoload
! (defconst tramp-file-name-regexp-unified
! "\\`/[^/:]+:"
! "Value for `tramp-file-name-regexp' for unified remoting.
! Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and
! Tramp. See `tramp-file-name-structure-unified' for more explanations.")
!
! ;;;###autoload
! (defconst tramp-file-name-regexp-separate
! "\\`/\\[.*\\]"
! "Value for `tramp-file-name-regexp' for separate remoting.
! XEmacs uses a separate filename syntax for Tramp and EFS.
! See `tramp-file-name-structure-separate' for more explanations.")
!
! ;;;###autoload
! (defcustom tramp-file-name-regexp
! (if (featurep 'xemacs)
! tramp-file-name-regexp-separate
! tramp-file-name-regexp-unified)
"*Regular expression matching file names handled by tramp.
This regexp should match tramp file names but no other file names.
\(When tramp.el is loaded, this regular expression is prepended to
***************
*** 924,930 ****
:group 'tramp
:type 'regexp)
! (defcustom tramp-make-tramp-file-format "/[%m/address@hidden"
"*Format string saying how to construct tramp file name.
`%m' is replaced by the method name.
`%u' is replaced by the user name.
--- 970,991 ----
:group 'tramp
:type 'regexp)
! (defconst tramp-make-tramp-file-format-unified
! "/%m:address@hidden:%p"
! "Value for `tramp-make-tramp-file-format' for unified remoting.
! Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
! See `tramp-file-name-structure-unified' for more details.")
!
! (defconst tramp-make-tramp-file-format-separate
! "/[%m/address@hidden"
! "Value for `tramp-make-tramp-file-format' for separate remoting.
! XEmacs uses a separate filename syntax for EFS and Tramp.
! See `tramp-file-name-structure-separate' for more details.")
!
! (defcustom tramp-make-tramp-file-format
! (if (featurep 'xemacs)
! tramp-make-tramp-file-format-separate
! tramp-make-tramp-file-format-unified)
"*Format string saying how to construct tramp file name.
`%m' is replaced by the method name.
`%u' is replaced by the user name.
***************
*** 936,942 ****
:group 'tramp
:type 'string)
! (defcustom tramp-make-tramp-file-user-nil-format "/[%m/%h]%p"
"*Format string saying how to construct tramp file name when the user name
is not known.
`%m' is replaced by the method name.
`%h' is replaced by the host name.
--- 997,1018 ----
:group 'tramp
:type 'string)
! (defconst tramp-make-tramp-file-user-nil-format-unified
! "/%m:%h:%p"
! "Value of `tramp-make-tramp-file-user-nil-format' for unified remoting.
! Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
! See `tramp-file-name-structure-unified' for details.")
!
! (defconst tramp-make-tramp-file-user-nil-format-separate
! "/[%m/%h]%p"
! "Value of `tramp-make-tramp-file-user-nil-format' for separate remoting.
! XEmacs uses a separate filename syntax for EFS and Tramp.
! See `tramp-file-name-structure-separate' for details.")
!
! (defcustom tramp-make-tramp-file-user-nil-format
! (if (featurep 'xemacs)
! tramp-make-tramp-file-user-nil-format-separate
! tramp-make-tramp-file-user-nil-format-unified)
"*Format string saying how to construct tramp file name when the user name
is not known.
`%m' is replaced by the method name.
`%h' is replaced by the host name.
***************
*** 947,953 ****
:group 'tramp
:type 'string)
! (defcustom tramp-multi-file-name-structure
(list (concat
;; prefix
"\\`/\\[\\(\\([a-z0-9]+\\)\\)?"
--- 1023,1038 ----
:group 'tramp
:type 'string)
! (defconst tramp-multi-file-name-structure-unified
! (list (concat "\\`\\([a-zA-Z0-9]+\\)\\)?" ;method
! "\\(\\(%s\\)+\\)" ;hops
! ":\\(.*\\)\\'") ;path
! 2 3 -1)
! "Value for `tramp-multi-file-name-structure' for unified remoting.
! Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
! See `tramp-file-name-structure-unified' for details.")
!
! (defconst tramp-file-name-structure-separate
(list (concat
;; prefix
"\\`/\\[\\(\\([a-z0-9]+\\)\\)?"
***************
*** 958,963 ****
--- 1043,1056 ----
2 ;number of pair to match method
3 ;number of pair to match hops
-1) ;number of pair to match path
+ "Value of `tramp-multi-file-name-structure' for separate remoting.
+ XEmacs uses a separate filename syntax for EFS and Tramp.
+ See `tramp-file-name-structure-separate' for details.")
+
+ (defcustom tramp-multi-file-name-structure
+ (if (featurep 'xemacs)
+ tramp-multi-file-name-structure-separate
+ tramp-multi-file-name-structure-unified)
"*Describes the file name structure of `multi' files.
Multi files allow you to contact a remote host in several hops.
This is a list of four elements (REGEXP METHOD HOP PATH).
***************
*** 985,995 ****
(integer :tag "Paren pair for hops")
(integer :tag "Paren pair to match path")))
! (defcustom tramp-multi-file-name-hop-structure
(list (concat "/\\([a-z0-9_]+\\):" ;hop method
"\\([a-z0-9_]+\\)@" ;user
"\\([a-z0-9.-]+\\)") ;host
1 2 3)
"*Describes the structure of a hop in multi files.
This is a list of four elements (REGEXP METHOD USER HOST). First
element REGEXP is used to match against the hop. Pair number METHOD
--- 1078,1105 ----
(integer :tag "Paren pair for hops")
(integer :tag "Paren pair to match path")))
! (defconst tramp-multi-file-name-hop-structure-unified
! (list (concat ":\\([a-zA-z0-9_]+\\):" ;hop method
! "\\([^@:/]+\\)@" ;user
! "\\([^:/]+\\)") ;host
! 1 2 3)
! "Value of `tramp-multi-file-name-hop-structure' for unified remoting.
! Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
! See `tramp-file-name-structure-unified' for details.")
!
! (defconst tramp-multi-file-name-hop-structure-separate
(list (concat "/\\([a-z0-9_]+\\):" ;hop method
"\\([a-z0-9_]+\\)@" ;user
"\\([a-z0-9.-]+\\)") ;host
1 2 3)
+ "Value of `tramp-multi-file-name-hop-structure' for separate remoting.
+ XEmacs uses a separate filename syntax for EFS and Tramp.
+ See `tramp-file-name-structure-separate' for details.")
+
+ (defcustom tramp-multi-file-name-hop-structure
+ (if (featurep 'xemacs)
+ tramp-multi-file-name-hop-structure-separate
+ tramp-multi-file-name-hop-structure-unified)
"*Describes the structure of a hop in multi files.
This is a list of four elements (REGEXP METHOD USER HOST). First
element REGEXP is used to match against the hop. Pair number METHOD
***************
*** 1003,1010 ****
(integer :tag "Paren pair for user name")
(integer :tag "Paren pair for host name")))
! (defcustom tramp-make-multi-tramp-file-format
(list "/[%m" "/%m:address@hidden" "]%p")
"*Describes how to construct a `multi' file name.
This is a list of three elements PREFIX, HOP and PATH.
--- 1113,1134 ----
(integer :tag "Paren pair for user name")
(integer :tag "Paren pair for host name")))
! (defconst tramp-make-multi-tramp-file-format-unified
! (list "/%m" ":%m:address@hidden" ":%p")
! "Value of `tramp-make-multi-tramp-file-format' for unified remoting.
! Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
! See `tramp-file-name-structure-unified' for details.")
!
! (defconst tramp-make-multi-tramp-file-format-separate
(list "/[%m" "/%m:address@hidden" "]%p")
+ "Value of `tramp-make-multi-tramp-file-format' for separate remoting.
+ XEmacs uses a separate filename syntax for EFS and Tramp.
+ See `tramp-file-name-structure-separate' for details.")
+
+ (defcustom tramp-make-multi-tramp-file-format
+ (if (featurep 'xemacs)
+ tramp-make-multi-tramp-file-format-separate
+ tramp-make-multi-tramp-file-format-unified)
"*Describes how to construct a `multi' file name.
This is a list of three elements PREFIX, HOP and PATH.
***************
*** 1469,1475 ****
(with-parsed-tramp-file-name file nil
(when (tramp-ange-ftp-file-name-p multi-method method)
(tramp-invoke-ange-ftp 'file-name-directory file))
! (if (or (string= path "") (string= path "/"))
;; For a filename like "/[foo]", we return "/". The `else'
;; case would return "/[foo]" unchanged. But if we do that,
;; then `file-expand-wildcards' ceases to work. It's not
--- 1593,1606 ----
(with-parsed-tramp-file-name file nil
(when (tramp-ange-ftp-file-name-p multi-method method)
(tramp-invoke-ange-ftp 'file-name-directory file))
! ;; For the following condition, two possibilities should be tried:
! ;; (1) (string= path "")
! ;; (2) (or (string= path "") (string= path "/"))
! ;; The second variant fails when completing a "/" directory on
! ;; the remote host, that is a filename which looks like
! ;; "/address@hidden:/". But maybe wildcards fail with the first variant.
! ;; We should do some investigation.
! (if (string= path "")
;; For a filename like "/[foo]", we return "/". The `else'
;; case would return "/[foo]" unchanged. But if we do that,
;; then `file-expand-wildcards' ceases to work. It's not
***************
*** 2971,3012 ****
(add-to-list 'file-name-handler-alist
(cons tramp-file-name-regexp 'tramp-file-name-handler))
! ;;;###autoload
! (defun tramp-handle-ange-ftp ()
! "Turn Ange-FTP off and an Ange-FTP-like filename format.
! Requests suitable for Ange-FTP will be forwarded to Ange-FTP.
! Also see the variables `tramp-ftp-method', `tramp-default-method',
! and `tramp-default-method-alist'."
! (interactive)
(let ((a1 (rassq 'ange-ftp-hook-function file-name-handler-alist))
! (a2 (rassq 'ange-ftp-completion-hook-function file-name-handler-alist))
! (a3 (rassq 'tramp-file-name-handler file-name-handler-alist)))
(setq file-name-handler-alist
! (delete a1 (delete a2 (delete a3 file-name-handler-alist)))))
! (setq tramp-file-name-structure
! (list (concat "\\`/\\(\\([a-zA-Z0-9]+\\)#\\)?" ;method
! "\\(\\([^:@/]+\\)@\\)?" ;user
! "\\([^:/]+\\):" ;host
! "\\(.*\\)\\'") ;path
! 2 4 5 6)
! tramp-file-name-regexp "\\`/[^/:]+:"
! tramp-make-tramp-file-format "/address@hidden:%p"
! tramp-make-tramp-file-user-nil-format "/%m#%h:%p"
! tramp-multi-file-name-structure
! (list (concat "\\`\\([a-zA-Z0-9]+\\)\\)?" ;method
! "\\(\\(%s\\)+\\)" ;hops
! ":\\(.*\\)\\'") ;path
! 2 3 -1)
! tramp-multi-file-name-hop-structure
! (list (concat ":\\([a-zA-z0-9_]+\\):" ;hop method
! "\\([^@:/]+\\)@" ;user
! "\\([^:/]+\\)") ;host
! 1 2 3)
! tramp-make-multi-tramp-file-format
! (list "/%m" ":%m:address@hidden" ":%p"))
! (add-to-list 'file-name-handler-alist
! (cons tramp-file-name-regexp 'tramp-file-name-handler))
! (tramp-repair-jka-compr))
(defun tramp-repair-jka-compr ()
"If jka-compr is already loaded, move it to the front of
--- 3102,3132 ----
(add-to-list 'file-name-handler-alist
(cons tramp-file-name-regexp 'tramp-file-name-handler))
! ;; To handle EFS, the following functions need to be dealt with:
! ;;
! ;; * dired-before-readin-hook contains efs-dired-before-readin
! ;; * file-name-handler-alist contains efs-file-handler-function
! ;; and efs-root-handler-function and efs-sifn-handler-function
! ;; * find-file-hooks contains efs-set-buffer-mode
! ;;
! ;; But it won't happen for EFS since the XEmacs maintainers
! ;; don't want to use a unified filename syntax.
! (defun tramp-disable-ange-ftp ()
! "Turn Ange-FTP off.
! This is useful for unified remoting. See
! `tramp-file-name-structure-unified' and
! `tramp-file-name-structure-separate' for details. Requests suitable
! for Ange-FTP will be forwarded to Ange-FTP. Also see the variables
! `tramp-ftp-method', `tramp-default-method', and
! `tramp-default-method-alist'.
!
! This function is not needed in Emacsen which include Tramp, but is
! present for backward compatibility."
(let ((a1 (rassq 'ange-ftp-hook-function file-name-handler-alist))
! (a2 (rassq 'ange-ftp-completion-hook-function file-name-handler-alist)))
(setq file-name-handler-alist
! (delete a1 (delete a2 file-name-handler-alist)))))
! (tramp-disable-ange-ftp)
(defun tramp-repair-jka-compr ()
"If jka-compr is already loaded, move it to the front of
- [Emacs-diffs] Changes to emacs/lisp/net/tramp.el, Juanma Barranquero, 2002/07/03
- [Emacs-diffs] Changes to emacs/lisp/net/tramp.el, Andreas Schwab, 2002/07/03
- [Emacs-diffs] Changes to emacs/lisp/net/tramp.el,
Kai Großjohann <=
- [Emacs-diffs] Changes to emacs/lisp/net/tramp.el, Kai Großjohann, 2002/07/11
- [Emacs-diffs] Changes to emacs/lisp/net/tramp.el, Kai Großjohann, 2002/07/13
- [Emacs-diffs] Changes to emacs/lisp/net/tramp.el, Kai Großjohann, 2002/07/21
- [Emacs-diffs] Changes to emacs/lisp/net/tramp.el, Kai Großjohann, 2002/07/30