Mercurial > emacs
comparison lispref/files.texi @ 89945:59dcbfe97385
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-17
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-417
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-419
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-420
Tweak permissions
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-421
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-430
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 29 Jun 2004 16:46:06 +0000 |
parents | 4c90ffeb71c5 6d7412bcd051 |
children | 6f6e9fe4658b |
comparison
equal
deleted
inserted
replaced
89944:ecb75580442e | 89945:59dcbfe97385 |
---|---|
327 @item | 327 @item |
328 With an argument of 0, unconditionally do @emph{not} make any backup file. | 328 With an argument of 0, unconditionally do @emph{not} make any backup file. |
329 @end itemize | 329 @end itemize |
330 @end deffn | 330 @end deffn |
331 | 331 |
332 @deffn Command save-some-buffers &optional save-silently-p pred | |
332 @anchor{Definition of save-some-buffers} | 333 @anchor{Definition of save-some-buffers} |
333 @deffn Command save-some-buffers &optional save-silently-p pred | |
334 This command saves some modified file-visiting buffers. Normally it | 334 This command saves some modified file-visiting buffers. Normally it |
335 asks the user about each buffer. But if @var{save-silently-p} is | 335 asks the user about each buffer. But if @var{save-silently-p} is |
336 non-@code{nil}, it saves all the file-visiting buffers without querying | 336 non-@code{nil}, it saves all the file-visiting buffers without querying |
337 the user. | 337 the user. |
338 | 338 |
350 a function of no arguments. It will be called in each buffer to decide | 350 a function of no arguments. It will be called in each buffer to decide |
351 whether to offer to save that buffer. If it returns a non-@code{nil} | 351 whether to offer to save that buffer. If it returns a non-@code{nil} |
352 value in a certain buffer, that means do offer to save that buffer. | 352 value in a certain buffer, that means do offer to save that buffer. |
353 @end deffn | 353 @end deffn |
354 | 354 |
355 @deffn Command write-file filename &optional confirm | |
355 @anchor{Definition of write-file} | 356 @anchor{Definition of write-file} |
356 @deffn Command write-file filename &optional confirm | |
357 This function writes the current buffer into file @var{filename}, makes | 357 This function writes the current buffer into file @var{filename}, makes |
358 the buffer visit that file, and marks it not modified. Then it renames | 358 the buffer visit that file, and marks it not modified. Then it renames |
359 the buffer based on @var{filename}, appending a string like @samp{<2>} | 359 the buffer based on @var{filename}, appending a string like @samp{<2>} |
360 if necessary to make a unique buffer name. It does most of this work by | 360 if necessary to make a unique buffer name. It does most of this work by |
361 calling @code{set-visited-file-name} (@pxref{Buffer File Name}) and | 361 calling @code{set-visited-file-name} (@pxref{Buffer File Name}) and |
415 | 415 |
416 @c Emacs 19 feature | 416 @c Emacs 19 feature |
417 @defvar write-contents-functions | 417 @defvar write-contents-functions |
418 This works just like @code{write-file-functions}, but it is intended for | 418 This works just like @code{write-file-functions}, but it is intended for |
419 hooks that pertain to the contents of the file, as opposed to hooks that | 419 hooks that pertain to the contents of the file, as opposed to hooks that |
420 pertain to where the file came from. Such hooks are usually set up by | 420 pertain to the file's name or location. Such hooks are usually set up by |
421 major modes, as buffer-local bindings for this variable. If any of the | 421 major modes, as buffer-local bindings for this variable. If any of the |
422 functions in this hook returns non-@code{nil}, @code{write-file-functions} | 422 functions in this hook returns non-@code{nil}, the file is considered |
423 is not run. | 423 already written and the rest are not called and neither are the functions |
424 in @code{write-file-functions}. | |
424 | 425 |
425 This variable automatically becomes buffer-local whenever it is set; | 426 This variable automatically becomes buffer-local whenever it is set; |
426 switching to a new major mode always resets this variable, but | 427 switching to a new major mode always resets this variable, but |
427 calling @code{set-visited-file-name} does not. | 428 calling @code{set-visited-file-name} does not. |
428 @end defvar | 429 @end defvar |
623 nor @code{nil} nor a string, then this message is inhibited. This | 624 nor @code{nil} nor a string, then this message is inhibited. This |
624 feature is useful for programs that use files for internal purposes, | 625 feature is useful for programs that use files for internal purposes, |
625 files that the user does not need to know about. | 626 files that the user does not need to know about. |
626 @end deffn | 627 @end deffn |
627 | 628 |
629 @defmac with-temp-file file body... | |
628 @anchor{Definition of with-temp-file} | 630 @anchor{Definition of with-temp-file} |
629 @defmac with-temp-file file body... | |
630 The @code{with-temp-file} macro evaluates the @var{body} forms with a | 631 The @code{with-temp-file} macro evaluates the @var{body} forms with a |
631 temporary buffer as the current buffer; then, at the end, it writes the | 632 temporary buffer as the current buffer; then, at the end, it writes the |
632 buffer contents into file @var{file}. It kills the temporary buffer | 633 buffer contents into file @var{file}. It kills the temporary buffer |
633 when finished, restoring the buffer that was current before the | 634 when finished, restoring the buffer that was current before the |
634 @code{with-temp-file} form. Then it returns the value of the last form | 635 @code{with-temp-file} form. Then it returns the value of the last form |
1122 @result{} nil | 1123 @result{} nil |
1123 @end group | 1124 @end group |
1124 @end example | 1125 @end example |
1125 @end defun | 1126 @end defun |
1126 | 1127 |
1128 @defun file-attributes filename &optional id-format | |
1127 @anchor{Definition of file-attributes} | 1129 @anchor{Definition of file-attributes} |
1128 @defun file-attributes filename &optional id-format | |
1129 This function returns a list of attributes of file @var{filename}. If | 1130 This function returns a list of attributes of file @var{filename}. If |
1130 the specified file cannot be opened, it returns @code{nil}. | 1131 the specified file cannot be opened, it returns @code{nil}. |
1131 The optional parameter @var{id-format} specifies the preferred format | 1132 The optional parameter @var{id-format} specifies the preferred format |
1132 of attributes @acronym{UID} and @acronym{GID} (see below)---the | 1133 of attributes @acronym{UID} and @acronym{GID} (see below)---the |
1133 valid values are @code{'string} and @code{'integer}. The latter is | 1134 valid values are @code{'string} and @code{'integer}. The latter is |
1821 @end defvar | 1822 @end defvar |
1822 | 1823 |
1823 To convert a directory name to its abbreviation, use this | 1824 To convert a directory name to its abbreviation, use this |
1824 function: | 1825 function: |
1825 | 1826 |
1827 @defun abbreviate-file-name filename | |
1826 @anchor{Definition of abbreviate-file-name} | 1828 @anchor{Definition of abbreviate-file-name} |
1827 @defun abbreviate-file-name filename | |
1828 This function applies abbreviations from @code{directory-abbrev-alist} | 1829 This function applies abbreviations from @code{directory-abbrev-alist} |
1829 to its argument, and substitutes @samp{~} for the user's home | 1830 to its argument, and substitutes @samp{~} for the user's home |
1830 directory. You can use it for directory names and for file names, | 1831 directory. You can use it for directory names and for file names, |
1831 because it recognizes abbreviations even as part of the name. | 1832 because it recognizes abbreviations even as part of the name. |
1832 @end defun | 1833 @end defun |
1949 @result{} "/user/lewis/manual/" | 1950 @result{} "/user/lewis/manual/" |
1950 @end group | 1951 @end group |
1951 @end example | 1952 @end example |
1952 @end defvar | 1953 @end defvar |
1953 | 1954 |
1955 @defun substitute-in-file-name filename | |
1954 @anchor{Definition of substitute-in-file-name} | 1956 @anchor{Definition of substitute-in-file-name} |
1955 @defun substitute-in-file-name filename | |
1956 This function replaces environment variable references in | 1957 This function replaces environment variable references in |
1957 @var{filename} with the environment variable values. Following | 1958 @var{filename} with the environment variable values. Following |
1958 standard Unix shell syntax, @samp{$} is the prefix to substitute an | 1959 standard Unix shell syntax, @samp{$} is the prefix to substitute an |
1959 environment variable value. If the input contains @samp{$$}, that is | 1960 environment variable value. If the input contains @samp{$$}, that is |
1960 converted to @samp{$}; this gives the user a way to ``quote'' a | 1961 converted to @samp{$}; this gives the user a way to ``quote'' a |