Mercurial > emacs
diff lisp/emacs-lisp/copyright.el @ 91010:aaccdab0ee26
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 852-856)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 93-96)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 245)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-249
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 21 Aug 2007 04:54:03 +0000 |
parents | 539530fa389c 786b4b5a733e |
children | bdb3fe0ba9fa |
line wrap: on
line diff
--- a/lisp/emacs-lisp/copyright.el Mon Aug 20 11:24:57 2007 +0000 +++ b/lisp/emacs-lisp/copyright.el Tue Aug 21 04:54:03 2007 +0000 @@ -57,6 +57,7 @@ Only copyright lines where the name matches this regexp will be updated. This allows you to avoid adding yars to a copyright notice belonging to someone else or to a group for which you do not work." + :group 'copyright :type 'regexp) (defcustom copyright-years-regexp @@ -87,13 +88,16 @@ (defvar copyright-current-year (substring (current-time-string) -4) "String representing the current year.") +(defsubst copyright-limit () ; re-search-forward BOUND + (and copyright-limit (+ (point) copyright-limit))) + (defun copyright-update-year (replace noquery) (when (condition-case err (re-search-forward (concat "\\(" copyright-regexp "\\)\\([ \t]*\n\\)?.*\\(?:" copyright-names-regexp "\\)") - (if copyright-limit (+ (point) copyright-limit)) + (copyright-limit) t) ;; In case the regexp is rejected. This is useful because ;; copyright-update is typically called from before-save-hook where @@ -179,7 +183,7 @@ "\\(the Free Software Foundation;\ either \\|; a\\^u eldono \\([0-9]+\\)a, ? a\\^u (la\\^u via \\)\ version \\([0-9]+\\), or (at" - (if copyright-limit (+ (point) copyright-limit)) t) + (copyright-limit) t) (not (string= (match-string 3) copyright-current-gpl-version)) (or noquery (y-or-n-p (concat "Replace GPL version by " @@ -201,8 +205,7 @@ (interactive) (widen) (goto-char (point-min)) - (if (re-search-forward copyright-regexp - (if copyright-limit (+ (point) copyright-limit)) t) + (if (re-search-forward copyright-regexp (copyright-limit) t) (let ((s (match-beginning 2)) (e (copy-marker (1+ (match-end 2)))) (p (make-marker))