summaryrefslogtreecommitdiff
path: root/lisp/time-stamp.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-10-13 11:30:53 +0000
committerGerd Moellmann <gerd@gnu.org>2000-10-13 11:30:53 +0000
commit3b5e21df1c03c62197af6b7b4261445d3ec6cb1e (patch)
tree6248a7f1754512e86076f1e9bca6e7b9eb6f51f5 /lisp/time-stamp.el
parentdb46018979853d770ff1e64de867670a07dd88c5 (diff)
downloademacs-3b5e21df1c03c62197af6b7b4261445d3ec6cb1e.tar.gz
(time-stamp): Fixed bug in new multi-line code
that breaks with old list format timestamps. (time-stamp-warn-inactive, time-stamp-old-format-warn) (time-stamp-count, time-stamp-conversion-warn): Improved doc strings.
Diffstat (limited to 'lisp/time-stamp.el')
-rw-r--r--lisp/time-stamp.el31
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el
index 7a04c72d074..7768c74751f 100644
--- a/lisp/time-stamp.el
+++ b/lisp/time-stamp.el
@@ -1,8 +1,9 @@
;;; time-stamp.el --- Maintain last change time stamps in files edited by Emacs
-;; Copyright 1989, 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
+;; Copyright 1989, 1993, 1994, 1995, 1997, 2000
+;;; Free Software Foundation, Inc.
-;; Maintainer's Time-stamp: <1999-06-26 15:12:53 gildea>
+;; Maintainer's Time-stamp: <2000-06-07 13:05:45 gildea>
;; Maintainer: Stephen Gildea <gildea@alum.mit.edu>
;; Keywords: tools
@@ -94,14 +95,15 @@ See also the variable `time-stamp-warn-inactive'."
:group 'time-stamp)
(defcustom time-stamp-warn-inactive t
- "Non-nil to have \\[time-stamp] warn if a buffer did not get time-stamped.
-A warning is printed if `time-stamp-active' disables time stamping and the
-buffer contains a template that would otherwise have been updated."
+ "Have \\[time-stamp] warn if a buffer did not get time-stamped.
+If non-nil, a warning is displayed if `time-stamp-active' disables time
+stamping and the buffer contains a template that would otherwise have
+been updated."
:type 'boolean
:group 'time-stamp)
(defcustom time-stamp-old-format-warn 'ask
- "Action to take if `time-stamp-format' is an old-style list.
+ "Action if `time-stamp-format' is an old-style list.
If `error', the format is not used. If `ask', the user is queried about
using the time-stamp-format. If `warn', a warning is displayed.
If nil, no notification is given."
@@ -182,7 +184,7 @@ variables section of the time-stamped file itself.")
(defvar time-stamp-count 1 ;Do not change!
- "How many time stamp templates \\[time-stamp] will look for in a buffer.
+ "How many templates \\[time-stamp] will look for in a buffer.
The same time-stamp will be written in each case.
Do not change `time-stamp-count' for yourself or you will be
@@ -275,9 +277,10 @@ template."
;; to output any warnings about time-stamp not being active.
(setq ts-count 1)))
;; Figure out what lines the end should be on.
- (let ((nl-start 0))
- (while (string-match "\n" ts-format nl-start)
- (setq format-lines (1+ format-lines) nl-start (match-end 0))))
+ (if (stringp ts-format)
+ (let ((nl-start 0))
+ (while (string-match "\n" ts-format nl-start)
+ (setq format-lines (1+ format-lines) nl-start (match-end 0)))))
(let ((nl-start 0))
(while (string-match "\n" ts-end nl-start)
(setq end-lines (1+ end-lines) nl-start (match-end 0))))
@@ -457,7 +460,7 @@ Optionally use FORMAT."
?\0))
(or (eq ?. cur-char)
(eq ?, cur-char) (eq ?: cur-char) (eq ?@ cur-char)
- (eq ?- cur-char) (eq ?+ cur-char) (eq ?_ cur-char)
+ (eq ?- cur-char) (eq ?+ cur-char) (eq ?_ cur-char)
(eq ?\ cur-char) (eq ?# cur-char) (eq ?^ cur-char)
(and (eq ?\( cur-char)
(not (eq prev-char ?\\))
@@ -573,7 +576,7 @@ Optionally use FORMAT."
(time-stamp-mail-host-name))
))
(if (string-equal field-width "")
- (format "%s" field-result)
+ field-result
(let ((padded-result
(format (format "%%%s%c"
field-width
@@ -608,8 +611,8 @@ Optionally use FORMAT."
(string-to-int (format-time-string format-string time)))))
(defvar time-stamp-conversion-warn t
- "Non-nil to warn about soon-to-be-unsupported forms in `time-stamp-format'.
-In would be a bad idea to disable these warnings!
+ "Warn about soon-to-be-unsupported forms in `time-stamp-format'.
+If nil, these warnings are disabled, which would be a bad idea!
You really need to update your files instead.
The new formats will work with old versions of Emacs.