From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Years in copyright notices Date: 17 Jun 2004 15:13:47 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1087478064 17285 80.91.224.253 (17 Jun 2004 13:14:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 17 Jun 2004 13:14:24 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Jun 17 15:14:04 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BawiS-0003mh-00 for ; Thu, 17 Jun 2004 15:14:04 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BawiS-0004Vi-00 for ; Thu, 17 Jun 2004 15:14:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BawjV-0000Vv-4S for emacs-devel@quimby.gnus.org; Thu, 17 Jun 2004 09:15:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BawjL-0000VN-U6 for emacs-devel@gnu.org; Thu, 17 Jun 2004 09:15:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BawjK-0000V3-C9 for emacs-devel@gnu.org; Thu, 17 Jun 2004 09:14:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BawjK-0000V0-AF for emacs-devel@gnu.org; Thu, 17 Jun 2004 09:14:58 -0400 Original-Received: from [212.88.64.25] (helo=mail-relay.sonofon.dk) by monty-python.gnu.org with smtp (Exim 4.34) id 1Bawhx-0000vi-NC for emacs-devel@gnu.org; Thu, 17 Jun 2004 09:13:34 -0400 Original-Received: (qmail 93743 invoked from network); 17 Jun 2004 13:13:31 -0000 Original-Received: from unknown (HELO kfs-l.imdomain.dk.cua.dk) (213.83.150.2) by 0 with SMTP; 17 Jun 2004 13:13:31 -0000 Original-To: rms@gnu.org In-Reply-To: Original-Lines: 53 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25059 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25059 Richard Stallman writes: > The latest legal advice I got is that we should not drop the 19 or 20 > from year numbers in copyright notices. There is no need to change > all the existing notices, but the year numbers we add should be > written in 4 digits. Why not do it properly if we are going to fix 04 -> 2004 anyway? This function seems to do the job (could be added to copyright.el): (require 'copyright) ;;;###autoload (defun copyright-fix-years (&optional arg) "Convert 2 digit years to 4 digit years in copyright. With prefix arg, also update copyright. Uses heuristic: year >= 50 means 19xx, < 50 means 20xx." (interactive "P") (widen) (goto-char (point-min)) (if (re-search-forward copyright-regexp (+ (point) copyright-limit) t) (let ((s (match-beginning 2)) (e (make-marker)) last) (set-marker e (1+ (match-end 2))) (goto-char s) (while (and (< (point) (marker-position e)) (re-search-forward "\\([^0-9]\\)\\([0-9]+\\)[^0-9]" (marker-position e) t)) (let ((p (point)) (sep (match-string 1)) (year (string-to-number (match-string 2)))) (goto-char (1+ (match-beginning 0))) (unless (= (char-syntax (string-to-char sep)) ?\s) (insert " ")) (if (< year 100) (insert (if (>= year 50) "19" "20"))) (goto-char p) (setq last p))) (when last (goto-char last) (fill-region s last) ) (set-marker e nil) (if arg (copyright-update nil t))) (message "No copyright message") (goto-char (point-min)))) -- Kim F. Storm http://www.cua.dk