From xemacs-m  Thu Jun 12 10:06:23 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id KAA29055
	for <xemacs-beta@xemacs.org>; Thu, 12 Jun 1997 10:06:21 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id RAA22372; Thu, 12 Jun 1997 17:06:17 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: ChangeLog format change?
References: <qw6yb8hmckk.fsf@esmeralda.enst.fr> <199706111456.HAA16670@xemacs.eng.sun.com> <qw6wwo1mba2.fsf@esmeralda.enst.fr> <m2k9k16ocq.fsf@altair.xemacs.org> <qw6910fnbf2.fsf@esmeralda.enst.fr>
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 12 Jun 1997 17:06:17 +0200
In-Reply-To: Samuel Tardieu's message of 12 Jun 1997 16:28:01 +0200
Message-ID: <kigzpsvvp1y.fsf@jagor.srce.hr>
Lines: 97
X-Mailer: Gnus v5.4.52/XEmacs 20.3(beta5)

Samuel Tardieu <sam@inf.enst.fr> writes:

> sb> It is intentional and matches the development Emacs version.
> 
> I still cannot find the rationale behind this.  Why changing things
> in an authoritative way without letting the user chose its preferred
> format?  In this case, why not hardcoding indentation value to '8'
> without letting the user change this?

Samuel is right.  Note, however, that old change-log was also not
programmable.  This patch should satisfy everyone.  Feel free to
forward it to RMS.

--- lisp/packages/add-log.el.orig	Thu Jun 12 16:37:05 1997
+++ lisp/packages/add-log.el	Thu Jun 12 17:03:13 1997
@@ -32,6 +32,7 @@
 (defgroup change-log nil
   "Change log maintenance"
   :group 'tools
+  :group 'maint
   :prefix "change-log-"
   :prefix "add-log-")
 
@@ -72,6 +73,17 @@
 		 string)
   :group 'change-log)
 
+(defcustom add-log-time-format 'iso8601-time-string
+  "*Function that defines the time format.
+For example, `iso8601-time-string' (time in international ISO 8601 format)
+and `current-time-string' are valid values."
+  :type '(radio (const :tag "International ISO 8601 format" iso8601-time-string)
+		(const :tag "Old format, as returned by `current-time-string'"
+		       current-time-string)
+		(function :tag "Other"))
+  :group 'change-log)
+
+
 ;; XEmacs:
 ;; So that the dump-time value doesn't go into loaddefs.el with the autoload.
 (or add-log-mailing-address
@@ -130,6 +142,20 @@
 		  (t "%c%02d"))
 	    sign hh mm ss)))
 
+(defun iso8601-time-string ()
+  (if change-log-time-zone-rule
+      (let ((tz (getenv "TZ"))
+	    (now (current-time)))
+	(unwind-protect
+	    (progn
+	      (set-time-zone-rule
+	       change-log-time-zone-rule)
+	      (concat
+	       (format-time-string "%Y-%m-%d " now)
+	       (iso8601-time-zone now)))
+	  (set-time-zone-rule tz)))
+    (format-time-string "%Y-%m-%d")))
+
 (defun change-log-name ()
   (or change-log-default-name
       (if (eq system-type 'vax-vms) 
@@ -211,6 +237,7 @@
   (set (make-local-variable 'change-log-default-name) file-name)
   file-name)
 
+
 ;;;###autoload
 (defun add-change-log-entry (&optional whoami file-name other-window new-entry)
   "Find change log file and add an entry for today.
@@ -259,18 +286,7 @@
 	(change-log-mode))
     (undo-boundary)
     (goto-char (point-min))
-    (let ((new-entry (concat (if change-log-time-zone-rule
-				 (let ((tz (getenv "TZ"))
-				       (now (current-time)))
-				   (unwind-protect
-				       (progn
-					 (set-time-zone-rule
-					  change-log-time-zone-rule)
-					 (concat
-					  (format-time-string "%Y-%m-%d " now)
-					  (iso8601-time-zone now)))
-				     (set-time-zone-rule tz)))
-			       (format-time-string "%Y-%m-%d"))
+    (let ((new-entry (concat (funcall add-log-time-format)
 			     "  " add-log-full-name
 			     "  <" add-log-mailing-address ">")))
       (if (looking-at (regexp-quote new-entry))


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Thou Who might be our Father Who perhaps may be in Heaven...
                                                -- Roger Zelazny

