diff options
| author | Michael Albinus | 2017-04-09 13:28:24 +0200 |
|---|---|---|
| committer | Michael Albinus | 2017-04-09 13:28:24 +0200 |
| commit | 9e1f45d98f82278845b57fce9796142c8e3bf778 (patch) | |
| tree | 12916051287d878b35c9b67fd788f4cd5b6aa9e2 | |
| parent | 43bc45ba1697b60c4589cb0c8e30cf1618275582 (diff) | |
| download | emacs-9e1f45d98f82278845b57fce9796142c8e3bf778.tar.gz emacs-9e1f45d98f82278845b57fce9796142c8e3bf778.zip | |
Document Tramp changes
* doc/misc/tramp.texi (Change file name syntax): New node.
* etc/NEWS: Mention `tramp-change-syntax'.
* lisp/net/tramp.el (tramp-file-name-regexp): Reinsert it.
External packages uses it.
(tramp-syntax): Set also `tramp-file-name-regexp'.
| -rw-r--r-- | doc/misc/tramp.texi | 66 | ||||
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 9 |
3 files changed, 75 insertions, 4 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index b19836d0b9a..179578eea9b 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -155,7 +155,10 @@ Configuring @value{tramp} for use | |||
| 155 | 155 | ||
| 156 | Using @value{tramp} | 156 | Using @value{tramp} |
| 157 | 157 | ||
| 158 | * File name Syntax:: @value{tramp} file name conventions. | 158 | * File name syntax:: @value{tramp} file name conventions. |
| 159 | @ifset unified | ||
| 160 | * Change file name syntax:: Alternative file name syntax. | ||
| 161 | @end ifset | ||
| 159 | * File name completion:: File name completion. | 162 | * File name completion:: File name completion. |
| 160 | * Ad-hoc multi-hops:: Declaring multiple hops in the file name. | 163 | * Ad-hoc multi-hops:: Declaring multiple hops in the file name. |
| 161 | * Remote processes:: Integration with other Emacs packages. | 164 | * Remote processes:: Integration with other Emacs packages. |
| @@ -997,7 +1000,7 @@ Other methods to include are: @option{ftp} and @option{smb}. | |||
| 997 | @cindex default method | 1000 | @cindex default method |
| 998 | 1001 | ||
| 999 | In a remote file name, the use of a default method is indicated by the | 1002 | In a remote file name, the use of a default method is indicated by the |
| 1000 | pseudo method @option{-}, @ref{File name Syntax}. | 1003 | pseudo method @option{-}, @ref{File name syntax}. |
| 1001 | 1004 | ||
| 1002 | @defopt tramp-default-method | 1005 | @defopt tramp-default-method |
| 1003 | Default method is for transferring files. The user option | 1006 | Default method is for transferring files. The user option |
| @@ -2131,7 +2134,10 @@ is a feature of Emacs that may cause missed prompts when using | |||
| 2131 | @value{tramp}. | 2134 | @value{tramp}. |
| 2132 | 2135 | ||
| 2133 | @menu | 2136 | @menu |
| 2134 | * File name Syntax:: @value{tramp} file name conventions. | 2137 | * File name syntax:: @value{tramp} file name conventions. |
| 2138 | @ifset unified | ||
| 2139 | * Change file name syntax:: Alternative file name syntax. | ||
| 2140 | @end ifset | ||
| 2135 | * File name completion:: File name completion. | 2141 | * File name completion:: File name completion. |
| 2136 | * Ad-hoc multi-hops:: Declaring multiple hops in the file name. | 2142 | * Ad-hoc multi-hops:: Declaring multiple hops in the file name. |
| 2137 | * Remote processes:: Integration with other Emacs packages. | 2143 | * Remote processes:: Integration with other Emacs packages. |
| @@ -2139,7 +2145,7 @@ is a feature of Emacs that may cause missed prompts when using | |||
| 2139 | @end menu | 2145 | @end menu |
| 2140 | 2146 | ||
| 2141 | 2147 | ||
| 2142 | @node File name Syntax | 2148 | @node File name syntax |
| 2143 | @section @value{tramp} file name conventions | 2149 | @section @value{tramp} file name conventions |
| 2144 | @cindex file name syntax | 2150 | @cindex file name syntax |
| 2145 | @cindex file name examples | 2151 | @cindex file name examples |
| @@ -2200,6 +2206,58 @@ pseudo method @file{-}. | |||
| 2200 | @end ifset | 2206 | @end ifset |
| 2201 | 2207 | ||
| 2202 | 2208 | ||
| 2209 | @ifset unified | ||
| 2210 | @node Change file name syntax | ||
| 2211 | @section Alternative file name syntax | ||
| 2212 | @cindex change file name syntax | ||
| 2213 | @cindex alternative file name syntax | ||
| 2214 | |||
| 2215 | The syntax described in @ref{File name syntax} is the @code{default} | ||
| 2216 | syntax, which is active after Emacs startup. However, this can be | ||
| 2217 | changed. | ||
| 2218 | |||
| 2219 | @deffn Command tramp-change-syntax syntax | ||
| 2220 | This command changes the syntax @value{tramp} uses for remote file | ||
| 2221 | names. Beside the @code{default} value, @var{syntax} can be | ||
| 2222 | |||
| 2223 | @itemize | ||
| 2224 | @item @code{simplified} | ||
| 2225 | @cindex simplified syntax | ||
| 2226 | |||
| 2227 | The remote file name syntax is similar to the syntax used by Ange FTP. | ||
| 2228 | A remote file name has the form | ||
| 2229 | @code{@value{prefix}user@@host@value{postfix}path/to/file}. The | ||
| 2230 | @code{user@@} part is optional, and the method is determined by | ||
| 2231 | @ref{Default Method}. | ||
| 2232 | |||
| 2233 | @item @code{separate} | ||
| 2234 | @cindex separate syntax | ||
| 2235 | |||
| 2236 | @clear unified | ||
| 2237 | @set separate | ||
| 2238 | @include trampver.texi | ||
| 2239 | The remote file name syntax is similar to the syntax used by XEmacs. | ||
| 2240 | A remote file name has the form | ||
| 2241 | @code{@trampfn{method,user@@host,path/to/file}}. The @code{method} | ||
| 2242 | and @code{user@@} parts are optional. | ||
| 2243 | @clear separate | ||
| 2244 | @set unified | ||
| 2245 | @include trampver.texi | ||
| 2246 | @end itemize | ||
| 2247 | @end deffn | ||
| 2248 | |||
| 2249 | @defvar tramp-file-name-regexp | ||
| 2250 | This variable keeps a regexp which matches the selected remote file | ||
| 2251 | name syntax. However, it is not recommended to use this variable in | ||
| 2252 | external packages, a call of @code{file-remote-p} is much more | ||
| 2253 | appropriate. | ||
| 2254 | @ifinfo | ||
| 2255 | @pxref{Magic File Names, , , elisp} | ||
| 2256 | @end ifinfo | ||
| 2257 | @end defvar | ||
| 2258 | @end ifset | ||
| 2259 | |||
| 2260 | |||
| 2203 | @node File name completion | 2261 | @node File name completion |
| 2204 | @section File name completion | 2262 | @section File name completion |
| 2205 | @cindex file name completion | 2263 | @cindex file name completion |
| @@ -655,6 +655,10 @@ remote file name starts with "/method:host:" or "/method:user@host:". | |||
| 655 | "/-::" is the shortest remote file name then. | 655 | "/-::" is the shortest remote file name then. |
| 656 | 656 | ||
| 657 | +++ | 657 | +++ |
| 658 | *** The command 'tramp-change-syntax' allows to choose an alternative | ||
| 659 | remote file name syntax. | ||
| 660 | |||
| 661 | +++ | ||
| 658 | *** New connection method "sg", which supports editing files under a | 662 | *** New connection method "sg", which supports editing files under a |
| 659 | different group ID. | 663 | different group ID. |
| 660 | 664 | ||
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 818054676e4..eb32bd6e0ed 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -687,6 +687,8 @@ It can have the following values: | |||
| 687 | (tramp-cleanup-all-buffers)) | 687 | (tramp-cleanup-all-buffers)) |
| 688 | ;; Set the value: | 688 | ;; Set the value: |
| 689 | (set-default symbol value) | 689 | (set-default symbol value) |
| 690 | ;; Reset `tramp-file-name-regexp'. | ||
| 691 | (setq tramp-file-name-regexp (tramp-file-name-regexp)) | ||
| 690 | ;; Rearrange file name handlers. | 692 | ;; Rearrange file name handlers. |
| 691 | (tramp-register-file-name-handlers))) | 693 | (tramp-register-file-name-handlers))) |
| 692 | 694 | ||
| @@ -892,6 +894,13 @@ This regexp should match Tramp file names but no other file names." | |||
| 892 | "Value for `tramp-file-name-regexp' for autoload. | 894 | "Value for `tramp-file-name-regexp' for autoload. |
| 893 | It must match the initial `tramp-syntax' settings.") | 895 | It must match the initial `tramp-syntax' settings.") |
| 894 | 896 | ||
| 897 | ;; External packages use constant `tramp-file-name-regexp'. In order | ||
| 898 | ;; not to break them, we still provide it. It is a variable now. | ||
| 899 | ;;;###autoload | ||
| 900 | (defvar tramp-file-name-regexp tramp-initial-file-name-regexp | ||
| 901 | "Value for `tramp-file-name-regexp' for autoload. | ||
| 902 | It must match the initial `tramp-syntax' settings.") | ||
| 903 | |||
| 895 | ;;;###autoload | 904 | ;;;###autoload |
| 896 | (defconst tramp-completion-file-name-regexp-default | 905 | (defconst tramp-completion-file-name-regexp-default |
| 897 | (concat | 906 | (concat |