From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: copyright.el Date: Sat, 31 Jul 2004 23:31:30 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <200407291712.i6THC2q25562@raven.dms.auburn.edu> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1091331116 31660 80.91.224.253 (1 Aug 2004 03:31:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Aug 2004 03:31:56 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 01 05:31:46 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Br74b-00035z-00 for ; Sun, 01 Aug 2004 05:31:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Br77v-0008F2-C9 for ged-emacs-devel@m.gmane.org; Sat, 31 Jul 2004 23:35:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Br77l-0008Ew-Pj for emacs-devel@gnu.org; Sat, 31 Jul 2004 23:35:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Br77l-0008Ek-9u for emacs-devel@gnu.org; Sat, 31 Jul 2004 23:35:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Br77l-0008Eh-6j for emacs-devel@gnu.org; Sat, 31 Jul 2004 23:35:01 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Br74M-0004SD-Pr for emacs-devel@gnu.org; Sat, 31 Jul 2004 23:31:30 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1Br74M-0000dK-4X; Sat, 31 Jul 2004 23:31:30 -0400 Original-To: Luc Teirlinck In-reply-to: <200407291712.i6THC2q25562@raven.dms.auburn.edu> (message from Luc Teirlinck on Thu, 29 Jul 2004 12:12:02 -0500 (CDT)) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26130 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26130 There is an apparent bug in copyright.el. variables.texi contains: Does this give good results? *** copyright.el 07 Jan 2004 08:15:08 -0500 1.46 --- copyright.el 31 Jul 2004 21:04:36 -0400 *************** *** 54,59 **** --- 54,66 ---- :group 'copyright :type 'regexp) + (defcustom copyright-years-regexp + "\\(\\s *\\)\\([1-9]\\([-0-9, ';/*%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" + "*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. *************** *** 77,82 **** --- 84,106 ---- (defun copyright-update-year (replace noquery) (when (re-search-forward copyright-regexp (+ (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 + (and (eq (following-char) ?,) + (progn (forward-char 1) t) + (progn (skip-chars-forward " \t") (eolp)) + comment-start-skip + (save-match-data + (forward-line 1) + (and (looking-at comment-start-skip) + (goto-char (match-end 0)))) + (save-match-data + (looking-at copyright-years-regexp)))) + (forward-line 1) + (re-search-forward comment-start-skip) + (re-search-forward copyright-years-regexp)) + ;; Note that `current-time-string' isn't locale-sensitive. (setq copyright-current-year (substring (current-time-string) -4)) (unless (string= (buffer-substring (- (match-end 2) 2) (match-end 2))