Next: , Previous: , Up: Writing to Files   [Index]


7.3.5.2 write-region

Function: write-region start end filename &optional append visit lockname mustbenew

This function writes the region delimited by START and END in the current buffer into the file specified by FILENAME.

If START is ‘nil’, then the command writes the entire buffer contents (_not_ just the accessible portion) to the file and ignores END.

If START is a string, then ‘write-region’ writes or appends that string, rather than text from the buffer. END is ignored in this case.

If APPEND is non-‘nil’, then the specified text is appended to the existing file contents (if any). If APPEND is a number, ‘write-region’ seeks to that byte offset from the start of the file and writes the data from there.