aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2018-12-30 17:02:40 -0800
committerGlenn Morris2018-12-30 17:02:40 -0800
commit433b6a74ec73608ff06106daee4f53c5175d5297 (patch)
tree1be58fb0808c683eb4b488a95555e2e24206ea61
parentf23b1db37a816ab88a5970e67d1aaeb7f68ca47c (diff)
parent82c82b1c773f441fe424b7ed1757c8eda31814c0 (diff)
downloademacs-433b6a74ec73608ff06106daee4f53c5175d5297.tar.gz
emacs-433b6a74ec73608ff06106daee4f53c5175d5297.zip
Merge from origin/emacs-26
82c82b1 (origin/emacs-26) In user manual fix value of default frame h... 2e8825d Improve documentation of 'file-local-name' and related APIs 11f0635 ; Remove comment in esh-proc.el # Conflicts: # lisp/simple.el
-rw-r--r--doc/emacs/cmdargs.texi2
-rw-r--r--doc/lispref/files.texi31
-rw-r--r--doc/lispref/processes.texi11
-rw-r--r--lisp/eshell/esh-proc.el1
-rw-r--r--lisp/files.el5
-rw-r--r--lisp/simple.el16
6 files changed, 47 insertions, 19 deletions
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index 960398df081..61ca827b00d 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -1034,7 +1034,7 @@ specifies a window 164 columns wide, enough for two ordinary width
1034windows side by side, and 55 lines tall. 1034windows side by side, and 55 lines tall.
1035 1035
1036 The default frame width is 80 characters and the default height is 1036 The default frame width is 80 characters and the default height is
103740 lines. You can omit either the width or the height or both. If 103736 lines. You can omit either the width or the height or both. If
1038you start the geometry with an integer, Emacs interprets it as the 1038you start the geometry with an integer, Emacs interprets it as the
1039width. If you start with an @samp{x} followed by an integer, Emacs 1039width. If you start with an @samp{x} followed by an integer, Emacs
1040interprets it as the height. Thus, @samp{81} specifies just the 1040interprets it as the height. Thus, @samp{81} specifies just the
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index d929978b6ea..21823c95694 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2512,9 +2512,9 @@ with @samp{/:}.
2512@defmac file-name-quote name 2512@defmac file-name-quote name
2513This macro adds the quotation prefix @samp{/:} to the file @var{name}. 2513This macro adds the quotation prefix @samp{/:} to the file @var{name}.
2514For a local file @var{name}, it prefixes @var{name} with @samp{/:}. 2514For a local file @var{name}, it prefixes @var{name} with @samp{/:}.
2515If @var{name} is a remote file name, the local part of @var{name} is 2515If @var{name} is a remote file name, the local part of @var{name}
2516quoted. If @var{name} is already a quoted file name, @var{name} is 2516(@pxref{Magic File Names}) is quoted. If @var{name} is already a
2517returned unchanged. 2517quoted file name, @var{name} is returned unchanged.
2518 2518
2519@example 2519@example
2520@group 2520@group
@@ -2693,8 +2693,8 @@ that remote host. If such a directory does not exist, or
2693@code{temporary-file-directory} is returned. 2693@code{temporary-file-directory} is returned.
2694@end defun 2694@end defun
2695 2695
2696In order to extract the local part of the path name from a temporary 2696In order to extract the local part of the file's name of a temporary
2697file, @code{file-local-name} could be used. 2697file, use @code{file-local-name} (@pxref{Magic File Names}).
2698 2698
2699@node File Name Completion 2699@node File Name Completion
2700@subsection File Name Completion 2700@subsection File Name Completion
@@ -3385,11 +3385,24 @@ non-magic directory to serve as its current directory, and this function
3385is a good way to come up with one. 3385is a good way to come up with one.
3386@end defun 3386@end defun
3387 3387
3388@cindex local part of remote file name
3388@defun file-local-name filename 3389@defun file-local-name filename
3389This function returns the local part of file @var{filename}. For a 3390This function returns the @dfn{local part} of @var{filename}. This is
3390remote @var{filename}, it returns a file name which could be used 3391the part of the file's name that identifies it on the remote host, and
3391directly as argument of a remote process. If @var{filename} is local, 3392is typically obtained by removing from the remote file name the parts
3392this function returns the file name. 3393that specify the remote host and the method of accessing it. For
3394example:
3395
3396@smallexample
3397(file-local-name "/ssh:@var{user}@@@var{host}:/foo/bar")
3398 @result{} "/foo/bar"
3399@end smallexample
3400
3401For a remote @var{filename}, this function returns a file name which
3402could be used directly as an argument of a remote process
3403(@pxref{Asynchronous Processes}, and @pxref{Synchronous Processes}),
3404and as the program to run on the remote host. If @var{filename} is
3405local, this function returns it unchanged.
3393@end defun 3406@end defun
3394 3407
3395@defopt remote-file-name-inhibit-cache 3408@defopt remote-file-name-inhibit-cache
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 88b0382b7d1..13544298b6e 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -459,7 +459,9 @@ present in @var{args}. To avoid confusion, it may be best to avoid
459absolute file names in @var{args}, but rather to specify all file 459absolute file names in @var{args}, but rather to specify all file
460names as relative to @code{default-directory}. The function 460names as relative to @code{default-directory}. The function
461@code{file-relative-name} is useful for constructing such relative 461@code{file-relative-name} is useful for constructing such relative
462file names. 462file names. Alternatively, you can use @code{file-local-name}
463(@pxref{Magic File Names}) to obtain an absolute file name as seen
464from the remote host's perspective.
463@end defun 465@end defun
464 466
465@defvar process-file-side-effects 467@defvar process-file-side-effects
@@ -842,7 +844,12 @@ In the latter case, the local part of @code{default-directory} becomes
842the working directory of the process. 844the working directory of the process.
843 845
844This function does not try to invoke file name handlers for 846This function does not try to invoke file name handlers for
845@var{program} or for the rest of @var{args}. 847@var{program} or for the rest of @var{args}. For that reason, if
848@var{program} or any of @var{args} use the remote-file syntax
849(@pxref{Magic File Names}), they must be converted either to file
850names relative to @code{default-directory}, or to names that identify
851the files locally on the remote host, by running them through
852@code{file-local-name}.
846 853
847Depending on the implementation of the file name handler, it might not be 854Depending on the implementation of the file name handler, it might not be
848possible to apply @code{process-filter} or @code{process-sentinel} to 855possible to apply @code{process-filter} or @code{process-sentinel} to
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el
index 3735f30c304..384846c7a3c 100644
--- a/lisp/eshell/esh-proc.el
+++ b/lisp/eshell/esh-proc.el
@@ -282,7 +282,6 @@ See `eshell-needs-pipe'."
282 (let ((process-connection-type 282 (let ((process-connection-type
283 (unless (eshell-needs-pipe-p command) 283 (unless (eshell-needs-pipe-p command)
284 process-connection-type)) 284 process-connection-type))
285 ;; `start-process' can't deal with relative filenames.
286 (command (file-local-name (expand-file-name command)))) 285 (command (file-local-name (expand-file-name command))))
287 (apply 'start-file-process 286 (apply 'start-file-process
288 (file-name-nondirectory command) nil command args))) 287 (file-name-nondirectory command) nil command args)))
diff --git a/lisp/files.el b/lisp/files.el
index fb09c96c47e..0dd597efe11 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1173,7 +1173,10 @@ consecutive checks. For example:
1173 1173
1174(defun file-local-name (file) 1174(defun file-local-name (file)
1175 "Return the local name component of FILE. 1175 "Return the local name component of FILE.
1176It returns a file name which can be used directly as argument of 1176This function removes from FILE the specification of the remote host
1177and the method of accessing the host, leaving only the part that
1178identifies FILE locally on the remote system.
1179The returned file name can be used directly as argument of
1177`process-file', `start-file-process', or `shell-command'." 1180`process-file', `start-file-process', or `shell-command'."
1178 (or (file-remote-p file 'localname) file)) 1181 (or (file-remote-p file 'localname) file))
1179 1182
diff --git a/lisp/simple.el b/lisp/simple.el
index 0281464c61f..241f5ece3d0 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3892,11 +3892,14 @@ interactively, this is t."
3892 (shell-command command t)))) 3892 (shell-command command t))))
3893 3893
3894(defun process-file (program &optional infile buffer display &rest args) 3894(defun process-file (program &optional infile buffer display &rest args)
3895 "Process files synchronously in a separate process. 3895 "Process files synchronously in a separate process that runs PROGRAM.
3896Similar to `call-process', but may invoke a file name handler based on 3896Similar to `call-process', but may invoke a file name handler based on
3897`default-directory'. The current working directory of the 3897`default-directory'. The current working directory of the
3898subprocess is `default-directory'. 3898subprocess is `default-directory'.
3899 3899
3900If PROGRAM is a remote file name, it should be processed
3901by `file-local-name' before passing it to this function.
3902
3900File names in INFILE and BUFFER are handled normally, but file 3903File names in INFILE and BUFFER are handled normally, but file
3901names in ARGS should be relative to `default-directory', as they 3904names in ARGS should be relative to `default-directory', as they
3902are passed to the process verbatim. (This is a difference to 3905are passed to the process verbatim. (This is a difference to
@@ -3941,12 +3944,15 @@ Similar to `start-process', but may invoke a file name handler based on
3941 3944
3942This handler ought to run PROGRAM, perhaps on the local host, 3945This handler ought to run PROGRAM, perhaps on the local host,
3943perhaps on a remote host that corresponds to `default-directory'. 3946perhaps on a remote host that corresponds to `default-directory'.
3944In the latter case, the local part of `default-directory' becomes 3947In the latter case, the local part of `default-directory', the one
3945the working directory of the process. 3948produced from it by `file-local-name', becomes the working directory
3949of the process on the remote host.
3946 3950
3947PROGRAM and PROGRAM-ARGS might be file names. They are not 3951PROGRAM and PROGRAM-ARGS might be file names. They are not
3948objects of file name handler invocation. File name handlers might not 3952objects of file name handler invocation, so they need to be obtained
3949support pty association, if PROGRAM is nil." 3953by calling `file-local-name', in case they are remote file names.
3954
3955File name handlers might not support pty association, if PROGRAM is nil."
3950 (let ((fh (find-file-name-handler default-directory 'start-file-process))) 3956 (let ((fh (find-file-name-handler default-directory 'start-file-process)))
3951 (if fh (apply fh 'start-file-process name buffer program program-args) 3957 (if fh (apply fh 'start-file-process name buffer program program-args)
3952 (apply 'start-process name buffer program program-args)))) 3958 (apply 'start-process name buffer program program-args))))