# HG changeset patch # User Richard M. Stallman # Date 1116194559 0 # Node ID 6a8938e81aa7dc34a05e4e49df247f2367b93886 # Parent 2500e1e082cdb73a72b64aebc97780ad7aea590f (copyright-fix-years): Match properly if the first year is 2-digit. Don't mess up the whitespace after the years by filling. diff -r 2500e1e082cd -r 6a8938e81aa7 lisp/emacs-lisp/copyright.el --- a/lisp/emacs-lisp/copyright.el Sun May 15 21:34:47 2005 +0000 +++ b/lisp/emacs-lisp/copyright.el Sun May 15 22:02:39 2005 +0000 @@ -189,6 +189,8 @@ last) (set-marker e (1+ (match-end 2))) (goto-char s) + ;; Back up one character so that our search can match the first year. + (backward-char 1) (while (and (< (point) (marker-position e)) (re-search-forward "\\([^0-9]\\)\\([0-9]+\\)[^0-9]" (marker-position e) t)) @@ -204,8 +206,12 @@ (setq last p))) (when last (goto-char last) - (let ((fill-prefix " ")) - (fill-region s last)) + ;; Don't mess up whitespace after the years. + (skip-chars-backward " \t") + (save-restriction + (narrow-to-region (point-min) (point)) + (let ((fill-prefix " ")) + (fill-region s last))) ) (set-marker e nil) (copyright-update nil t))