emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108119: Fix minor Y10k bugs.


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108119: Fix minor Y10k bugs.
Date: Thu, 03 May 2012 23:13:18 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 108119
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Thu 2012-05-03 23:13:18 -0700
message:
  Fix minor Y10k bugs.
  
  * lisp/arc-mode.el (archive-unixdate):
  * lisp/autoinsert.el (auto-insert-alist):
  * lisp/calc/calc-forms.el (math-this-year):
  * lisp/gnus/nnweb.el (nnweb-google-parse-1):
  * lisp/emacs-lisp/copyright.el (copyright-current-year)
  (copyright-update-year, copyright):
  * lisp/tar-mode.el (tar-clip-time-string):
  * lisp/time.el (display-time-update):
  Don't assume years have 4 digits.
modified:
  lisp/ChangeLog
  lisp/arc-mode.el
  lisp/autoinsert.el
  lisp/calc/calc-forms.el
  lisp/emacs-lisp/copyright.el
  lisp/gnus/ChangeLog
  lisp/gnus/nnweb.el
  lisp/tar-mode.el
  lisp/time.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-05-04 05:14:14 +0000
+++ b/lisp/ChangeLog    2012-05-04 06:13:18 +0000
@@ -1,3 +1,15 @@
+2012-05-04  Paul Eggert  <address@hidden>
+
+       Fix minor Y10k bugs.
+       * arc-mode.el (archive-unixdate):
+       * autoinsert.el (auto-insert-alist):
+       * calc/calc-forms.el (math-this-year):
+       * emacs-lisp/copyright.el (copyright-current-year)
+       (copyright-update-year, copyright):
+       * tar-mode.el (tar-clip-time-string):
+       * time.el (display-time-update):
+       Don't assume years have 4 digits.
+
 2012-05-04  Chong Yidong  <address@hidden>
 
        * dos-w32.el (file-name-buffer-file-type-alist)

