;;; upd-copyr.el --- update the copyright notice in a GNU Emacs Lisp file
+;;; Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+
;; Author: Roland McGrath <roland@gnu.ai.mit.edu>
-;; Last-Modified: 03 Jun 1991
;; Keywords: maint
-;;; Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-;;;
+;;; This file is part of GNU Emacs.
+
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2, or (at your option)
copyright are replaced as well.
If optional third argument ASK is non-nil, the user is prompted for whether
-or not to update the copyright. If optional third argument ASK-YEAR is
+or not to update the copyright. If optional fourth argument ASK-YEAR is
non-nil, the user is prompted for whether or not to replace the year rather
than adding to it."
(interactive "*P")
(save-restriction
(widen)
(goto-char (point-min))
- ;; Handle abbreviated year lists like "1800, 01, 02, 03".
- (if (re-search-forward (concat (substring current-year 0 2)
- "\\([0-9][0-9]\\(,\\s \\)+\\)*"
+ ;; Handle abbreviated year lists like "1800, 01, 02, 03"
+ ;; or "1900, '01, '02, '03".
+ (if (re-search-forward (concat "\\(" (substring current-year 0 2)
+ "\\)?"
+ "\\([0-9][0-9]\\(,\\s \\)+\\)*'?"
(substring current-year 2))
nil t)
(or ask-upd
(search-forward "is free software" nil t)
(goto-char (point-min))))
(re-search-forward
- "[Cc]opyright[^0-9]*\\(\\([-, \t]*\\([0-9]+\\)\\)\\)+"
+ "[Cc]opyright[^0-9]*\\(\\(\\([-, \t]*\\([0-9]+\\)\\)\\)+\\)"
nil t)
(or (not ask-upd)
(save-window-excursion
(princ (substitute-command-keys "\
I don't know where the copying notice begins.
Put point there and hit \\[exit-recursive-edit]."))
+ (save-excursion
+ (set-buffer standard-output)
+ (help-mode))
(recursive-edit)))
(setq beg (point))
(or (search-forward "02139, USA." nil t)
(princ (substitute-command-keys "\
I don't know where the copying notice ends.
Put point there and hit \\[exit-recursive-edit]."))
+ (save-excursion
+ (set-buffer standard-output)
+ (help-mode))
(recursive-edit)))
(delete-region beg (point))))
(insert-file replace-copying-with))