Function: append-to-file

append-to-file is an interactive and byte-compiled function defined in files.el.gz.

Signature

(append-to-file START END FILENAME)

Documentation

Append the contents of the region to the end of file FILENAME.

When called from a function, expects three arguments, START, END and FILENAME. START and END are normally buffer positions specifying the part of the buffer to write. If START is nil, that means to use the entire buffer contents. If START is a string, then output that string to the file instead of any buffer contents; END is ignored.

This does character code conversion and applies annotations like write-region does.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun append-to-file (start end filename)
  "Append the contents of the region to the end of file FILENAME.
When called from a function, expects three arguments,
START, END and FILENAME.  START and END are normally buffer positions
specifying the part of the buffer to write.
If START is nil, that means to use the entire buffer contents.
If START is a string, then output that string to the file
instead of any buffer contents; END is ignored.

This does character code conversion and applies annotations
like `write-region' does."
  (interactive "r\nFAppend to file: ")
  (prog1 (write-region start end filename t)
    (when save-silently (message nil))))