aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMichael Albinus2016-11-20 16:29:47 +0100
committerMichael Albinus2016-11-20 16:29:47 +0100
commit22946702b4296c0e42e4baf6221e205b52d05cbf (patch)
treea81e506e5176351677c8f677e32cde6236d1b070 /doc
parent26c45889259682af0fbf05bccf7f084408860125 (diff)
downloademacs-22946702b4296c0e42e4baf6221e205b52d05cbf.tar.gz
emacs-22946702b4296c0e42e4baf6221e205b52d05cbf.zip
Add file-local-name
* doc/lispref/files.texi (Magic File Names): Add `file-local-name'. (Unique File Names): Use it. * etc/NEWS: Mention `file-local-name'. * lisp/files.el (file-local-name): New defun. (file-expand-wildcards): * lisp/eshell/em-tramp.el (eshell/su, eshell/sudo): * lisp/eshell/esh-ext.el (eshell-remote-command): * lisp/eshell/esh-proc.el (eshell-gather-process-output): * lisp/org/ob-core.el (org-babel-local-file-name): * lisp/progmodes/gud.el (gud-common-init, gud-format-command): * lisp/progmodes/python.el (python-shell-send-file): * lisp/shell.el (shell): * lisp/vc/ediff-diff.el (ediff-same-file-contents): * lisp/vc/vc-git.el (vc-git-checkin): Use it.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/files.texi16
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index e189da9fbe2..d9e366be1ba 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2546,14 +2546,7 @@ that remote host. If such a directory does not exist, or
2546@end defun 2546@end defun
2547 2547
2548In order to extract the local part of the path name from a temporary 2548In order to extract the local part of the path name from a temporary
2549file, the following code could be used: 2549file, @code{file-local-name} could be used.
2550
2551@example
2552@group
2553(let ((tmpfile (make-nearby-temp-file "foo")))
2554 (or (file-remote-p tmpfile 'localname) tmpfile))
2555@end group
2556@end example
2557 2550
2558@node File Name Completion 2551@node File Name Completion
2559@subsection File Name Completion 2552@subsection File Name Completion
@@ -3233,6 +3226,13 @@ non-magic directory to serve as its current directory, and this function
3233is a good way to come up with one. 3226is a good way to come up with one.
3234@end defun 3227@end defun
3235 3228
3229@defun file-local-name filename
3230This function returns the local part of file @var{filename}. For a
3231remote @var{filename}, it returns a file name which could be used
3232directly as argument of a remote process. If @var{filename} is local,
3233this function returns the file name.
3234@end defun
3235
3236@defopt remote-file-name-inhibit-cache 3236@defopt remote-file-name-inhibit-cache
3237The attributes of remote files can be cached for better performance. If 3237The attributes of remote files can be cached for better performance. If
3238they are changed outside of Emacs's control, the cached values become 3238they are changed outside of Emacs's control, the cached values become