5 |
|
|
6 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
7 |
|
|
8 |
;; Maintainer's Time-stamp: <2003-02-01 09:26:25 gildea> |
;; Maintainer's Time-stamp: <2004-06-13 14:22:25 teirllm> |
9 |
;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org> |
;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org> |
10 |
;; Keywords: tools |
;; Keywords: tools |
11 |
|
|
32 |
;; See the top of `time-stamp.el' for another example. |
;; See the top of `time-stamp.el' for another example. |
33 |
|
|
34 |
;; To use time-stamping, add this line to your .emacs file: |
;; To use time-stamping, add this line to your .emacs file: |
35 |
;; (add-hook 'write-file-hooks 'time-stamp) |
;; (add-hook 'before-save-hook 'time-stamp) |
36 |
;; Now any time-stamp templates in your files will be updated automatically. |
;; Now any time-stamp templates in your files will be updated automatically. |
37 |
|
|
38 |
;; See the documentation for the functions `time-stamp' |
;; See the documentation for the functions `time-stamp' |
242 |
"Update the time stamp string(s) in the buffer. |
"Update the time stamp string(s) in the buffer. |
243 |
A template in a file can be automatically updated with a new time stamp |
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: |
every time you save the file. Add this line to your .emacs file: |
245 |
(add-hook 'write-file-hooks 'time-stamp) |
(add-hook 'before-save-hook 'time-stamp) |
246 |
Normally the template must appear in the first 8 lines of a file and |
Normally the template must appear in the first 8 lines of a file and |
247 |
look like one of the following: |
look like one of the following: |
248 |
Time-stamp: <> |
Time-stamp: <> |
318 |
(setq start (time-stamp-once start search-limit ts-start ts-end |
(setq start (time-stamp-once start search-limit ts-start ts-end |
319 |
ts-format format-lines end-lines)) |
ts-format format-lines end-lines)) |
320 |
(setq ts-count (1- ts-count)))) |
(setq ts-count (1- ts-count)))) |
|
;; be sure to return nil so can be used on write-file-hooks |
|
321 |
nil) |
nil) |
322 |
|
|
323 |
(defun time-stamp-once (start search-limit ts-start ts-end |
(defun time-stamp-once (start search-limit ts-start ts-end |