5 |
|
|
6 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
7 |
|
|
8 |
;; Maintainer's Time-stamp: <2004-06-13 19:04:36 teirllm> |
;; Maintainer's Time-stamp: <2004-09-25 20:55:35 gildea> |
9 |
;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org> |
;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org> |
10 |
;; Keywords: tools |
;; Keywords: tools |
11 |
|
|
143 |
file to be time-stamped by \\[time-stamp]. A value of 0 searches the |
file to be time-stamped by \\[time-stamp]. A value of 0 searches the |
144 |
entire buffer (use with care). |
entire buffer (use with care). |
145 |
|
|
146 |
Do not change `time-stamp-line-limit', `time-stamp-start', or |
This value can also be set with the variable `time-stamp-pattern'. |
147 |
`time-stamp-end' for yourself or you will be incompatible |
|
148 |
with other people's files! If you must change them for some application, |
Do not change `time-stamp-line-limit', `time-stamp-start', |
149 |
do so in the local variables section of the time-stamped file itself.") |
`time-stamp-end', or `time-stamp-pattern' for yourself or you will be |
150 |
|
incompatible with other people's files! If you must change them for some |
151 |
|
application, do so in the local variables section of the time-stamped file |
152 |
|
itself.") |
153 |
|
|
154 |
|
|
155 |
(defvar time-stamp-start "Time-stamp:[ \t]+\\\\?[\"<]+" ;Do not change! |
(defvar time-stamp-start "Time-stamp:[ \t]+\\\\?[\"<]+" ;Do not change! |
156 |
"Regexp after which the time stamp is written by \\[time-stamp]. |
"Regexp after which the time stamp is written by \\[time-stamp]. |
157 |
See also the variables `time-stamp-end' and `time-stamp-line-limit'. |
See also the variables `time-stamp-end' and `time-stamp-line-limit'. |
158 |
|
|
159 |
Do not change `time-stamp-line-limit', `time-stamp-start', or |
This value can also be set with the variable `time-stamp-pattern'. |
160 |
`time-stamp-end' for yourself or you will be incompatible |
|
161 |
with other people's files! If you must change them for some application, |
Do not change `time-stamp-line-limit', `time-stamp-start', |
162 |
do so in the local variables section of the time-stamped file itself.") |
`time-stamp-end', or `time-stamp-pattern' for yourself or you will be |
163 |
|
incompatible with other people's files! If you must change them for some |
164 |
|
application, do so in the local variables section of the time-stamped file |
165 |
|
itself.") |
166 |
|
|
167 |
|
|
168 |
(defvar time-stamp-end "\\\\?[\">]" ;Do not change! |
(defvar time-stamp-end "\\\\?[\">]" ;Do not change! |
171 |
and the following match of `time-stamp-end', then writes the |
and the following match of `time-stamp-end', then writes the |
172 |
time stamp specified by `time-stamp-format' between them. |
time stamp specified by `time-stamp-format' between them. |
173 |
|
|
174 |
|
This value can also be set with the variable `time-stamp-pattern'. |
175 |
|
|
176 |
The end text normally starts on the same line as the start text ends, |
The end text normally starts on the same line as the start text ends, |
177 |
but if there are any newlines in `time-stamp-format', the same number |
but if there are any newlines in `time-stamp-format', the same number |
178 |
of newlines must separate the start and end. \\[time-stamp] tries |
of newlines must separate the start and end. \\[time-stamp] tries |
179 |
to not change the number of lines in the buffer. `time-stamp-inserts-lines' |
to not change the number of lines in the buffer. `time-stamp-inserts-lines' |
180 |
controls this behavior. |
controls this behavior. |
181 |
|
|
182 |
Do not change `time-stamp-line-limit', `time-stamp-start', `time-stamp-end', |
Do not change `time-stamp-start', `time-stamp-end', `time-stamp-pattern', |
183 |
or `time-stamp-inserts-lines' for yourself or you will be incompatible |
or `time-stamp-inserts-lines' for yourself or you will be incompatible |
184 |
with other people's files! If you must change them for some application, |
with other people's files! If you must change them for some application, |
185 |
do so in the local variables section of the time-stamped file itself.") |
do so in the local variables section of the time-stamped file itself.") |
239 |
\"@set Time-stamp: %:b %:d, %:y$\" |
\"@set Time-stamp: %:b %:d, %:y$\" |
240 |
\"newcommand{\\\\\\\\timestamp}{%%}\" |
\"newcommand{\\\\\\\\timestamp}{%%}\" |
241 |
|
|
242 |
Do not change `time-stamp-pattern' for yourself or you will be incompatible |
Do not change `time-stamp-pattern' `time-stamp-line-limit', |
243 |
with other people's files! Set it only in the local variables section |
`time-stamp-start', or `time-stamp-end' for yourself or you will be |
244 |
of the time-stamped file itself.") |
incompatible with other people's files! If you must change them for |
245 |
|
some application, do so only in the local variables section of the |
246 |
|
time-stamped file itself.") |
247 |
|
|
248 |
|
|
249 |
|
|
261 |
The time stamp is written between the brackets or quotes: |
The time stamp is written between the brackets or quotes: |
262 |
Time-stamp: <2001-02-18 10:20:51 gildea> |
Time-stamp: <2001-02-18 10:20:51 gildea> |
263 |
The time stamp is updated only if the variable `time-stamp-active' is non-nil. |
The time stamp is updated only if the variable `time-stamp-active' is non-nil. |
264 |
The format of the time stamp is set by the variable `time-stamp-format'. |
The format of the time stamp is set by the variable `time-stamp-pattern' or |
265 |
The variables `time-stamp-line-limit', `time-stamp-start', `time-stamp-end', |
`time-stamp-format'. The variables `time-stamp-pattern', |
266 |
`time-stamp-count', and `time-stamp-inserts-lines' control finding the |
`time-stamp-line-limit', `time-stamp-start', `time-stamp-end', |
267 |
template." |
`time-stamp-count', and `time-stamp-inserts-lines' control finding |
268 |
|
the template." |
269 |
(interactive) |
(interactive) |
270 |
(let ((line-limit time-stamp-line-limit) |
(let ((line-limit time-stamp-line-limit) |
271 |
(ts-start time-stamp-start) |
(ts-start time-stamp-start) |
599 |
(user-full-name)) |
(user-full-name)) |
600 |
((eq cur-char ?h) ;mail host name |
((eq cur-char ?h) ;mail host name |
601 |
(time-stamp-mail-host-name)) |
(time-stamp-mail-host-name)) |
602 |
|
((eq cur-char ?q) ;(undocumented unqual hostname) |
603 |
|
(let ((qualname (system-name))) |
604 |
|
(if (string-match "\\." qualname) |
605 |
|
(substring qualname 0 (match-beginning 0)) |
606 |
|
qualname))) |
607 |
|
((eq cur-char ?Q) ;(undocumented fully-qualified host) |
608 |
|
(system-name)) |
609 |
)) |
)) |
610 |
(let ((padded-result |
(let ((padded-result |
611 |
(format (format "%%%s%c" |
(format (format "%%%s%c" |