From: Stefan Monnier Date: Sun, 29 Jul 2007 20:11:25 +0000 (+0000) Subject: (copyright-update-year, copyright-update, copyright-fix-years, copyright): X-Git-Tag: emacs-pretest-22.1.90~1150 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=463dca7e44715219fe720858d2144d54ea315635;p=emacs.git (copyright-update-year, copyright-update, copyright-fix-years, copyright): Correctly handle the case where copyright-limit is nil. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9a1178c1f98..6a74584fbd4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,4 +1,10 @@ -2007-07-28 Novitsky, Konstantin (tiny change) +2007-07-29 Kimit Yada (tiny change) + + * emacs-lisp/copyright.el (copyright-update-year, copyright-update) + (copyright-fix-years, copyright): Correctly handle the case where + copyright-limit is nil. + +2007-07-28 Konstantin Novitsky (tiny change) * progmodes/python.el (run-python): Fix path separator under w32. @@ -9,12 +15,12 @@ 2007-07-28 Alan Mackenzie Fix problem with modes derived from CC Mode: - * progmodes/cc-mode.el (c-make-emacs-variables-local): move this + * progmodes/cc-mode.el (c-make-emacs-variables-local): Move this macro to cc-langs. - (c-init-language-vars-for): remove call to above macro. - * progmodes/cc-langs.el (c-make-emacs-variables-local): macro has + (c-init-language-vars-for): Remove call to above macro. + * progmodes/cc-langs.el (c-make-emacs-variables-local): Macro has been moved to here. - (c-make-init-lang-vars-fun): call c-make-emacs-variables-local. + (c-make-init-lang-vars-fun): Call c-make-emacs-variables-local. 2007-07-28 Eli Zaretskii diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index cf6dcdcc166..ed1d01023fb 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -37,7 +37,7 @@ :group 'tools) (defcustom copyright-limit 2000 - "*Don't try to update copyright beyond this position unless interactive. + "Don't try to update copyright beyond this position unless interactive. A value of nil means to search whole buffer." :group 'copyright :type '(choice (integer :tag "Limit") @@ -49,21 +49,21 @@ A value of nil means to search whole buffer." "\\([©Ž©]\\|@copyright{}\\|[Cc]opyright\\s *:?\\s *\\(?:(C)\\)?\ \\|[Cc]opyright\\s *:?\\s *[©Ž©]\\)\ \\s *\\([1-9]\\([-0-9, ';/*%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" - "*What your copyright notice looks like. + "What your copyright notice looks like. The second \\( \\) construct must match the years." :group 'copyright :type 'regexp) (defcustom copyright-years-regexp "\\(\\s *\\)\\([1-9]\\([-0-9, ';/*%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" - "*Match additional copyright notice years. + "Match additional copyright notice years. The second \\( \\) construct must match the years." :group 'copyright :type 'regexp) (defcustom copyright-query 'function - "*If non-nil, ask user before changing copyright. + "If non-nil, ask user before changing copyright. When this is `function', only ask when called non-interactively." :group 'copyright :type '(choice (const :tag "Do not ask") @@ -83,7 +83,8 @@ When this is `function', only ask when called non-interactively." "String representing the current year.") (defun copyright-update-year (replace noquery) - (when (re-search-forward copyright-regexp (+ (point) copyright-limit) t) + (when (re-search-forward copyright-regexp + (if copyright-limit (+ (point) copyright-limit)) t) ;; If the years are continued onto multiple lined ;; that are marked as comments, skip to the end of the years anyway. (while (save-excursion @@ -159,10 +160,11 @@ interactively." (and copyright-current-gpl-version ;; match the GPL version comment in .el files, including the ;; bilingual Esperanto one in two-column, and in texinfo.tex - (re-search-forward "\\(the Free Software Foundation;\ + (re-search-forward + "\\(the Free Software Foundation;\ either \\|; a\\^u eldono \\([0-9]+\\)a, ? a\\^u (la\\^u via \\)\ version \\([0-9]+\\), or (at" - (+ (point) copyright-limit) t) + (if copyright-limit (+ (point) copyright-limit)) t) (not (string= (match-string 3) copyright-current-gpl-version)) (or noquery (y-or-n-p (concat "Replace GPL version by " @@ -184,7 +186,8 @@ Uses heuristic: year >= 50 means 19xx, < 50 means 20xx." (interactive) (widen) (goto-char (point-min)) - (if (re-search-forward copyright-regexp (+ (point) copyright-limit) t) + (if (re-search-forward copyright-regexp + (if copyright-limit (+ (point) copyright-limit)) t) (let ((s (match-beginning 2)) (e (copy-marker (1+ (match-end 2)))) (p (make-marker)) @@ -224,7 +227,7 @@ Uses heuristic: year >= 50 means 19xx, < 50 means 20xx." "Copyright (C) " `(substring (current-time-string) -4) " by " (or (getenv "ORGANIZATION") str) - '(if (> (point) (+ (point-min) copyright-limit)) + '(if (and copyright-limit (> (point) (+ (point-min) copyright-limit))) (message "Copyright extends beyond `copyright-limit' and won't be updated automatically.")) comment-end \n) @@ -235,5 +238,5 @@ Uses heuristic: year >= 50 means 19xx, < 50 means 20xx." ;; coding: emacs-mule ;; End: -;;; arch-tag: b4991afb-b6b1-4590-bebe-e076d9d4aee8 +;; arch-tag: b4991afb-b6b1-4590-bebe-e076d9d4aee8 ;;; copyright.el ends here