$timestamp - Time stamp string
$timestamp "string"; Default is "<%Y%M%D.%h%m>"
$timestamp defines the file time-stamping string. MicroEmacs '99 searches for, and modifies, the string to the current time and date whenever the file is saved (written to disk) and time(2m) mode is enabled.
Time stamp string is defined, by default, as "<%Y%M%D.%h%m>". The first occurrence of the string in the file is up-dated with the time and date information when the buffer is written. The $timestamp string may contain any text, and includes the following, magic characters escaped by a percentage (`%') character:-
D - Day.
M - Month.
Y - Year.
h - Hour.
m - Minute.
s - Second.
The format string may be redefined into any format. The '%' character has to be delimited by another '%' if it is to be used in the text (i.e. "%%").
The year component (%Y) may be a 2 or 4 digit string, depending whether it includes the century. When the time stamping searches for the %Y component it searches for either variant and replaces appropriately.
The startup file may define the time stamp required as follows:-
set-variable $timestamp "Last Modified : %Y/%M/%D %h:%m:%s"
Time stamping is performed on the string :-
Last Modified : 90/11/23 10:12:01
Where the time stamp is modified according to the file (buffer) type then the time stamp string may be modified within the buffer hooks. This allows different files to utilize different time stamping strings. The following example shows how the entry and exit buffer hooks are defined to modify the string:
0 define-macro bhook-nroff set-variable .timestamp $timestamp ; Buffer specific time stamp string. set-variable $timestamp "[%Y/%M/%D %h:%m:%s]" !emacro 0 define-macro ehook-nroff ; Restore the existing time stamp. set-variable $timestamp .bhook-nroff.timestamp !emacro
On entry to the buffer (buffer becomes current) the buffer hook bhook-nroff is executed which stores the current setting and then modifies the time stamp string. On exit from the buffer the buffer hook ehook-nroff is executed restoring the time stamp string.
(c) Copyright JASSPA 1999
Last Modified: 1999/06/20
Generated On: 1999/12/01