;;; time-stamp.el --- Maintain last change time stamps in files edited by Emacs
-;; Copyright (C) 1989, 1993, 1994, 1995, 1997, 2000, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1993-1995, 1997, 2000-2011
+;; Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org>
;; Keywords: tools
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
:group 'extensions)
(defcustom time-stamp-format "%:y-%02m-%02d %02H:%02M:%02S %u"
- "*Format of the string inserted by \\[time-stamp].
+ "Format of the string inserted by \\[time-stamp].
The value may be a string or a list. Lists are supported only for
backward compatibility; see variable `time-stamp-old-format-warn'.
;;;###autoload(put 'time-stamp-format 'safe-local-variable 'stringp)
(defcustom time-stamp-active t
- "*Non-nil to enable time-stamping of buffers by \\[time-stamp].
+ "Non-nil to enable time-stamping of buffers by \\[time-stamp].
Can be toggled by \\[time-stamp-toggle-active].
See also the variable `time-stamp-warn-inactive'."
:type 'boolean
The format of the time stamp is set by the variable `time-stamp-pattern' or
`time-stamp-format'. The variables `time-stamp-pattern',
`time-stamp-line-limit', `time-stamp-start', `time-stamp-end',
-`time-stamp-count', and `time-stamp-inserts-lines' control finding
+`time-stamp-count', and `time-stamp-inserts-lines' control finding
the template."
(interactive)
(let ((line-limit time-stamp-line-limit)
Suggests replacing OLD-FORM with NEW-FORM."
(cond
(time-stamp-conversion-warn
- (save-excursion
- (set-buffer (get-buffer-create "*Time-stamp-compatibility*"))
+ (with-current-buffer (get-buffer-create "*Time-stamp-compatibility*")
(goto-char (point-max))
(if (bobp)
(progn
(setq list (cdr list)))
return-string))
-;;; Some functions used in time-stamp-format
-
-;;; These functions have been obsolete since 1995
-;;; and will be removed in a future Emacs release.
-;;; Meanwhile, discourage other packages from using them.
-(dolist (function '(time-stamp-month-dd-yyyy time-stamp-dd/mm/yyyy
- time-stamp-mon-dd-yyyy time-stamp-dd-mon-yy
- time-stamp-yy/mm/dd time-stamp-yyyy/mm/dd
- time-stamp-yyyy-mm-dd time-stamp-yymmdd
- time-stamp-hh:mm:ss time-stamp-hhmm))
- (make-obsolete function
- "use `time-stamp-string' or `format-time-string' instead."
- "20.1"))
-
-;;; pretty form, suitable for a title page
-
-(defun time-stamp-month-dd-yyyy ()
- "Return the current date as a string in \"Month DD, YYYY\" form."
- (format-time-string "%B %e, %Y"))
-
-(defun time-stamp-dd/mm/yyyy ()
- "Return the current date as a string in \"DD/MM/YYYY\" form."
- (format-time-string "%d/%m/%Y"))
-
-;;; same as __DATE__ in ANSI C
-
-(defun time-stamp-mon-dd-yyyy ()
- "Return the current date as a string in \"Mon DD YYYY\" form.
-The first character of DD is space if the value is less than 10."
- (format-time-string "%b %d %Y"))
-
-;;; RFC 822 date
-
-(defun time-stamp-dd-mon-yy ()
- "Return the current date as a string in \"DD Mon YY\" form."
- (format-time-string "%d %b %y"))
-
-;;; RCS 3 date
-
-(defun time-stamp-yy/mm/dd ()
- "Return the current date as a string in \"YY/MM/DD\" form."
- (format-time-string "%y/%m/%d"))
-
-;;; RCS 5 date
-
-(defun time-stamp-yyyy/mm/dd ()
- "Return the current date as a string in \"YYYY/MM/DD\" form."
- (format-time-string "%Y/%m/%d"))
-
-;;; ISO 8601 date
-
-(defun time-stamp-yyyy-mm-dd ()
- "Return the current date as a string in \"YYYY-MM-DD\" form."
- (format-time-string "%Y-%m-%d"))
-
-(defun time-stamp-yymmdd ()
- "Return the current date as a string in \"YYMMDD\" form."
- (format-time-string "%y%m%d"))
-
-(defun time-stamp-hh:mm:ss ()
- "Return the current time as a string in \"HH:MM:SS\" form."
- (format-time-string "%T"))
-
-(defun time-stamp-hhmm ()
- "Return the current time as a string in \"HHMM\" form."
- (format-time-string "%H%M"))
-
(provide 'time-stamp)
-;;; arch-tag: 8a12c5c3-25d6-4a71-adc5-24b0e025a1e7
;;; time-stamp.el ends here