diff options
author | Eli Zaretskii <eliz@gnu.org> | 2001-01-08 16:00:38 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2001-01-08 16:00:38 +0000 |
commit | b7812d3050275ecd3184a4c963b58006fedfef66 (patch) | |
tree | ee7a073e97cbad725bf48ef70cc8fa8d7ec6d49f /lisp/emacs-lisp | |
parent | 962116cf6fbeae48729fa7aaf56682274634616a (diff) | |
download | emacs-b7812d3050275ecd3184a4c963b58006fedfef66.tar.gz emacs-b7812d3050275ecd3184a4c963b58006fedfef66.tar.bz2 emacs-b7812d3050275ecd3184a4c963b58006fedfef66.zip |
(copyright-current-year): Now a defvar.
(copyright, copyright-update): Compute the current year at run
time.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/copyright.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 8499b815df1..7c06b97269d 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -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) |