I used the time-stamp write-file-hook successfully in fsf emacs for
quite a while now. I used a 4 digit year.
time-stamp-format "%:y-%02m-%02d %02H:%02M:%02S %u"
but with xemacs a got the error message:
"Wrong argument type: sequencep, 2000"
without the hook, M-x time-stamp, it works okay, but this is annoying.
I'm too much a elisp newbie to debug this hook successfully by myself.
looks like it expects the 4-digit year as vector or string?
;; the hook fails in xemacs 21.1.9, works okay in fsf emacs 20.5.1
;; do M-x time-stamp manually in xemacs
(require 'time-stamp);(add-hook 'write-file-hooks 'time-stamp)
BTW:
A default time-stamp-format "%:y-%02m-%02d %02H:%02M:%02S %u" seems to
be better than the 2 digit year only.
And it is understandable at the frist glance for all humans, not only
those in anglican countries (what is the month, what the day, what the
year). And it is the ISO 8601 date format also. One of the better things
ISO came up with lately.
While I ws there I fixed time-stamp.el to accept an additional
time-stamp-format string keyword %D, to insert the date in ISO 8601
format and to get rid of the xemacs bug.
with this fix of mine it works okay now, though I don't really know what
caused the error.
a synch with the more recent FSF version would be fine
(changed format string with ":", unlimited line-limit, ...),
but I don't know if this would be appreciated.
who's maintaining this in xemacs? the original maintainer seems to come
from fsf.
--
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html
--- lisp\xemacs-base\time-stamp.el.orig Sat Oct 10 14:58:04 1998
+++ lisp\xemacs-base\time-stamp.el Fri Feb 18 15:20:04 2000
@@ -2,7 +2,7 @@
;; Copyright 1989, 1993, 1994, 1995 Free Software Foundation, Inc.
-;; Maintainer's Time-stamp: <95/12/28 19:48:49 gildea>
+;; Maintainer's Time-stamp: <2000-02-18 15:55:04 rurban>
;; Maintainer: Stephen Gildea <gildea(a)lcs.mit.edu>
;; Keywords: tools
@@ -53,6 +53,12 @@
;; date.el by John Sturdy <mcvax!harlqn.co.uk!jcgs(a)uunet.uu.net>
;; version 2, January 1995: replaced functions with %-escapes
;; $Id: time-stamp.el,v 1.2 1998/10/10 13:58:03 steveb Exp $
+;; 2000-02-18 15:55:04 rurban:
+;; added %D to the format string to fix a
+;; mysterious 4-digit year bug in the write-file-hooks,
+;; The default should really be "%D %02H:%02M:%02S %u" now, or at least
+;; "%:y-%02m-%02d %02H:%02M:%02S %u"
+;; Not yet synched with latest FSF version (":" in format, t as line-limit,
...)
;;; Code:
@@ -94,6 +100,7 @@
%w day number of week, Sunday is 0
%y year: `1995'
%z time zone name: `est'. %Z gives uppercase: `EST'
+%D gives the ISO 8601 date `yyyy-mm-dd'
Non-date items:
%% a literal percent character: `%'
@@ -316,6 +323,8 @@
(cond
((eq cur-char ?%)
"%")
+ ((eq cur-char ?D) ;ISO 8601 date `yyyy-mm-dd'
+ (time-stamp-yyyy-mm-dd))
((or (eq cur-char ?a) ;weekday name
(eq cur-char ?A))
(let ((name