# HG changeset patch # User Roland McGrath # Date 708985038 0 # Node ID 2011f5e67975dcd1960274ef8681816af6d1de6c # Parent 950a63133bc417ec66c22c724debe24090b66b20 *** empty log message *** diff -r 950a63133bc4 -r 2011f5e67975 lisp/emacs-lisp/copyright.el --- a/lisp/emacs-lisp/copyright.el Mon Jun 15 21:06:57 1992 +0000 +++ b/lisp/emacs-lisp/copyright.el Fri Jun 19 20:17:18 1992 +0000 @@ -28,6 +28,10 @@ (defvar replace-copying-with nil "*If non-nil, replace copying notices with this file.") +(defvar inhibit-update-copyright nil + "If nil, ask the user whether or not to update the copyright notice. +If the user has said no, we set this to t locally.") + ;;;###autoload (defun update-copyright (&optional replace ask-upd ask-year) "Update the copyright notice at the beginning of the buffer @@ -46,17 +50,22 @@ (save-restriction (widen) (goto-char (point-min)) - (if (search-forward current-year nil t) + ;; Handle abbreviated year lists like "1800, 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 (message "Copyright notice already includes %s." current-year)) (goto-char (point-min)) - (if (and (or (not ask-upd) + (if (and (not inhibit-update-copyright) + (or (not ask-upd) ;; If implicit, narrow it down to things that ;; look like GPL notices. (prog1 (search-forward "is free software" nil t) (goto-char (point-min)))) - (re-search-forward + (re-search-forward "[Cc]opyright[^0-9]*\\(\\([-, \t]*\\([0-9]+\\)\\)\\)+" nil t) (or (not ask-upd) @@ -66,7 +75,11 @@ ;; Show the user the copyright. (goto-char (point-min)) (sit-for 0) - (y-or-n-p "Update copyright? "))))) + (or (y-or-n-p "Update copyright? ") + (progn + (set (make-local-variable + 'inhibit-update-copyright) t) + nil)))))) (progn (setq replace (or replace