[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 417a8ed8b0: ; Improve discoverability of empty file names handl
From: |
Eli Zaretskii |
Subject: |
emacs-29 417a8ed8b0: ; Improve discoverability of empty file names handling |
Date: |
Thu, 9 Feb 2023 09:08:04 -0500 (EST) |
branch: emacs-29
commit 417a8ed8b05845090340c7ce9fd5493087a66839
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
; Improve discoverability of empty file names handling
* doc/lispref/files.texi (Relative File Names)
(Testing Accessibility, File Name Expansion): Document and index
the behavior with empty strings as file names.
---
doc/lispref/files.texi | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 707af6ee64..5062b1697b 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -895,6 +895,12 @@ permissions of the file itself.)
If the file does not exist, or if there was trouble determining
whether the file exists, this function returns @code{nil}.
+@cindex empty file name, and @code{file-exists-p}
+Since a file name that is an empty string is interpreted relative to
+the current buffer's default directory (@pxref{Relative File Names}),
+calling @code{file-exists-p} with an argument that is an empty string
+will report about the buffer's default directory.
+
@cindex dangling symlinks, testing for existence
Directories are files, so @code{file-exists-p} can return @code{t}
when given a directory. However, because @code{file-exists-p} follows
@@ -2338,6 +2344,10 @@ form.
@end example
@end defun
+@cindex empty file name
+ A file name that is an empty string stands for the current buffer's
+default directory.
+
@node Directory Names
@subsection Directory Names
@cindex directory name
@@ -2527,6 +2537,7 @@ This is for the sake of filesystems that have the concept
of a
superroot above the root directory @file{/}. On other filesystems,
@file{/../} is interpreted exactly the same as @file{/}.
+@cindex empty file names, and @code{expand-file-name}
Expanding @file{.} or the empty string returns the default directory:
@example
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 417a8ed8b0: ; Improve discoverability of empty file names handling,
Eli Zaretskii <=