Mercurial > emacs
changeset 32454:08bfb5555d7b
(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.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 13 Oct 2000 11:30:27 +0000 |
parents | a8fa8bf4f31e |
children | ca5f74834e1a |
files | lisp/time-stamp.el |
diffstat | 1 files changed, 17 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/time-stamp.el Fri Oct 13 10:39:33 2000 +0000 +++ b/lisp/time-stamp.el Fri Oct 13 11:30:27 2000 +0000 @@ -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 @@ :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 @@ (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 @@ ;; 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 @@ ?\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 @@ (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 @@ (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.