(copyright-update-year): Fix bug: Handle nil copyright-limit.
[bpt/emacs.git] / lisp / emacs-lisp / copyright.el
CommitLineData
3f61a2e7 1;;; copyright.el --- update the copyright notice in current buffer
d501f516 2
3731a850 3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1998, 2001, 2002, 2003,
f0fa15c5 4;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
58142744 5
3e910376 6;; Author: Daniel Pfeiffer <occitan@esperanto.org>
3f61a2e7
KH
7;; Keywords: maint, tools
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
e0085d62 13;; the Free Software Foundation; either version 3, or (at your option)
3f61a2e7
KH
14;; any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
b578f267 22;; along with GNU Emacs; see the file COPYING. If not, write to the
3a35cf56
LK
23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02110-1301, USA.
3f61a2e7
KH
25
26;;; Commentary:
27
28;; Allows updating the copyright year and above mentioned GPL version manually
f47f5302 29;; or when saving a file.
bcbc6fd3
SJ
30;; Do (add-hook 'before-save-hook 'copyright-update), or use
31;; M-x customize-variable RET before-save-hook RET.
0343b087 32
d46bac56
ER
33;;; Code:
34
3f251fcd
AS
35(defgroup copyright nil
36 "Update the copyright notice in current buffer."
37 :group 'tools)
38
39(defcustom copyright-limit 2000
b649d2e4 40 "Don't try to update copyright beyond this position unless interactive.
9c05459c 41A value of nil means to search whole buffer."
3f251fcd
AS
42 :group 'copyright
43 :type '(choice (integer :tag "Limit")
44 (const :tag "No limit")))
3f61a2e7 45
0cb9b63a
DL
46;; The character classes have the Latin-1 version and the Latin-9
47;; version, which is probably enough.
3f251fcd 48(defcustom copyright-regexp
2f12b713
MB
49