emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 9e1f45d: Document Tramp changes


From: Michael Albinus
Subject: [Emacs-diffs] master 9e1f45d: Document Tramp changes
Date: Sun, 9 Apr 2017 07:28:51 -0400 (EDT)

branch: master
commit 9e1f45d98f82278845b57fce9796142c8e3bf778
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    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'.
---
 doc/misc/tramp.texi | 66 +++++++++++++++++++++++++++++++++++++++++++++++++----
 etc/NEWS            |  4 ++++
 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 b19836d..179578e 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -155,7 +155,10 @@ Configuring @value{tramp} for use
 
 Using @value{tramp}
 
-* File name Syntax::            @value{tramp} file name conventions.
+* File name syntax::            @value{tramp} file name conventions.
address@hidden unified
+* Change file name syntax::     Alternative file name syntax.
address@hidden ifset
 * File name completion::        File name completion.
 * Ad-hoc multi-hops::           Declaring multiple hops in the file name.
 * Remote processes::            Integration with other Emacs packages.
@@ -997,7 +1000,7 @@ Other methods to include are: @option{ftp} and 
@option{smb}.
 @cindex default method
 
 In a remote file name, the use of a default method is indicated by the
-pseudo method @option{-}, @ref{File name Syntax}.
+pseudo method @option{-}, @ref{File name syntax}.
 
 @defopt tramp-default-method
 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
 @value{tramp}.
 
 @menu
-* File name Syntax::            @value{tramp} file name conventions.
+* File name syntax::            @value{tramp} file name conventions.
address@hidden unified
+* Change file name syntax::     Alternative file name syntax.
address@hidden ifset
 * File name completion::        File name completion.
 * Ad-hoc multi-hops::           Declaring multiple hops in the file name.
 * Remote processes::            Integration with other Emacs packages.
@@ -2139,7 +2145,7 @@ is a feature of Emacs that may cause missed prompts when 
using
 @end menu
 
 
address@hidden File name Syntax
address@hidden File name syntax
 @section @value{tramp} file name conventions
 @cindex file name syntax
 @cindex file name examples
@@ -2200,6 +2206,58 @@ pseudo method @file{-}.
 @end ifset
 
 
address@hidden unified
address@hidden Change file name syntax
address@hidden Alternative file name syntax
address@hidden change file name syntax
address@hidden alternative file name syntax
+
+The syntax described in @ref{File name syntax} is the @code{default}
+syntax, which is active after Emacs startup.  However, this can be
+changed.
+
address@hidden Command tramp-change-syntax syntax
+This command changes the syntax @value{tramp} uses for remote file
+names.  Beside the @code{default} value, @var{syntax} can be
+
address@hidden
address@hidden @code{simplified}
address@hidden simplified syntax
+
+The remote file name syntax is similar to the syntax used by Ange FTP.
+A remote file name has the form
address@hidden@value{prefix}user@@address@hidden/to/file}.  The
address@hidden@@} part is optional, and the method is determined by
address@hidden Method}.
+
address@hidden @code{separate}
address@hidden separate syntax
+
address@hidden unified
address@hidden separate
address@hidden trampver.texi
+The remote file name syntax is similar to the syntax used by XEmacs.
+A remote file name has the form
address@hidden@trampfn{method,user@@host,path/to/file}}.  The @code{method}
+and @code{user@@} parts are optional.
address@hidden separate
address@hidden unified
address@hidden trampver.texi
address@hidden itemize
address@hidden deffn
+
address@hidden tramp-file-name-regexp
+This variable keeps a regexp which matches the selected remote file
+name syntax.  However, it is not recommended to use this variable in
+external packages, a call of @code{file-remote-p} is much more
+appropriate.
address@hidden
address@hidden File Names, , , elisp}
address@hidden ifinfo
address@hidden defvar
address@hidden ifset
+
+
 @node File name completion
 @section File name completion
 @cindex file name completion
diff --git a/etc/NEWS b/etc/NEWS
index e351abc..b36db07 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -655,6 +655,10 @@ remote file name starts with "/method:host:" or 
"/method:address@hidden:".
 "/-::" is the shortest remote file name then.
 
 +++
+*** The command 'tramp-change-syntax' allows to choose an alternative
+remote file name syntax.
+
++++
 *** New connection method "sg", which supports editing files under a
 different group ID.
 
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 8180546..eb32bd6 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -687,6 +687,8 @@ It can have the following values:
            (tramp-cleanup-all-buffers))
         ;; Set the value:
         (set-default symbol value)
+        ;; Reset `tramp-file-name-regexp'.
+        (setq tramp-file-name-regexp (tramp-file-name-regexp))
         ;; Rearrange file name handlers.
         (tramp-register-file-name-handlers)))
 
@@ -892,6 +894,13 @@ This regexp should match Tramp file names but no other 
file names."
   "Value for `tramp-file-name-regexp' for autoload.
 It must match the initial `tramp-syntax' settings.")
 
+;; External packages use constant `tramp-file-name-regexp'.  In order
+;; not to break them, we still provide it.  It is a variable now.
+;;;###autoload
+(defvar tramp-file-name-regexp tramp-initial-file-name-regexp
+    "Value for `tramp-file-name-regexp' for autoload.
+It must match the initial `tramp-syntax' settings.")
+
 ;;;###autoload
 (defconst tramp-completion-file-name-regexp-default
   (concat



reply via email to

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