diff options
author | Paul Eggert <[email protected]> | 2012-05-03 23:13:18 -0700 |
---|---|---|
committer | Paul Eggert <[email protected]> | 2012-05-03 23:13:18 -0700 |
commit | 0bfcf5c598d7c351591827b14482253adf9ab015 (patch) | |
tree | d11131363f77dcf33346df9a727663214664c46d /lisp/emacs-lisp/copyright.el | |
parent | 85e8b518113820afff2edd0a35e70d54b1395ff4 (diff) |
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.
Diffstat (limited to 'lisp/emacs-lisp/copyright.el')
-rw-r--r-- | lisp/emacs-lisp/copyright.el | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 09b456b54b..8e96d95c5d 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -110,7 +110,7 @@ When this is `function', only ask when called non-interactively." ;; 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 @@ skips to the end of all the years." ;; 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 @@ independently replaces consecutive years with a range." "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) |