]> git.eshelyaron.com Git - emacs.git/commitdiff
(copyright-current-year): Now a defvar.
authorEli Zaretskii <eliz@gnu.org>
Mon, 8 Jan 2001 16:00:38 +0000 (16:00 +0000)
committerEli Zaretskii <eliz@gnu.org>
Mon, 8 Jan 2001 16:00:38 +0000 (16:00 +0000)
(copyright, copyright-update): Compute the current year at run
time.

lisp/ChangeLog
lisp/emacs-lisp/copyright.el

index f1fcdf2e5528bec514dae1017ff66d5bce643fcd..a4fe3854cae82672c79af6790dc5cfffd4fbb896 100644 (file)
@@ -1,3 +1,9 @@
+2001-01-08  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * emacs-lisp/copyright.el (copyright-current-year): Now a defvar.
+       (copyright, copyright-update): Compute the current year at run
+       time.
+
 2001-01-08  Gerd Moellmann  <gerd@gnu.org>
 
        * isearch.el (isearch-old-signal-hook): Removed.
index 8499b815df1448484dd4858e8f551a4397bd13db..7c06b97269d4fc6b27444dbb077356d4599a3e46 100644 (file)
@@ -61,16 +61,18 @@ When this is `function', only ask when called non-interactively."
                 (other :tag "Ask" t)))
 
 
-(defconst copyright-current-year (substring (current-time-string) -4)
-  "String representing the current year.")
-
-
 ;; when modifying this, also modify the comment generated by autoinsert.el
 (defconst copyright-current-gpl-version "2"
   "String representing the current version of the GPL or `nil'.")
 
 (defvar copyright-update t)
 
+;; This is a defvar rather than a defconst, because the year can
+;; change during the Emacs session.
+(defvar copyright-current-year "2001"
+  "String representing the current year.")
+
+
 ;;;###autoload
 (defun copyright-update (&optional arg)
   "Update the copyright notice at the beginning of the buffer to indicate
@@ -84,6 +86,7 @@ copyright, if any, are updated as well."
        (save-restriction
          (widen)
          (goto-char (point-min))
+         (setq copyright-current-year (substring (current-time-string) -4))
          (if (re-search-forward copyright-regexp copyright-limit t)
              (if (string= (buffer-substring (- (match-end 2) 2) (match-end 2))
                           (substring copyright-current-year -2))
@@ -148,7 +151,7 @@ copyright, if any, are updated as well."
   "Insert a copyright by $ORGANIZATION notice at cursor."
   "Company: "
   comment-start
-  "Copyright (C) " copyright-current-year " by "
+  "Copyright (C) " `(substring (current-time-string) -4) " by "
   (or (getenv "ORGANIZATION")
       str)
   '(if (> (point) copyright-limit)