diff options
| author | Stephen Gildea | 2005-09-12 01:05:55 +0000 |
|---|---|---|
| committer | Stephen Gildea | 2005-09-12 01:05:55 +0000 |
| commit | 0ec633181b15158c55dc29d0839808ac45eb7771 (patch) | |
| tree | 3dca98ad9e3545a9c725301f470ed6b39bad3373 | |
| parent | df1b21421be7370610e8a56e665683619f9df87b (diff) | |
| download | emacs-0ec633181b15158c55dc29d0839808ac45eb7771.tar.gz emacs-0ec633181b15158c55dc29d0839808ac45eb7771.zip | |
(time-stamp, time-stamp-line-limit, time-stamp-start, time-stamp-end):
Mention variable time-stamp-pattern in doc string.
(time-stamp-pattern): Update doc string.
(time-stamp-string-preprocess): new (as yet undocumented)
time-stamp-format escapes %Q and %q (fully-qualified domain name
and unqualified host name).
| -rw-r--r-- | lisp/time-stamp.el | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index 0f3aeb06895..7020dd0c2b7 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: <2004-06-13 19:04:36 teirllm> | 8 | ;; Maintainer's Time-stamp: <2004-09-25 20:55:35 gildea> |
| 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 | ||
| @@ -143,20 +143,26 @@ the first (last) `time-stamp-line-limit' lines of the file for the | |||
| 143 | file to be time-stamped by \\[time-stamp]. A value of 0 searches the | 143 | file to be time-stamped by \\[time-stamp]. A value of 0 searches the |
| 144 | entire buffer (use with care). | 144 | entire buffer (use with care). |
| 145 | 145 | ||
| 146 | Do not change `time-stamp-line-limit', `time-stamp-start', or | 146 | This value can also be set with the variable `time-stamp-pattern'. |
| 147 | `time-stamp-end' for yourself or you will be incompatible | 147 | |
| 148 | with other people's files! If you must change them for some application, | 148 | Do not change `time-stamp-line-limit', `time-stamp-start', |
| 149 | do so in the local variables section of the time-stamped file itself.") | 149 | `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.") | ||
| 150 | 153 | ||
| 151 | 154 | ||
| 152 | (defvar time-stamp-start "Time-stamp:[ \t]+\\\\?[\"<]+" ;Do not change! | 155 | (defvar time-stamp-start "Time-stamp:[ \t]+\\\\?[\"<]+" ;Do not change! |
| 153 | "Regexp after which the time stamp is written by \\[time-stamp]. | 156 | "Regexp after which the time stamp is written by \\[time-stamp]. |
| 154 | See also the variables `time-stamp-end' and `time-stamp-line-limit'. | 157 | See also the variables `time-stamp-end' and `time-stamp-line-limit'. |
| 155 | 158 | ||
| 156 | Do not change `time-stamp-line-limit', `time-stamp-start', or | 159 | This value can also be set with the variable `time-stamp-pattern'. |
| 157 | `time-stamp-end' for yourself or you will be incompatible | 160 | |
| 158 | with other people's files! If you must change them for some application, | 161 | Do not change `time-stamp-line-limit', `time-stamp-start', |
| 159 | do so in the local variables section of the time-stamped file itself.") | 162 | `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.") | ||
| 160 | 166 | ||
| 161 | 167 | ||
| 162 | (defvar time-stamp-end "\\\\?[\">]" ;Do not change! | 168 | (defvar time-stamp-end "\\\\?[\">]" ;Do not change! |
| @@ -165,13 +171,15 @@ do so in the local variables section of the time-stamped file itself.") | |||
| 165 | and the following match of `time-stamp-end', then writes the | 171 | and the following match of `time-stamp-end', then writes the |
| 166 | time stamp specified by `time-stamp-format' between them. | 172 | time stamp specified by `time-stamp-format' between them. |
| 167 | 173 | ||
| 174 | This value can also be set with the variable `time-stamp-pattern'. | ||
| 175 | |||
| 168 | The end text normally starts on the same line as the start text ends, | 176 | The end text normally starts on the same line as the start text ends, |
| 169 | but if there are any newlines in `time-stamp-format', the same number | 177 | but if there are any newlines in `time-stamp-format', the same number |
| 170 | of newlines must separate the start and end. \\[time-stamp] tries | 178 | of newlines must separate the start and end. \\[time-stamp] tries |
| 171 | to not change the number of lines in the buffer. `time-stamp-inserts-lines' | 179 | to not change the number of lines in the buffer. `time-stamp-inserts-lines' |
| 172 | controls this behavior. | 180 | controls this behavior. |
| 173 | 181 | ||
| 174 | Do not change `time-stamp-line-limit', `time-stamp-start', `time-stamp-end', | 182 | Do not change `time-stamp-start', `time-stamp-end', `time-stamp-pattern', |
| 175 | or `time-stamp-inserts-lines' for yourself or you will be incompatible | 183 | or `time-stamp-inserts-lines' for yourself or you will be incompatible |
| 176 | with other people's files! If you must change them for some application, | 184 | with other people's files! If you must change them for some application, |
| 177 | do so in the local variables section of the time-stamped file itself.") | 185 | do so in the local variables section of the time-stamped file itself.") |
| @@ -231,9 +239,11 @@ Examples: | |||
| 231 | \"@set Time-stamp: %:b %:d, %:y$\" | 239 | \"@set Time-stamp: %:b %:d, %:y$\" |
| 232 | \"newcommand{\\\\\\\\timestamp}{%%}\" | 240 | \"newcommand{\\\\\\\\timestamp}{%%}\" |
| 233 | 241 | ||
| 234 | Do not change `time-stamp-pattern' for yourself or you will be incompatible | 242 | Do not change `time-stamp-pattern' `time-stamp-line-limit', |
| 235 | with other people's files! Set it only in the local variables section | 243 | `time-stamp-start', or `time-stamp-end' for yourself or you will be |
| 236 | of the time-stamped file itself.") | 244 | 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.") | ||
| 237 | 247 | ||
| 238 | 248 | ||
| 239 | 249 | ||
| @@ -251,10 +261,11 @@ look like one of the following: | |||
| 251 | The time stamp is written between the brackets or quotes: | 261 | The time stamp is written between the brackets or quotes: |
| 252 | Time-stamp: <2001-02-18 10:20:51 gildea> | 262 | Time-stamp: <2001-02-18 10:20:51 gildea> |
| 253 | The time stamp is updated only if the variable `time-stamp-active' is non-nil. | 263 | The time stamp is updated only if the variable `time-stamp-active' is non-nil. |
| 254 | The format of the time stamp is set by the variable `time-stamp-format'. | 264 | The format of the time stamp is set by the variable `time-stamp-pattern' or |
| 255 | The variables `time-stamp-line-limit', `time-stamp-start', `time-stamp-end', | 265 | `time-stamp-format'. The variables `time-stamp-pattern', |
| 256 | `time-stamp-count', and `time-stamp-inserts-lines' control finding the | 266 | `time-stamp-line-limit', `time-stamp-start', `time-stamp-end', |
| 257 | template." | 267 | `time-stamp-count', and `time-stamp-inserts-lines' control finding |
| 268 | the template." | ||
| 258 | (interactive) | 269 | (interactive) |
| 259 | (let ((line-limit time-stamp-line-limit) | 270 | (let ((line-limit time-stamp-line-limit) |
| 260 | (ts-start time-stamp-start) | 271 | (ts-start time-stamp-start) |
| @@ -588,6 +599,13 @@ and all `time-stamp-format' compatibility." | |||
| 588 | (user-full-name)) | 599 | (user-full-name)) |
| 589 | ((eq cur-char ?h) ;mail host name | 600 | ((eq cur-char ?h) ;mail host name |
| 590 | (time-stamp-mail-host-name)) | 601 | (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)) | ||
| 591 | )) | 609 | )) |
| 592 | (let ((padded-result | 610 | (let ((padded-result |
| 593 | (format (format "%%%s%c" | 611 | (format (format "%%%s%c" |