aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gildea2005-09-12 01:05:55 +0000
committerStephen Gildea2005-09-12 01:05:55 +0000
commit0ec633181b15158c55dc29d0839808ac45eb7771 (patch)
tree3dca98ad9e3545a9c725301f470ed6b39bad3373
parentdf1b21421be7370610e8a56e665683619f9df87b (diff)
downloademacs-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.el52
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
143file to be time-stamped by \\[time-stamp]. A value of 0 searches the 143file to be time-stamped by \\[time-stamp]. A value of 0 searches the
144entire buffer (use with care). 144entire buffer (use with care).
145 145
146Do not change `time-stamp-line-limit', `time-stamp-start', or 146This value can also be set with the variable `time-stamp-pattern'.
147`time-stamp-end' for yourself or you will be incompatible 147
148with other people's files! If you must change them for some application, 148Do not change `time-stamp-line-limit', `time-stamp-start',
149do 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
150incompatible with other people's files! If you must change them for some
151application, do so in the local variables section of the time-stamped file
152itself.")
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].
154See also the variables `time-stamp-end' and `time-stamp-line-limit'. 157See also the variables `time-stamp-end' and `time-stamp-line-limit'.
155 158
156Do not change `time-stamp-line-limit', `time-stamp-start', or 159This value can also be set with the variable `time-stamp-pattern'.
157`time-stamp-end' for yourself or you will be incompatible 160
158with other people's files! If you must change them for some application, 161Do not change `time-stamp-line-limit', `time-stamp-start',
159do 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
163incompatible with other people's files! If you must change them for some
164application, do so in the local variables section of the time-stamped file
165itself.")
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.")
165and the following match of `time-stamp-end', then writes the 171and the following match of `time-stamp-end', then writes the
166time stamp specified by `time-stamp-format' between them. 172time stamp specified by `time-stamp-format' between them.
167 173
174This value can also be set with the variable `time-stamp-pattern'.
175
168The end text normally starts on the same line as the start text ends, 176The end text normally starts on the same line as the start text ends,
169but if there are any newlines in `time-stamp-format', the same number 177but if there are any newlines in `time-stamp-format', the same number
170of newlines must separate the start and end. \\[time-stamp] tries 178of newlines must separate the start and end. \\[time-stamp] tries
171to not change the number of lines in the buffer. `time-stamp-inserts-lines' 179to not change the number of lines in the buffer. `time-stamp-inserts-lines'
172controls this behavior. 180controls this behavior.
173 181
174Do not change `time-stamp-line-limit', `time-stamp-start', `time-stamp-end', 182Do not change `time-stamp-start', `time-stamp-end', `time-stamp-pattern',
175or `time-stamp-inserts-lines' for yourself or you will be incompatible 183or `time-stamp-inserts-lines' for yourself or you will be incompatible
176with other people's files! If you must change them for some application, 184with other people's files! If you must change them for some application,
177do so in the local variables section of the time-stamped file itself.") 185do 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
234Do not change `time-stamp-pattern' for yourself or you will be incompatible 242Do not change `time-stamp-pattern' `time-stamp-line-limit',
235with 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
236of the time-stamped file itself.") 244incompatible with other people's files! If you must change them for
245some application, do so only in the local variables section of the
246time-stamped file itself.")
237 247
238 248
239 249
@@ -251,10 +261,11 @@ look like one of the following:
251The time stamp is written between the brackets or quotes: 261The 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>
253The time stamp is updated only if the variable `time-stamp-active' is non-nil. 263The time stamp is updated only if the variable `time-stamp-active' is non-nil.
254The format of the time stamp is set by the variable `time-stamp-format'. 264The format of the time stamp is set by the variable `time-stamp-pattern' or
255The 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',
257template." 267`time-stamp-count', and `time-stamp-inserts-lines' control finding
268the 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"