# HG changeset patch # User Eli Zaretskii # Date 978969580 0 # Node ID 9f38c893ea39ba9e7ede23b4187591c256be1dc7 # Parent be409ac24874fb8ca7b82a42dd4ea7f36762eb23 (copyright-current-year): Now a defvar. (copyright, copyright-update): Compute the current year at run time. diff -r be409ac24874 -r 9f38c893ea39 lisp/emacs-lisp/copyright.el --- a/lisp/emacs-lisp/copyright.el Mon Jan 08 15:26:54 2001 +0000 +++ b/lisp/emacs-lisp/copyright.el Mon Jan 08 15:59:40 2001 +0000 @@ -61,16 +61,18 @@ (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 @@ (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 @@ "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)