The Emacs command C-x 4 a adds a new entry to the change log
file for the file you are editing
add-change-log-entry-other-window). If that file is actually
a backup file, it makes an entry appropriate for the file's
parent—that is useful for making log entries for functions that
have been deleted in the current version.
C-x 4 a visits the change log file and creates a new entry unless the most recent entry is for today's date and your name. It also creates a new item for the current file. For many languages, it can even guess the name of the function or other object that was changed.
To find the change log file, Emacs searches up the directory tree from
the file you are editing. By default, it stops if it finds a
directory that seems to be the root of a version-control repository.
To change this, customize
When the variable
nil, C-x 4 a adds to any existing item for the file,
rather than starting a new item.
You can combine multiple changes of the same nature. If you don't enter any text after the initial C-x 4 a, any subsequent C-x 4 a adds another symbol to the change log entry.
add-log-always-start-new-record is non-
C-x 4 a always makes a new entry, even if the last entry
was made by you and on the same date.
If the value of the variable
nil, C-x 4 a adds the file's version number to the
change log entry. It finds the version number by searching the first
ten percent of the file, using regular expressions from the variable
The change log file is visited in Change Log mode. In this major mode, each bunch of grouped items counts as one paragraph, and each entry is considered a page. This facilitates editing the entries. C-j and auto-fill indent each new line like the previous line; this is convenient for entering the contents of an entry.
You can use the
next-error command (by default bound to
C-x `) to move between entries in the Change Log, when Change
Log mode is on. You will jump to the actual site in the file that was
changed, not just to the next Change Log entry. You can also use
previous-error to move back in the same list.
You can use the command M-x change-log-merge to merge other log files into a buffer in Change Log Mode, preserving the date ordering of entries.
Version control systems are another way to keep track of changes in
your program and keep a change log. In the VC log buffer, typing
C-c C-a (
log-edit-insert-changelog) inserts the relevant
Change Log entry, if one exists. See Log Buffer.