GNU Info

Info Node: (autotype)Copyrights

(autotype)Copyrights


Next: Executables Prev: Autoinserting Up: Top
Enter node , (file) or (file)node

Inserting and Updating Copyrights
*********************************

   `M-x copyright' is a skeleton inserting command, that adds a
copyright notice at the point.  The "by" part is taken from your
environment variable `$ORGANIZATION' or if that isn't set you are
prompted for it.  If the buffer has a comment syntax (Note:
(emacs)Comments), this is inserted as a comment.

   `M-x copyright-update' looks for a copyright notice in the first
`copyright-limit' characters of the buffer and updates it when
necessary.  The current year (variable `copyright-current-year') is
added to the existing ones, in the same format as the preceding year,
i.e. 1994, '94 or 94.  If a dash-separated year list up to last year is
found, that is extended to current year, else the year is added
separated by a comma.  Or it replaces them when this is called with a
prefix argument.  If a header referring to a wrong version of the GNU
General Public License (Note: (emacs)Copying) is found, that is
updated too.

   An interesting application for this function is to have it be called
automatically every time a file is saved.  This is accomplished by
putting `(add-hook 'write-file-hooks 'copyright-update)' into your
`~/.emacs' file (Note: (emacs)Init File).

   The variable `copyright-query' controls whether to update the
copyright or whether to ask about it.  When this is `nil' updating is
only done with `M-x copyright-update'.  When this is `function' you are
queried whenever `copyright-update' is called as a function, such as in
the `write-file-hooks' feature mentioned above.  Otherwise you are
always queried.


automatically generated by info2www version 1.2.2.9