Mercurial > emacs
comparison lispref/files.texi @ 60444:78a2cd972ba1
(Writing to Files): Get rid of "Emacs 21".
(Unique File Names): Likewise.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 06 Mar 2005 18:14:33 +0000 |
parents | 36a927615e6d |
children | d9c520f08ec6 29e773288013 |
comparison
equal
deleted
inserted
replaced
60443:055a220b8a69 | 60444:78a2cd972ba1 |
---|---|
576 If @var{start} is a string, then @code{write-region} writes or appends | 576 If @var{start} is a string, then @code{write-region} writes or appends |
577 that string, rather than text from the buffer. @var{end} is ignored in | 577 that string, rather than text from the buffer. @var{end} is ignored in |
578 this case. | 578 this case. |
579 | 579 |
580 If @var{append} is non-@code{nil}, then the specified text is appended | 580 If @var{append} is non-@code{nil}, then the specified text is appended |
581 to the existing file contents (if any). Starting in Emacs 21, if | 581 to the existing file contents (if any). If @var{append} is an |
582 @var{append} is an integer, then @code{write-region} seeks to that byte | 582 integer, @code{write-region} seeks to that byte offset from the start |
583 offset from the start of the file and writes the data from there. | 583 of the file and writes the data from there. |
584 | 584 |
585 If @var{mustbenew} is non-@code{nil}, then @code{write-region} asks | 585 If @var{mustbenew} is non-@code{nil}, then @code{write-region} asks |
586 for confirmation if @var{filename} names an existing file. | 586 for confirmation if @var{filename} names an existing file. If |
587 Starting in Emacs 21, if @var{mustbenew} is the symbol @code{excl}, | 587 @var{mustbenew} is the symbol @code{excl}, then @code{write-region} |
588 then @code{write-region} does not ask for confirmation, but instead | 588 does not ask for confirmation, but instead it signals an error |
589 it signals an error @code{file-already-exists} if the file already | 589 @code{file-already-exists} if the file already exists. |
590 exists. | |
591 | 590 |
592 The test for an existing file, when @var{mustbenew} is @code{excl}, uses | 591 The test for an existing file, when @var{mustbenew} is @code{excl}, uses |
593 a special system feature. At least for files on a local disk, there is | 592 a special system feature. At least for files on a local disk, there is |
594 no chance that some other program could create a file of the same name | 593 no chance that some other program could create a file of the same name |
595 before Emacs does, without Emacs's noticing. | 594 before Emacs does, without Emacs's noticing. |
2011 | 2010 |
2012 @node Unique File Names | 2011 @node Unique File Names |
2013 @subsection Generating Unique File Names | 2012 @subsection Generating Unique File Names |
2014 | 2013 |
2015 Some programs need to write temporary files. Here is the usual way to | 2014 Some programs need to write temporary files. Here is the usual way to |
2016 construct a name for such a file, starting in Emacs 21: | 2015 construct a name for such a file: |
2017 | 2016 |
2018 @example | 2017 @example |
2019 (make-temp-file @var{name-of-application}) | 2018 (make-temp-file @var{name-of-application}) |
2020 @end example | 2019 @end example |
2021 | 2020 |
2104 non-@code{nil}. | 2103 non-@code{nil}. |
2105 @end defvar | 2104 @end defvar |
2106 | 2105 |
2107 @tindex small-temporary-file-directory | 2106 @tindex small-temporary-file-directory |
2108 @defvar small-temporary-file-directory | 2107 @defvar small-temporary-file-directory |
2109 This variable (new in Emacs 21) specifies the directory name for | 2108 This variable specifies the directory name for |
2110 creating certain temporary files, which are likely to be small. | 2109 creating certain temporary files, which are likely to be small. |
2111 | 2110 |
2112 If you want to write a temporary file which is likely to be small, you | 2111 If you want to write a temporary file which is likely to be small, you |
2113 should compute the directory like this: | 2112 should compute the directory like this: |
2114 | 2113 |