X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/bbbabffe06d4c763534d5be92844c48a3f8746e2..eaa8c21089bd18af88dff80ae92c5eedcf3d7dda:/doc/lispref/files.texi diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 64ed3a05ee..ac77b94d8f 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -254,11 +254,16 @@ is permanent local, so it is unaffected by changes of major modes. which are sometimes useful in user Lisp code: @code{create-file-buffer} and @code{after-find-file}. This section explains how to use them. +@c FIXME This does not describe the default behavior, because +@c uniquify is enabled by default and advises this function. +@c This is confusing. uniquify should be folded into the function proper. @defun create-file-buffer filename This function creates a suitably named buffer for visiting @var{filename}, and returns it. It uses @var{filename} (sans directory) as the name if that name is free; otherwise, it appends a string such as @samp{<2>} to get an unused name. See also @ref{Creating Buffers}. +Note that the @file{uniquify} library affects the result of this +function. @xref{Uniquify,,, emacs, The GNU Emacs Manual}. @strong{Please note:} @code{create-file-buffer} does @emph{not} associate the new buffer with a file and does not select the buffer. @@ -1688,6 +1693,16 @@ version of an existing file; saving a file preserves its existing permissions. @end defun +@defmac with-file-modes mode body@dots{} +This macro evaluates the @var{body} forms with the default +permissions for new files temporarily set to @var{modes} (whose value +is as for @code{set-file-modes} above). When finished, it restores +the original default file permissions, and returns the value of the +last form in @var{body}. + +This is useful for creating private files, for example. +@end defmac + @defun default-file-modes This function returns the default file permissions, as an integer. @end defun