bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

copyright.el and multi-line copyright statements


From: Karl Berry
Subject: copyright.el and multi-line copyright statements
Date: Mon, 6 Jan 2003 10:39:19 -0500

Some files have been around so long that a single physical line is not
enough to hold all the copyright years and still have a reasonable line
length.  Unfortunately, the copyright.el in emacs 21.2 does not read
more than one line.  It would be nice if it could handle multiple line
copyright statements as well.

I looked at the source; getting it to read past the newline is easy --
just add \n into copyright-regexp, as in:

(defcustom copyright-regexp
...
\\s *\\([1-9][-0-9, \n']*[0-9]+\\)"

However, when it then inserts a new year, it does so at the end of the
first line, not the end of the list of years.  That is:

  Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
  2001, 2002, Free Software Foundation, Inc.

incorrectly becomes

  Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003
  2001, 2002 Free Software Foundation, Inc.

The logic to fix this is not immediately apparent to me.  Help?

Thanks,
karl@gnu.org

P.S. The definitions for the form of a copyright statement in the USA
can be found at http://www.loc.gov/copyright/.  I did not find anything
there which states it must be on one physical line, despite some source
files obviously being written as though that were the case.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]