diff options
| author | Luc Teirlinck | 2004-06-13 21:23:24 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2004-06-13 21:23:24 +0000 |
| commit | 66c6d25eeae930e3f95d955c81bb5f78eeacb906 (patch) | |
| tree | 353955135c48e839585523e6442fd0be441c44f0 | |
| parent | 2f9edc8be5e26b08bfbe1fe8569ad110cbf21892 (diff) | |
| download | emacs-66c6d25eeae930e3f95d955c81bb5f78eeacb906.tar.gz emacs-66c6d25eeae930e3f95d955c81bb5f78eeacb906.zip | |
(time-stamp): Recommend adding it to `before-save-hook', rather than
`write-file-functions'.
Make a similar change in `Commentary' section.
| -rw-r--r-- | lisp/time-stamp.el | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index b6e76ee5394..42231916f95 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | ;; This file is part of GNU Emacs. | 6 | ;; This file is part of GNU Emacs. |
| 7 | 7 | ||
| 8 | ;; Maintainer's Time-stamp: <2003-02-01 09:26:25 gildea> | 8 | ;; Maintainer's Time-stamp: <2004-06-13 14:22:25 teirllm> |
| 9 | ;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org> | 9 | ;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org> |
| 10 | ;; Keywords: tools | 10 | ;; Keywords: tools |
| 11 | 11 | ||
| @@ -32,7 +32,7 @@ | |||
| 32 | ;; See the top of `time-stamp.el' for another example. | 32 | ;; See the top of `time-stamp.el' for another example. |
| 33 | 33 | ||
| 34 | ;; To use time-stamping, add this line to your .emacs file: | 34 | ;; To use time-stamping, add this line to your .emacs file: |
| 35 | ;; (add-hook 'write-file-hooks 'time-stamp) | 35 | ;; (add-hook 'before-save-hook 'time-stamp) |
| 36 | ;; Now any time-stamp templates in your files will be updated automatically. | 36 | ;; Now any time-stamp templates in your files will be updated automatically. |
| 37 | 37 | ||
| 38 | ;; See the documentation for the functions `time-stamp' | 38 | ;; See the documentation for the functions `time-stamp' |
| @@ -242,7 +242,7 @@ of the time-stamped file itself.") | |||
| 242 | "Update the time stamp string(s) in the buffer. | 242 | "Update the time stamp string(s) in the buffer. |
| 243 | A template in a file can be automatically updated with a new time stamp | 243 | A template in a file can be automatically updated with a new time stamp |
| 244 | every time you save the file. Add this line to your .emacs file: | 244 | every time you save the file. Add this line to your .emacs file: |
| 245 | (add-hook 'write-file-hooks 'time-stamp) | 245 | (add-hook 'before-save-hook 'time-stamp) |
| 246 | Normally the template must appear in the first 8 lines of a file and | 246 | Normally the template must appear in the first 8 lines of a file and |
| 247 | look like one of the following: | 247 | look like one of the following: |
| 248 | Time-stamp: <> | 248 | Time-stamp: <> |
| @@ -318,7 +318,6 @@ template." | |||
| 318 | (setq start (time-stamp-once start search-limit ts-start ts-end | 318 | (setq start (time-stamp-once start search-limit ts-start ts-end |
| 319 | ts-format format-lines end-lines)) | 319 | ts-format format-lines end-lines)) |
| 320 | (setq ts-count (1- ts-count)))) | 320 | (setq ts-count (1- ts-count)))) |
| 321 | ;; be sure to return nil so can be used on write-file-hooks | ||
| 322 | nil) | 321 | nil) |
| 323 | 322 | ||
| 324 | (defun time-stamp-once (start search-limit ts-start ts-end | 323 | (defun time-stamp-once (start search-limit ts-start ts-end |