=== modified file 'lisp/arc-mode.el'
--- a/lisp/arc-mode.el  2012-02-11 22:13:29 +0000
+++ b/lisp/arc-mode.el  2012-05-04 06:13:18 +0000
@@ -622,11 +622,12 @@
 
 (defun archive-unixdate (low high)
   "Stringify Unix (LOW HIGH) date."
-  (let ((str (current-time-string (cons high low))))
+  (let* ((time (cons high low))
+        (str (current-time-string time)))
     (format "%s-%s-%s"
            (substring str 8 10)
            (substring str 4 7)
-           (substring str 20 24))))
+           (format-time-string "%Y" time))))
 
 (defun archive-unixtime (low high)
   "Stringify Unix (LOW HIGH) time."

=== modified file 'lisp/autoinsert.el'
--- a/lisp/autoinsert.el        2012-01-19 07:21:25 +0000
+++ b/lisp/autoinsert.el        2012-05-04 06:13:18 +0000
@@ -135,7 +135,7 @@
 
     (("\\.[1-9]\\'" . "Man page skeleton")
      "Short description: "
-     ".\\\" Copyright (C), " (substring (current-time-string) -4) "  "
+     ".\\\" Copyright (C), " (format-time-string "%Y") "  "
      (getenv "ORGANIZATION") | (progn user-full-name)
      "
 .\\\" You may distribute this file under the terms of the GNU Free
@@ -166,7 +166,7 @@
      "Short description: "
      ";;; " (file-name-nondirectory (buffer-file-name)) " --- " str "
 
-;; Copyright (C) " (substring (current-time-string) -4) "  "
+;; Copyright (C) " (format-time-string "%Y") "  "
  (getenv "ORGANIZATION") | (progn user-full-name) "
 
 ;; Author: " (user-full-name)
@@ -222,7 +222,7 @@
 @copying\n"
       (setq short-description (read-string "Short description: "))
       ".\n\n"
-      "Copyright @copyright{} " (substring (current-time-string) -4) "  "
+      "Copyright @copyright{} " (format-time-string "%Y") "  "
       (getenv "ORGANIZATION") | (progn user-full-name) "
 
 @quotation

=== modified file 'lisp/calc/calc-forms.el'
--- a/lisp/calc/calc-forms.el   2012-01-19 07:21:25 +0000
+++ b/lisp/calc/calc-forms.el   2012-05-04 06:13:18 +0000
@@ -444,7 +444,7 @@
 
 
 (defun math-this-year ()
-  (string-to-number (substring (current-time-string) -4)))
+  (nth 5 (decode-time)))
 
 (defun math-leap-year-p (year)
   (if (Math-lessp year 1752)

=== modified file 'lisp/emacs-lisp/copyright.el'
--- a/lisp/emacs-lisp/copyright.el      2012-03-16 16:36:27 +0000
+++ b/lisp/emacs-lisp/copyright.el      2012-05-04 06:13:18 +0000
@@ -110,7 +110,7 @@
 
 ;; This is a defvar rather than a defconst, because the year can
 ;; change during the Emacs session.
-(defvar copyright-current-year (substring (current-time-string) -4)
+(defvar copyright-current-year (format-time-string "%Y")
   "String representing the current year.")
 
 (defsubst copyright-limit ()            ; re-search-forward BOUND
@@ -181,8 +181,7 @@
   ;; This uses the match-data from copyright-find-copyright/end.
   (goto-char (match-end 1))
   (copyright-find-end)
-  ;; Note that `current-time-string' isn't locale-sensitive.
-  (setq copyright-current-year (substring (current-time-string) -4))
+  (setq copyright-current-year (format-time-string "%Y"))
   (unless (string= (buffer-substring (- (match-end 3) 2) (match-end 3))
                   (substring copyright-current-year -2))
     (if (or noquery
@@ -347,7 +346,7 @@
   "Insert a copyright by $ORGANIZATION notice at cursor."
   "Company: "
   comment-start
-  "Copyright (C) " `(substring (current-time-string) -4) " by "
+  "Copyright (C) " `(format-time-string "%Y") " by "
   (or (getenv "ORGANIZATION")
       str)
   '(if (copyright-offset-too-large-p)

=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2012-05-01 18:37:21 +0000
+++ b/lisp/gnus/ChangeLog       2012-05-04 06:13:18 +0000
@@ -1,3 +1,8 @@
+2012-05-04  Paul Eggert  <address@hidden>
+
+       Fix minor Y10k bug.
+       * nnweb.el (nnweb-google-parse-1): Don't assume years have 4 digits.
+
 2012-05-01  Stefan Monnier  <address@hidden>
 
        * nnimap.el (nnimap-open-connection-1): Don't leave an "opening..."

=== modified file 'lisp/gnus/nnweb.el'
--- a/lisp/gnus/nnweb.el        2012-01-19 07:21:25 +0000
+++ b/lisp/gnus/nnweb.el        2012-05-04 06:13:18 +0000
@@ -365,7 +365,7 @@
                               (match-string 1)
                               (match-string 2)
                               (or (match-string 3)
-                                  (substring (current-time-string) -4)))
+                                  (format-time-string "%Y")))
                     (current-time-string)))
        (setq From (match-string 4)))
       (widen)

=== modified file 'lisp/tar-mode.el'
--- a/lisp/tar-mode.el  2012-04-16 18:46:46 +0000
+++ b/lisp/tar-mode.el  2012-05-04 06:13:18 +0000
@@ -396,7 +396,7 @@
 
 (defun tar-clip-time-string (time)
   (let ((str (current-time-string time)))
-    (concat " " (substring str 4 16) (substring str 19 24))))
+    (concat " " (substring str 4 16) (format-time-string " %Y" time))))
 
 (defun tar-grind-file-mode (mode)
   "Construct a `-rw--r--r--' string indicating MODE.

=== modified file 'lisp/time.el'
--- a/lisp/time.el      2012-01-19 07:21:25 +0000
+++ b/lisp/time.el      2012-05-04 06:13:18 +0000
@@ -465,7 +465,7 @@
          (seconds (substring time 17 19))
          (time-zone (car (cdr (current-time-zone now))))
          (day (substring time 8 10))
-         (year (substring time 20 24))
+         (year (format-time-string "%Y" now))
          (monthname (substring time 4 7))
          (month
           (cdr


reply via email to

[Prev in Thread] Current Thread [Next in Thread]