Overview

The function insert-file-contents:

  • initially, inserts bytes from the file into the buffer;
  • decodes bytes to characters as appropriate;
  • processes formats as defined by entries in format-alist; and
  • calls functions in after-insert-file-functions.

The function write-region:

  • initially, calls functions in write-region-annotate-functions;
  • processes formats as defined by entries in format-alist;
  • encodes characters to bytes as appropriate; and
  • modifies the file with the bytes.

This shows the symmetry of the lowest-level operations; reading and writing handle things in opposite order. The rest of this section describes the two facilities surrounding the three variables named above, as well as some related functions. Coding Systems, for details on character encoding and decoding.

Copyright © 1990-1996, 1998-2021 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
https://www.gnu.org/software/emacs/manual/html_node/elisp/Format-Conversion-Overview.html