456 |
that is updated too. |
that is updated too. |
457 |
|
|
458 |
An interesting application for this function is to have it be called |
An interesting application for this function is to have it be called |
459 |
automatically every time a file is saved. This is accomplished by putting |
automatically every time a file is saved. This is accomplished by |
460 |
@code{(add-hook 'write-file-functions 'copyright-update)} into your @file{~/.emacs} |
putting @code{(add-hook 'before-save-hook 'copyright-update)} into |
461 |
file (@pxref{(emacs)Init File}). |
your @file{~/.emacs} file (@pxref{(emacs)Init File}). Alternative, |
462 |
|
you can do @kbd{M-x customize-variable @key{RET} before-save-hook |
463 |
|
@key{RET}}. @code{copyright-update} is conveniently listed as an |
464 |
|
option in the customization buffer. |
465 |
|
|
466 |
@vindex copyright-query |
@vindex copyright-query |
467 |
The variable @code{copyright-query} controls whether to update the |
The variable @code{copyright-query} controls whether to update the |
468 |
copyright or whether to ask about it. When this is @code{nil} updating is |
copyright or whether to ask about it. When this is @code{nil} updating is |
469 |
only done with @kbd{M-x copyright-update}. When this is @code{function} |
only done with @kbd{M-x copyright-update}. When this is @code{function} |
470 |
you are queried whenever @code{copyright-update} is called as a function, |
you are queried whenever @code{copyright-update} is called as a function, |
471 |
such as in the @code{write-file-functions} feature mentioned above. Otherwise |
such as in the @code{before-save-hook} feature mentioned above. Otherwise |
472 |
you are always queried. |
you are always queried. |
473 |
|
|
474 |
|
|
525 |
@cindex timestamps |
@cindex timestamps |
526 |
|
|
527 |
@findex time-stamp |
@findex time-stamp |
528 |
@vindex write-file-functions |
@vindex before-save-hook |
529 |
The @code{time-stamp} command can be used to update automatically a |
The @code{time-stamp} command can be used to update automatically a |
530 |
template in a file with a new time stamp every time you save the file. |
template in a file with a new time stamp every time you save the file. |
531 |
Customize the hook @code{write-file-functions} to add the function |
Customize the hook @code{before-save-hook} to add the function |
532 |
@code{time-stamp} to arrange this. |
@code{time-stamp} to arrange this. It you use Custom to do this, |
533 |
|
then @code{time-stamp} is conveniently listed as an option in the |
534 |
|
customization buffer. |
535 |
|
|
536 |
@vindex time-stamp-active |
@vindex time-stamp-active |
537 |
@vindex time-stamp-format |
@vindex time-stamp-format |