authors.el 42.4 KB
Newer Older
1
;;; authors.el --- utility for maintaining Emacs's AUTHORS file -*-coding: utf-8 -*-
Gerd Moellmann's avatar
Gerd Moellmann committed
2

3
;; Copyright (C) 2000-2014 Free Software Foundation, Inc.
Gerd Moellmann's avatar
Gerd Moellmann committed
4

5
;; Author: Gerd Moellmann <gerd@gnu.org>
6
;; Maintainer: Kim F. Storm <storm@cua.dk>
7
;; Keywords: maint
8
;; Package: emacs
9

Gerd Moellmann's avatar
Gerd Moellmann committed
10 11
;; This file is part of GNU Emacs.

12
;; GNU Emacs is free software: you can redistribute it and/or modify
Gerd Moellmann's avatar
Gerd Moellmann committed
13
;; it under the terms of the GNU General Public License as published by
14 15
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
Gerd Moellmann's avatar
Gerd Moellmann committed
16 17 18 19 20 21 22

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
23
;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
Gerd Moellmann's avatar
Gerd Moellmann committed
24 25 26 27

;;; Commentary:

;; Use M-x authors RET to create an *Authors* buffer that can used as
28
;; or merged with Emacs's AUTHORS file.
Gerd Moellmann's avatar
Gerd Moellmann committed
29 30 31

;;; Code:

32
(defvar authors-coding-system 'utf-8
33 34
  "Coding system used in the AUTHORS file.")

Gerd Moellmann's avatar
Gerd Moellmann committed
35 36
(defconst authors-many-files 20
  "Maximum number of files for which to print individual information.
37 38 39
If an author has modified more files, only the names of the most
frequently modified files are printed and a count of the additional
files.")
Gerd Moellmann's avatar
Gerd Moellmann committed
40 41

(defconst authors-aliases
42
  '(
43
    ("Aaron S. Hawley" "Aaron Hawley")
Glenn Morris's avatar
Glenn Morris committed
44
    ("Alexandru Harsanyi" "Alex Harsanyi")
45
    ("Andrew Csillag" "Drew Csillag")
46
    ("Anna M. Bigatti" "Anna Bigatti")
47 48
    ("Barry A. Warsaw" "Barry A. Warsaw, Century Computing, Inc."
     "Barry A. Warsaw, ITB" "Barry Warsaw")
Glenn Morris's avatar
Glenn Morris committed
49
    ("Bill Carpenter" "WJ Carpenter")
50 51
    ("Bill Mann" "William F. Mann")
    ("Bill Rozas" "Guillermo J. Rozas")
52
    ("Björn Torkelsson" "Bjorn Torkelsson")
53
    ("Brian Fox" "Brian J. Fox")
Glenn Morris's avatar
Glenn Morris committed
54
    ("Brian P Templeton" "BT Templeton")
Glenn Morris's avatar
Glenn Morris committed
55
    ("Brian Sniffen" "Brian T. Sniffen")
56 57 58
    ("Christoph Wedler" "Christoph.Wedler@sap.com")
    ("Daniel Pfeiffer" "<Daniel.Pfeiffer@Informatik.START.db.de>"
     "<Daniel.Pfeiffer@Informatik.START.dbp.de>")
Glenn Morris's avatar
Glenn Morris committed
59
    ("David Abrahams" "Dave Abrahams")
60
    ("David De La Harpe Golden" "David Golden")
61
    ("David Gillespie" "Dave Gillespie")
62
    ("David Kågedal" "David K..edal")
63
    ("David M. Koppelman" "David M. Koppelman, Koppel@Ec?e.Lsu.Edu"
64
     "David Koppelman")
65
    ("David M. Smith" "David Smith" "David M Smith")
66
    ("David O'Toole" "David T. O'Toole")
67
    ("Deepak Goel" "D. Goel")
68
    ("Ed L. Cashin" "Ed L Cashin")
69 70 71
    ("Edward M. Reingold" "Ed Reingold" "Edward M Reingold"
     "Reingold Edward M")
    ("Eli Zaretskii" "eliz")
Kim F. Storm's avatar
Kim F. Storm committed
72
    ("Emilio C. Lopes" "Emilio Lopes")
73
    ("Era Eriksson" "Era@Iki.Fi")
74 75 76
    ("Eric M. Ludlam" "Eric Ludlam")
    ("Eric S. Raymond" "Eric Raymond")
    ("Eric Youngdale" "(Eric Youngdale at youngdale@v6550c.nrl.navy.mil)")
77
    ("Francis J. Wright" "Dr Francis J. Wright" "Francis Wright")
78 79
    ("François Pinard" "Francois Pinard")
    ("Francesco Potortì" "Francesco Potorti" "Francesco Potorti`")
80 81
    ("Frederic Pierresteguy" "Fred Pierresteguy")
    ("Geoff Voelker" "voelker")
82
    ("Gerd Möllmann" "Gerd Moellmann")
83
    ("Hallvard B. Furuseth" "Hallvard B Furuseth" "Hallvard Furuseth")
84
    ("Hrvoje Nikšić" "Hrvoje Niksic")
Glenn Morris's avatar
Glenn Morris committed
85 86
    ;; lisp/org/ChangeLog 2010-11-11.
    (nil "aaa bbb")
87 88 89 90
    ;; src/ChangeLog.4, 1994-01-11, since fixed.
;;;    (nil "(afs@hplb.hpl.hp.com)")
    ;; lisp/gnus/ChangeLog.1, 1998-01-15.
    ;; http://quimby.gnus.org/cgi-bin/cvsweb.cgi/gnus/lisp/gnus-art.el?rev=4.13
91
    (nil "<Use-Author-Address-Header@\\[127.1\\]>")
92 93 94 95
    (nil "Code Extracted") ; lisp/newcomment.el's "Author:" header
    (nil "\\`FSF")  ; FIXME what is this for - no effect?
    ;; lisp/gnus/ChangeLog.1, 1997-10-12, since fixed.
;;;    (nil "ISO-2022-JP")
96
    ("Jaeyoun Chung" "Jae-youn Chung" "Jae-you Chung" "Chung Jae-youn")
97
    ("Jan Djärv" "Jan D." "Jan Djarv")
98
    ("Jay K. Adams" "jka@ece.cmu.edu" "Jay Adams")
99
    ("Jérôme Marant" "Jérôme Marant" "Jerome Marant")
100
    ("Jens-Ulrik Holger Petersen" "Jens-Ulrik Petersen")
101
    ("Jeremy Bertram Maitin-Shepard" "Jeremy Maitin-Shepard")
102
    ("Johan Bockgård" "Johan Bockgard")
Glenn Morris's avatar
Glenn Morris committed
103
    ("John J Foerch" "John Foerch")
Kim F. Storm's avatar
Kim F. Storm committed
104
    ("John W. Eaton" "John Eaton")
105
    ("Jonathan I. Kamens" "Jonathan Kamens")
Glenn Morris's avatar
Glenn Morris committed
106
    ("Jorgen Schäfer" "Jorgen Schaefer")
107
    ("Joseph Arceneaux" "Joe Arceneaux")
108
    ("Joseph M. Kelsey" "Joe Kelsey")	; FIXME ?
109
    ("Juan León Lahoz García" "Juan-Leon Lahoz Garcia")
110
    ("K. Shane Hartman" "Shane Hartman")
111
    ("Kai Großjohann" "Kai Grossjohann" "Kai Großjohann"
112 113
     "Kai.Grossjohann@Cs.Uni-Dortmund.De"
     "Kai.Grossjohann@Gmx.Net")
114
    ("Karl Berry" "K. Berry")
115
    ("Károly Lőrentey" "Károly Lőrentey" "Lőrentey Károly")
116
    ("Kazushi Marukawa" "Kazushi")
117 118
    ("Ken Manheimer" "Kenneth Manheimer")
    ("Kenichi Handa" "Ken'ichi Handa" "Kenichi HANDA")
Kim F. Storm's avatar
Kim F. Storm committed
119
    ("Kevin Greiner" "Kevin J. Greiner")
120
    ("Kim F. Storm" "Kim Storm")
121
    ("Kyle Jones" "Kyle E. Jones")
Glenn Morris's avatar
Glenn Morris committed
122
    ("Lars Magne Ingebrigtsen" "Lars Ingebrigtsen")
123
    ("Marcus G. Daniels" "Marcus Daniels")
124
    ("Mark D. Baushke" "Mark D Baushke")
125
    ("Marko Kohtala" "Kohtala Marko")
Glenn Morris's avatar
Glenn Morris committed
126
    ("Agustín Martín" "Agustin Martin" "Agustín Martín Domingo")
127 128
    ("Martin Lorentzon" "Martin Lorentzson")
    ("Matt Swift" "Matthew Swift")
129
    ("Maxime Edouard Robert Froumentin" "Max Froumentin")
Kim F. Storm's avatar
Kim F. Storm committed
130
    ("Michael R. Mauger" "Michael Mauger")
131
    ("Michael D. Ernst" "Michael Ernst")
132
    ("Michaël Cadilhac" "Michael Cadilhac")
133
    ("Michael I. Bushnell" "Michael I Bushnell" "Michael I. Bushnell, P/Bsg")
134 135
    ("Michael R. Cook" "Michael Cook")
    ("Michael Sperber" "Michael Sperber \\[Mr. Preprocessor\\]")
Kim F. Storm's avatar
Kim F. Storm committed
136
    ("Mikio Nakajima" "Nakajima Mikio")
137
    ("Nelson Jose dos Santos Ferreira" "Nelson Ferreira")
Glenn Morris's avatar
Glenn Morris committed
138
    ("Noorul Islam" "Noorul Islam K M")
139 140
    ("Paul Eggert" "eggert")
    ("Paul Reilly" "(pmr@legacy.pajato.com)")
Reiner Steib's avatar
Reiner Steib committed
141
    ("Pavel Janík" "Pavel Janík Ml." "Pavel Janik Ml." "Pavel Janik" "Pavel Janík" "Pavel@Janik.Cz")
142
    ("Pavel Kobiakov" "Pavel Kobyakov")
143
    ("Per Abrahamsen" "Per Abhiddenware")
144
    ("Per Starbäck" "Per Starback")
Glenn Morris's avatar
Glenn Morris committed
145
    ("Peter J. Weisberg" "PJ Weisberg")
146 147
    ("Peter S. Galbraith" "Peter Galbraith")
    ("Peter Runestig" "Peter 'luna' Runestig")
148
    ("Peter S. Galbraith" "Peter S Galbraith")
Glenn Morris's avatar
Glenn Morris committed
149 150
    ("Piotr Zieliński" "Piotr Zielinski")
    ("Rainer Schöpf" "Rainer Schoepf")
151 152 153
    ("Raja R. Harinath" "Raja R Harinath")
    ("Richard G. Bielawski" "Richard G Bielawski" "Richard Bielawski")
    ("Richard King" "Dick King")
154
    ("Richard M. Stallman" "Richard M. Stallman,,," "Richard Stallman"
155
     "rms" "rms@gnu.org")
156 157 158
    ("Robert J. Chassell" "Bob Chassell")
    ("Roland B. Roberts" "Roland B Roberts" "Roland Roberts")
    ("Rui-Tao Dong" "Rui-Tao Dong ~{6-Hpln~}")
Romain Francoise's avatar
Romain Francoise committed
159
    ("Sacha Chua" "Sandra Jean Chua")
160
    ("Sam Steingold" "Sam Shteingold")
161
    ("Satyaki Das" "Indexed search by Satyaki Das")
Glenn Morris's avatar
Glenn Morris committed
162
    ("Sébastien Vauban" "Sebastien Vauban")
163 164
    ;; There are other Stefans.
;;;    ("Stefan Monnier" "Stefan")
165 166
    ("Stephen A. Wood" "(saw@cebaf.gov)")
    ("Steven L. Baur" "SL Baur" "Steven L Baur")
167
    ("Stewart M. Clamen" "Stewart Clamen")
168
    ("Stuart D. Herring" "Stuart Herring" "Davis Herring")
Glenn Morris's avatar
Glenn Morris committed
169
    ("T.V. Raman" "T\\. V\\. Raman")
170
    ("Taichi Kawabata" "KAWABATA,? Taichi")
171
    ("Takaaki Ota" "Tak Ota")
Kim F. Storm's avatar
Kim F. Storm committed
172
    ("Takahashi Naoto" "Naoto Takahashi")
173
    ("Teodor Zlatanov" "Ted Zlatanov")
Glenn Morris's avatar
Glenn Morris committed
174
    ("Thomas Dye" "Tom Dye")
175 176
    ("Thomas Horsley" "Tom Horsley")	; FIXME ?
    ("Thomas Wurgler" "Tom Wurgler")
177
    ("Toby Cubitt" "Toby S\\. Cubitt")
178
    ("Tomohiko Morioka" "MORIOKA Tomohiko")
179 180
    ("Torbjörn Axelsson" "Torbjvrn Axelsson")
    ("Torbjörn Einarsson" "Torbj.*rn Einarsson")
181
    ("Toru Tomabechi" "Toru Tomabechi,")
182
    ("Tsugutomo Enami" "enami tsugutomo")
183
    ("Ulrich Müller" "Ulrich Mueller")
184
    ("Vincent Del Vecchio" "Vince Del Vecchio")
185
    ("William M. Perry" "Bill Perry")
186
    ("Wlodzimierz Bzyl" "W.*dek Bzyl")
187 188
    ("Yoni Rabkin" "Yoni Rabkin Katzenell")
    ("Yoshinori Koseki" "KOSEKI Yoshinori" "小関 吉則")
189
    ("Yutaka NIIBE" "NIIBE Yutaka")
190
    )
Gerd Moellmann's avatar
Gerd Moellmann committed
191 192
  "Alist of author aliases.

193
Each entry is of the form (REALNAME REGEXP...).  If an author's name
194
matches one of the REGEXPs, use REALNAME instead.
195
If REALNAME is nil, ignore that author.")
Gerd Moellmann's avatar
Gerd Moellmann committed
196

Glenn Morris's avatar
Glenn Morris committed
197
;; FIXME seems it would be less fragile to check for O', Mc, etc.
198
(defconst authors-fixed-case
Glenn Morris's avatar
Glenn Morris committed
199 200
  '("Brian van den Broek"
    "Bryan O'Sullivan"
201
    "Christian von Roques"
202
    "Christophe de Dinechin"
203 204 205 206
    "Craig McDaniel"
    "David J. MacKenzie"
    "David McCabe"
    "David O'Toole"
Glenn Morris's avatar
Glenn Morris committed
207
    "Devon Sean McCullough"
208 209 210 211 212 213
    "Dominique de Waleffe"
    "Edward O'Connor"
    "Exal de Jesus Garcia Carrillo"
    "Greg McGary"
    "Hans de Graaff"
    "James TD Smith"
Glenn Morris's avatar
Glenn Morris committed
214
    "Jay McCarthy"
215
    "Joel N. Weber II"
Glenn Morris's avatar
Glenn Morris committed
216
    "Matt McClure"
217 218
    "Michael McNamara"
    "Mike McEwan"
219
    "Nelson Jose dos Santos Ferreira"
220 221
    "Peter von der Ahe"
    "Peter O'Gorman"
Glenn Morris's avatar
Glenn Morris committed
222
    "Piet van Oostrum"
223
    "Roland McGrath"
Glenn Morris's avatar
Glenn Morris committed
224 225
    "Sean O'Halpin"
    "Sean O'Rourke"
Glenn Morris's avatar
Glenn Morris committed
226
    "Thomas DeWeese"
Glenn Morris's avatar
Glenn Morris committed
227
    "Tijs van Bakel")
228
  "List of authors whose names cannot be simply capitalized.")
Gerd Moellmann's avatar
Gerd Moellmann committed
229

230
(defvar authors-public-domain-files
231
  '("emerge\\.el"
232 233 234 235 236 237
    "vi\\.el"
    "feedmail\\.el"
    "mailpost\\.el"
    "hanoi\\.el"
    "meese\\.el"
    "studly\\.el"
238 239 240 241 242 243 244
    "modula2\\.el"
    "nnmaildir\\.el"
    "nnil\\.el"
    "b2m\\.c"
    "unexhp9k800\\.c"
    "emacsclient\\.1"
    "check-doc-strings")
245 246 247
  "List of regexps matching files for which the FSF doesn't need papers.")


248 249 250
(defvar authors-obsolete-files-regexps
  '("vc-\\*\\.el$"
    "spec.txt$"
251
    ".*loaddefs.el$"			; not obsolete, but auto-generated
Glenn Morris's avatar
Glenn Morris committed
252 253
    "\\.\\(cvs\\|git\\)ignore$"		; obsolete or uninteresting
    "\\.arch-inventory$"
Glenn Morris's avatar
Glenn Morris committed
254
    ;; TODO lib/? Matches other things?
Glenn Morris's avatar
Glenn Morris committed
255
    "build-aux/" "m4/" "Emacs.xcodeproj" "charsets" "mapfiles"
Glenn Morris's avatar
Glenn Morris committed
256
    "preferences\\.\\(nib\\|gorm\\)"
257 258
    "vc-\\(rcs\\|cvs\\|sccs\\)-hooks\\.el$")
  "List of regexps matching obsolete files.
Glenn Morris's avatar
Glenn Morris committed
259
Changes to files matching one of the regexps in this list are not listed.")
260

Kim F. Storm's avatar
Kim F. Storm committed
261 262 263 264
(defconst authors-ignored-files
  '("external-lisp"
    "lock" "share-lib" "local-lisp"
    "noleim-Makefile.in"
265 266 267 268 269 270
    "NEWS" "ORDERS" "PROBLEMS" "FAQ" "AUTHORS" "FOR-RELEASE" "TODO" "todo"
    "MACHINES" "SERVICE"
    "README.unicode" "README.multi-tty" "TUTORIAL.translators"
    "NEWS.unicode" "COPYING.DJ" "Makefile.old" "Makefile.am"
    "NEWS.1" "OOOOONEWS...OONEWS" "OOOONEWS" "etc/NEWS"
    "NEWS.1-17" "NEWS.18" "NEWS.19" "NEWS.20" "NEWS.21" "NEWS.22"
271
    "MAINTAINERS" "MH-E-NEWS"
272 273 274 275 276 277 278
    "install-sh" "missing" "mkinstalldirs"
    "termcap.dat" "termcap.src" "termcap.ucb" "termcap"
    "ChangeLog.nextstep" "Emacs.clr" "spec.txt"
    "gfdl.1"
    "texi/Makefile.in"
    "Imakefile" "icons/sink.ico" "aixcc.lex"
    "nxml/char-name/unicode"
279
    "js2-mode.el"      ; only installed very briefly, replaced by js.el
Glenn Morris's avatar
Glenn Morris committed
280 281 282 283 284 285 286 287
    "cedet/tests/testtemplates.cpp"
    "cedet/tests/testusing.cpp"
    "cedet/tests/scopetest.cpp"
    "cedet/tests/scopetest.java"
    "cedet/tests/test.cpp"
    "cedet/tests/test.py"
    "cedet/tests/teststruct.cpp"
    "*.el"
288 289
    ;; Autogen:
    "cus-load.el" "finder-inf.el" "ldefs-boot.el"
Glenn Morris's avatar
Glenn Morris committed
290
    "compile" "config.guess" "config.sub" "depcomp"
291 292 293 294 295
    "autogen/compile" "autogen/config.guess" "autogen/config.in"
    "autogen/config.sub" "autogen/depcomp" "autogen/install-sh"
    "autogen/missing" "autogen"
    "autogen/copy_autogen" ; not generated, but trivial and now removed
    "dir_top"
Glenn Morris's avatar
Glenn Morris committed
296 297 298
    ;; Only existed briefly, then renamed:
    "images/icons/allout-widgets-dark-bg"
    "images/icons/allout-widgets-light-bg"
299
    ;; Never had any meaningful changes logged, now deleted:
Glenn Morris's avatar
Glenn Morris committed
300
    "unidata/bidimirror.awk" "unidata/biditype.awk"
301
    "split-man" "Xkeymap.txt" "ms-7bkermit" "ulimit.hack"
302
    "gnu-hp300" "refcard.bit" "ledit.l" "forms.README" "forms-d2.dat"
303 304 305 306 307
    "CXTERM-DIC/PY.tit" "CXTERM-DIC/ZIRANMA.tit"
    "CXTERM-DIC/CTLau.tit" "CXTERM-DIC/CTLauB.tit"
    "NICKLES.WORTH" "INTERVAL.IDEAS" "RCP"
    "3B-MAXMEM" "AIX.DUMP" "SUN-SUPPORT" "XENIX"
    "CODINGS" "CHARSETS"
Glenn Morris's avatar
Glenn Morris committed
308
    "calc/INSTALL" "calc/Makefile" "calc/README.prev"
Glenn Morris's avatar
Glenn Morris committed
309
    "vms-pp.trans" "_emacs" "batcomp.com" "notes/cpp" ; admin/
Glenn Morris's avatar
Glenn Morris committed
310
    "emacsver.texi.in"
Glenn Morris's avatar
Glenn Morris committed
311 312 313 314 315 316 317 318
    "vpath.sed"
    "Cocoa/Emacs.base/Contents/Info.plist"
    "Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings"
    "GNUstep/Emacs.base/Resources/Info-gnustep.plist"
    "GNUstep/Emacs.base/Resources/Emacs.desktop"
    "Cocoa/Emacs.base/Contents/Resources/English.lproj"
    ;; Only existed briefly, then deleted:
    "coccinelle/overlay.cocci" "coccinelle/symbol.cocci"
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
    ;; MH-E stuff not in Emacs:
    "import-emacs" "release-utils"
    ;; Erc stuff not in Emacs:
    "ChangeLog.2001" "ChangeLog.2002" "ChangeLog.2003" "ChangeLog.2004"
    "ChangeLog.2005"
    "README.extras" "dir-template" "mkChangeLog" "MkChangeLog" "erc-auto.in"
    "CREDITS" "HACKING"
    "debian/changelog"
    "debian/control"
    "debian/copyright"
    "debian/maint/conffiles"
    "debian/maint/conffiles.in"
    "debian/maint/postinst"
    "debian/maint/postinst.in"
    "debian/maint/prerm"
    "debian/maint/prerm.in"
    "debian/README.Debian"
    "debian/README.erc-speak"
    "debian/rules"
    "debian/scripts/install"
    "debian/scripts/install.in"
    "debian/scripts/remove"
    "debian/scripts/remove.in"
    "debian/scripts/startup"
    "debian/scripts/startup.erc"
    "debian/scripts/startup.erc-speak"
Glenn Morris's avatar
Glenn Morris committed
345 346 347 348 349 350 351 352 353
    ;; Used to be in admin, not very interesting.
    "emacs-pretesters" "make-announcement" "make-changelog-diff"
    ;; Generated files that have since been removed.
    "refcards/calccard.pdf" "refcards/cs-dired-ref.pdf" "refcards/cs-refcard.pdf"
    "refcards/de-refcard.pdf" "refcards/dired-ref.pdf" "refcards/fr-dired-ref.pdf"
    "refcards/fr-refcard.pdf" "refcards/gnus-booklet.pdf" "refcards/gnus-refcard.pdf"
    "refcards/orgcard.pdf" "refcards/pl-refcard.pdf" "refcards/pt-br-refcard.pdf"
    "refcards/refcard.pdf" "refcards/ru-refcard.pdf" "refcards/sk-dired-ref.pdf"
    "refcards/sk-refcard.pdf"
354
    )
Kim F. Storm's avatar
Kim F. Storm committed
355 356
  "List of files and directories to ignore.
Changes to files in this list are not listed.")
357

Glenn Morris's avatar
Glenn Morris committed
358 359 360 361 362 363 364 365 366 367
;; List via: find . -name '*.el' | sed 's/.*\///g' | sort | uniq -d
;; FIXME It would be better to discover these dynamically.
;; Note that traditionally "Makefile.in" etc have not been in this list.
;; Ditto for "abbrev.texi" etc.
(defconst authors-ambiguous-files
  '("chart.el"
    "compile.el"
    "complete.el"
    "cpp.el"
    "ctxt.el"
Glenn Morris's avatar
Glenn Morris committed
368 369 370
    "custom.el"
    "cyrillic.el"
    "czech.el"
Glenn Morris's avatar
Glenn Morris committed
371 372 373
    "debug.el"
    "dired.el"
    "el.el"
Glenn Morris's avatar
Glenn Morris committed
374 375 376
    "eshell.el"
    "ethiopic.el"
    "f90.el"
Glenn Morris's avatar
Glenn Morris committed
377 378 379
    "files.el"
    "find.el"
    "format.el"
Glenn Morris's avatar
Glenn Morris committed
380 381 382
    "generic.el"
    "georgian.el"
    "greek.el"
Glenn Morris's avatar
Glenn Morris committed
383
    "grep.el"
Glenn Morris's avatar
Glenn Morris committed
384
    "hebrew.el"
Glenn Morris's avatar
Glenn Morris committed
385
    "imenu.el"
Glenn Morris's avatar
Glenn Morris committed
386 387
    "indian.el"
    "japanese.el"
Glenn Morris's avatar
Glenn Morris committed
388
    "java.el"
Glenn Morris's avatar
Glenn Morris committed
389
    "lao.el"
Glenn Morris's avatar
Glenn Morris committed
390 391 392 393 394
    "linux.el"
    "locate.el"
    "make.el"
    "mode.el"
    "python.el"
Glenn Morris's avatar
Glenn Morris committed
395
    "rmailmm.el"
Glenn Morris's avatar
Glenn Morris committed
396 397 398
    "semantic.el"
    "shell.el"
    "simple.el"
Glenn Morris's avatar
Glenn Morris committed
399
    "slovak.el"
Glenn Morris's avatar
Glenn Morris committed
400 401 402 403 404
    "sort.el"
    "speedbar.el"
    "srecode.el"
    "table.el"
    "texi.el"
Glenn Morris's avatar
Glenn Morris committed
405 406
    "thai.el"
    "tibetan.el"
Glenn Morris's avatar
Glenn Morris committed
407
    "util.el"
Glenn Morris's avatar
Glenn Morris committed
408
    "vc-bzr.el"
Glenn Morris's avatar
Glenn Morris committed
409 410 411
    "wisent.el")
  "List of basenames occurring more than once in the source.")

412 413 414
;; FIXME :cowrote entries here can be overwritten by :wrote entries
;; derived from a file's Author: header (eg mh-e).  This really means
;; the Author: header is erroneous.
415
(defconst authors-fixed-entries
416
  '(("Richard M. Stallman" :wrote "[The original GNU Emacs and numerous files]")
417
    ("Joseph Arceneaux" :wrote "xrdb.c")
418 419
    ;; This refers to the obsolete Willisson (qv) version.
;;;    ("Blitz Product Development Corporation" :wrote "ispell.el")
420 421
    ("Frank Bresz" :wrote "diff.el")
    ("David M. Brown" :wrote "array.el")
422 423
    ;; No longer distributed.
;;;    ("Gary Byers" :changed "xenix.h")
424
    ("Shawn M. Carey" :wrote "freebsd.h")
425
    ;; hp800.h renamed from hp9000s800.h, hpux.h merged into hpux10-20.h.
426 427
    ;; FIXME overwritten by Author:.
    ("Satyaki Das" :cowrote "mh-search.el")
428 429 430 431
    ("Eric Decker" :changed "hp800.h" "hpux10-20.h" "sysdep.c")
    ("Lawrence R. Dodd" :cowrote "dired-x.el")
    ;; No longer distributed.
;;;    ("Viktor Dukhovni" :wrote "unexsunos4.c")
Glenn Morris's avatar
Glenn Morris committed
432
    ("Paul Eggert" :wrote "rcs2log") ; "vcdiff"
433
    ("Fred Fish" :changed "unexcoff.c")
434 435
    ;; No longer distributed.
;;;    ("Tim Fleehart" :wrote "makefile.nt")
436 437
    ("Keith Gabryelski" :wrote "hexl.c")
    ("Kevin Gallagher" :wrote "flow-ctrl.el")
438 439 440 441 442
    ;; Also wrote an earlier version of disp-table.el, since replaced
    ;; by Erik Naggum's version; also iso-syntax.el, later renamed to
    ;; latin-1.el, since deleted.
    ("Howard Gayle" :wrote "casetab.c")
    ;; :wrote mh-pick.el, since merged into mh-search.el.
443 444 445
    ;; Originally wrote mh-funcs.el, but it has been rewritten since.
    ("Stephen Gildea" :wrote "refcard.tex"
     :cowrote "mh-funcs.el" "mh-search.el")
446 447 448 449 450 451
    ;; cl.texinfo renamed to cl.texi.
    ("David Gillespie" :wrote "cl.texi")
    ;; No longer distributed: emacsserver.c.
    ("Hewlett-Packard" :changed "emacsclient.c" "server.el" "keyboard.c")
    ;; No longer distributed.
;;;    ("Thomas Horsley" :wrote "cxux.h" "cxux7.h")
452 453
    ("Indiana University Foundation" :changed "buffer.c" "buffer.h"
     "indent.c" "search.c" "xdisp.c" "region-cache.c" "region-cache.h")
454
    ;; ibmrt.h, ibmrt-aix.h no longer distributed.
455
    ("International Business Machines" :changed "emacs.c" "fileio.c"
456
     "process.c" "sysdep.c" "unexcoff.c")
457 458 459
    ;; No longer distributed.
;;;    ("Ishikawa Chiaki" :changed "aviion.h" "dgux.h")
    ;; ymakefile no longer distributed.
460
    ("Michael K. Johnson" :changed "configure.ac" "emacs.c" "intel386.h"
461
     "mem-limits.h" "process.c" "template.h" "sysdep.c" "syssignal.h"
462
     "systty.h" "unexcoff.c" "linux.h")
463 464
    ;; No longer distributed.
;;;    ("Kyle Jones" :wrote "mldrag.el")
Kim F. Storm's avatar
Kim F. Storm committed
465
    ("Henry Kautz" :wrote "bib-mode.el")
466 467
    ;; No longer distributed: vms-pwd.h, vmsfns.c, uaf.h.
    ("Joseph M. Kelsey" :changed "fileio.c" "dir.h")
468
    ("Sam Kendall" :changed "etags.c" "etags.el")
469 470
    ;; ack.texi: "We're not using his backquote.el any more."
    ("Richard King" :wrote "userlock.el" "filelock.c")
471 472 473
    ("Sebastian Kremer" :changed "add-log.el")
    ("Mark Lambert" :changed "process.c" "process.h")
    ("Aaron Larson" :changed "bibtex.el")
474 475
    ;; It was :wrote, but it has been rewritten since.
    ("James R. Larus" :cowrote "mh-e.el")
476 477
    ("Lars Lindberg" :changed "dabbrev.el" :cowrote "imenu.el")
    ;; No longer distributed: lselect.el.
478 479
    ("Lucid, Inc." :changed "bytecode.c" "byte-opt.el" "byte-run.el"
     "bytecomp.el" "delsel.el" "disass.el" "faces.el" "font-lock.el"
480
     "lmenu.el" "mailabbrev.el" "select.el" "xfaces.c" "xselect.c")
481 482 483
    ;; MCC.  No longer distributed: emacsserver.c.
    ("Microelectronics and Computer Technology Corporation"
     :changed "etags.c" "emacsclient.c" "movemail.c"
484 485
     "rmail.el" "rmailedit.el" "rmailkwd.el"
     "rmailmsc.el" "rmailout.el" "rmailsum.el" "scribe.el"
486
     ;; It was :wrote for xmenu.c, but it has been rewritten since.
487
     "server.el" "lisp.h" "sysdep.c" "unexcoff.c" "xmenu.c")
488
    ("Niall Mansfield" :changed "etags.c")
489
    ("Brian Marick" :cowrote "hideif.el")
490 491
    ("Marko Kohtala" :changed "info.el")
    ("Sidney Markowitz" :changed "doctor.el")
492 493
    ;; No longer distributed: env.c.
    ("Richard Mlynarik" :wrote "ehelp.el")
494 495 496 497 498
    ("Mosur Mohan" :changed "etags.c")
    ("Jeff Morgenthaler" :changed "flow-ctrl.el" "vt200.el" "vt201.el"
     "vt220.el" "vt240.el")
    ("Motorola" :changed "buff-menu.el")
    ("Hiroshi Nakano" :changed "ralloc.c")
Glenn Morris's avatar
Glenn Morris committed
499 500
    ;; File removed in Emacs 24.1.
;;;    ("Sundar Narasimhan" :changed "rnewspost.el")
501 502
    ;; No longer distributed.
;;;    ("NeXT, Inc." :wrote "unexnext.c")
503
    ("Mark Neale" :changed "fortran.el")
504 505 506
    ;; Renamed from sc.el.
    ("Martin Neitzel" :changed "supercite.el")
    ("Andrew Oram" :changed "calendar.texi (and other files in man/)")
507 508
    ("Frederic Pierresteguy" :wrote "widget.c")
    ("Michael D. Prange" :changed "tex-mode.el")
509 510 511 512 513 514 515
    ;; No longer distributed (dgux5-4r3.h was renamed to dgux5-4-3.h).
;;;    ("Paul Reilly" :wrote "gux5-4r2.h" "dgux5-4-3.h")
    ("Roland B. Roberts" :changed "files.el" "sort.el"
     "buffer.h" "callproc.c" "dired.c" "process.c" "sysdep.c" "systty.h")
     ;; No longer distributed.
;;;     "vmspaths.h" "build.com" "compile.com" "kepteditor.com" "precomp.com"
;;;     "vmsproc.el" :wrote "logout.com" "mailemacs.com")
516
;;;    ("Guillermo J. Rozas" :wrote "fakemail.c")
517 518
    ("Wolfgang Rupprecht" :changed "lisp-mode.el" "loadup.el"
     "sort.el" "alloc.c" "callint.c"
519 520 521 522
     ;; config.in renamed from config.h.in; ecrt0.c from crt0.c.
     "config.in" "ecrt0.c" "data.c" "fns.c"
     "lisp.h" "lread.c" ; "sun3.h" "ymakefile" - no longer distributed
     "print.c" :wrote "float-sup.el" "floatfns.c")
523
    ("Schlumberger Technology Corporation" :changed "gud.el")
524 525
    ;; Replaced by tcl.el.
;;;    ("Gregor Schmid" :wrote "tcl-mode.el")
526 527
    ;; No longer distributed since 24.1.
;;;    ("Rainer Schöpf" :wrote "alpha.h" "unexalpha.c")
528 529 530 531
    ;; No longer distributed: emacsserver.c.
    ("William Sommerfeld" :wrote "emacsclient.c" "scribe.el")
    ;; No longer distributed: emacsserver.c.
    ("Leigh Stoller" :changed "emacsclient.c" "server.el")
Paul Eggert's avatar
Paul Eggert committed
532
    ("Steve Strassmann" :wrote "spook.el")
533
    ("Shinichirou Sugou" :changed "etags.c")
534 535 536 537 538 539 540 541 542 543
    ;; No longer distributed: emacsserver.c.
    ("Sun Microsystems, Inc" :changed "emacsclient.c" "server.el"
     :wrote "emacs.icon" "sun.el")
    ;; No longer distributed.
;;;     "emacstool.1" "emacstool.c" "sun-curs.el"
;;;     "sun-fns.el" "sun-mouse.el" "sunfns.c")
    ;; Renamed from sc.el.
    ("Kayvan Sylvan" :changed "supercite.el")
    ;; No longer distributed: emacsserver.c, tcp.c.
    ("Spencer Thomas" :changed "emacsclient.c" "server.el"
544
     "dabbrev.el" "unexcoff.c" "gnus.texi")
545
    ("Jonathan Vail" :changed "vc.el")
546
    ("James Van Artsdalen" :changed "usg5-4.h" "unexcoff.c")
547 548 549 550 551 552 553
    ;; No longer distributed: src/makefile.nt, lisp/makefile.nt
    ;; winnt.el renamed to w32-fns.el; nt.[ch] to w32.[ch];
    ;; ntheap.[ch] to w32heap.[ch]; ntinevt.c to w32inevt.c;
    ;; ntproc.c to w32proc.c; ntterm.c to w32term.c;
    ;; windowsnt.h to ms-w32.h.
    ("Geoff Voelker" :wrote "w32-fns.el" "w32.c" "w32.h" "w32heap.c"
     "w32heap.h" "w32inevt.c" "w32proc.c" "w32term.c" "ms-w32.h")
554
    ("Morten Welinder" :wrote "dosfns.c" "[many MS-DOS files]" "msdos.h")
555
    ("Eli Zaretskii" :wrote "bidi.c" "[bidirectional display in xdisp.c]")
556 557
    ;; Not using this version any more.
;;;    ("Pace Willisson" :wrote "ispell.el")
558 559
    ;; FIXME overwritten by Author:.
    ("Bill Wohler" :cowrote "mh-e.el")
560
    ("Garrett Wollman" :changed "sendmail.el")
561
    ("Dale R. Worley" :changed "mail-extr.el")
562 563
    ("Jamie Zawinski" :changed "bytecode.c" :wrote "tar-mode.el"
     :cowrote "disass.el"))
564 565 566
  "Actions taken from the original, manually (un)maintained AUTHORS file.")


567 568
(defconst authors-valid-file-names
  '("aclocal.m4"
569 570
    "build-ins.in"
    "Makefile.noleim"
Kim F. Storm's avatar
Kim F. Storm committed
571
    "makedist.bat"
572 573
    "makefile.def"
    "makefile.nt"
Glenn Morris's avatar
Glenn Morris committed
574
    "ns.mk"
575 576 577 578 579
    "debug.bat.in" "emacs.bat.in"
    ".gdbinit-union"
    "alloca.s"
    "make-delta"
    "config.w95"
580
    "msysconfig.sh"
581 582 583 584 585 586 587
    "emacstool.1"
    "align.umax"
    "cxux-crt0.s"
    "gould-sigvec.s"
    "getdate.y"
    "ymakefile"
    "permute-index" "index.perm"
Glenn Morris's avatar
Glenn Morris committed
588
    "ibmrs6000.inp"
Glenn Morris's avatar
Glenn Morris committed
589
    "b2m.c" "b2m.1" "b2m.pl" "rcs-checkin.1"
Glenn Morris's avatar
Glenn Morris committed
590
    "emacs.bash" "emacs.csh" "ms-kermit"
591
    "emacs.ico"
592
    "emacs21.ico"
Glenn Morris's avatar
Glenn Morris committed
593
    "emacs.py" "emacs2.py" "emacs3.py"
Glenn Morris's avatar
Glenn Morris committed
594
    "BABYL" "LPF" "LEDIT" "OTHER.EMACSES"
595 596 597
    "emacs16_mac.png" "emacs24_mac.png"
    "emacs256_mac.png" "emacs32_mac.png"
    "emacs48_mac.png" "emacs512_mac.png"
Glenn Morris's avatar
Glenn Morris committed
598
    "revdiff"				; admin/
Glenn Morris's avatar
Glenn Morris committed
599
    "vcdiff" "rcs-checkin" "tindex.pl"
Glenn Morris's avatar
Glenn Morris committed
600 601
    "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/
    "mac-fix-env.m"
602 603 604
    ;; Deleted vms stuff:
    "temacs.opt" "descrip.mms" "compile.com" "link.com"
    )
Glenn Morris's avatar
Glenn Morris committed
605 606
  "File names which are valid, but no longer exist (or cannot be found)
in the repository.")
607 608 609 610 611 612 613 614 615

(defconst authors-renamed-files-alist
  '(("nt.c" . "w32.c") ("nt.h" . "w32.h")
    ("ntheap.c" . "w32heap.c") ("ntheap.h" . "w32heap.h")
    ("ntinevt.c" . "w32inevt.c") ("ntinevt.h" . "w32inevt.h")
    ("ntproc.c" . "w32proc.c")
    ("w32console.c" . "w32term.c")
    ("unexnt.c" . "unexw32.c")
    ("s/windowsnt.h" . "s/ms-w32.h")
616
    ("s/ms-w32.h" . "inc/ms-w32.h")
617
    ("winnt.el" . "w32-fns.el")
Glenn Morris's avatar
Glenn Morris committed
618
    ("emacs.manifest" . "emacs-x86.manifest")
619
    ("config.emacs" . "configure")
620
    ("configure.in" . "configure.ac")
621 622 623
    ("config.h.dist" . "config.in")
    ("config.h-dist" . "config.in")
    ("config.h.in" . "config.in")
624 625
    ("paths.h-dist" . "paths.h.in")
    ("patch1" . "sed1.inp")
626
    ("enriched.doc" . "enriched.txt")
627
    ("GETTING.GNU.SOFTWARE" . "FTP")
628 629 630 631 632 633 634 635 636 637 638 639
    ("etc/MACHINES" . "MACHINES")
    ("ONEWS" . "NEWS.19")
    ("ONEWS.1" . "NEWS.1-17")
    ("ONEWS.2" . "NEWS.1-17")
    ("ONEWS.3" . "NEWS.18")
    ("ONEWS.4" . "NEWS.18")
    ("ORDERS.USA" . "ORDERS")
    ("EUROPE" . "ORDERS")
    ("DIFF" . "OTHER.EMACSES")
    ("CCADIFF" . "OTHER.EMACSES")
    ("GOSDIFF" . "OTHER.EMACSES")
    ("Makefile.in.in" . "Makefile.in")
Kim F. Storm's avatar
Kim F. Storm committed
640 641
    ("leim-Makefile" . "leim/Makefile")
    ("leim-Makefile.in" . "leim/Makefile.in")
642 643
    ("emacs-lisp/testcover-ses.el" . "tcover-ses.el")
    ("emacs-lisp/testcover-unsafep.el" . "tcover-unsafep.el")
644 645 646
    ;; index and pick merged into search.
    ("mh-index.el" . "mh-search.el")
    ("mh-pick.el" . "mh-search.el")
Glenn Morris's avatar
Glenn Morris committed
647
    ("font-setting.el" . "dynamic-setting.el")
648 649 650
    ;; INSTALL-CVS -> .CVS -> .BZR
    ("INSTALL-CVS" . "INSTALL.BZR")
    ("INSTALL.CVS" . "INSTALL.BZR")
651
    ("INSTALL.BZR" . "INSTALL.REPO")
652 653 654 655 656
    ("refcards/fr-drdref.pdf" . "refcards/fr-dired-ref.pdf")
    ("gnus-logo.eps" . "refcards/gnus-logo.eps")
    ("build-install" . "build-ins.in")
    ("build-install.in" . "build-ins.in")
    ("unidata/Makefile" . "unidata/Makefile.in")
Glenn Morris's avatar
Glenn Morris committed
657 658
    ("move-if-change" . "build-aux/move-if-change")
    ("update-subdirs" . "build-aux/update-subdirs")
659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
    ;; Not renamed, but we only have the latter in the Emacs repo.
    ("trampver.texi.in" . "trampver.texi")
    ("e/eterm" . "e/eterm-color")
    ("e/eterm.ti" . "e/eterm-color.ti")
    ("README.txt" . "README")
    ("emacs.names" . "JOKES")
    ("ED.WORSHIP" . "JOKES")
    ("GNU.JOKES" . "JOKES")
    ("CHARACTERS" . "TODO")
    ("schema/xhtml-basic-form.rnc" . "schema/xhtml-bform.rnc" )
    ("schema/xhtml-basic-table.rnc" . "schema/xhtml-btable.rnc")
    ("schema/xhtml-list.rnc" . "schema/xhtml-lst.rnc")
    ("schema/xhtml-target.rnc" . "schema/xhtml-tgt.rnc")
    ("schema/xhtml-style.rnc" . "schema/xhtml-xstyle.rnc")
    ("schema/docbook-dyntbl.rnc" . "schema/docbk-dyntbl.rnc")
    ("schema/docbook-soextbl.rnc" . "schema/docbk-soextbl.rn" )
    ("texi/url.txi" . "url.texi")
Glenn Morris's avatar
Glenn Morris committed
676
    ("edt-user.doc" . "edt.texi")
Glenn Morris's avatar
Glenn Morris committed
677
    ("DEV-NOTES" . "nextstep")
Glenn Morris's avatar
Glenn Morris committed
678
    ("org/COPYRIGHT-AND-LICENSE" . "org/README")
679 680 681 682 683 684
    ;; Moved to different directories.
    ("ctags.1" . "ctags.1")
    ("etags.1" . "etags.1")
    ("emacs.1" . "emacs.1")
    ("emacsclient.1" . "emacsclient.1")
    ("icons/emacs21.ico" . "emacs21.ico")
685 686 687 688 689 690
    ("ja-dic" . "leim/ja-dic")
    ("quail" . "leim/quail")
    ;; Moved from autogen/ to admin/.
    ("autogen/update_autogen" . "update_autogen")
    ;; Moved from etc/ to admin/.
    ("grammars" . "grammars")
Glenn Morris's avatar
Glenn Morris committed
691 692
    ;; Moved from admin/nt/ to nt/.
    ("nt/README.W32" . "README.W32")
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714
    )
  "Alist of files which have been renamed during their lifetime.
Elements are (OLDNAME . NEWNAME).")

(defconst authors-renamed-files-regexps
  '(("^m/m-\\(.*\\.h\\)$" . "m/\\1")
    ("^m-\\(.*\\.h\\)$" . "\\1")
    ("^s/s-\\(.*\\.h\\)$" . "s/\\1")
    ("^s-\\(.*\\.h\\)$" . "\\1")
    ("^s/[-.a-zA-Z0-9_]+\\.h$" . t)
    ("\\(.*\\)\\.cmd$" . "\\1.bat")
    ("\\.bat$" . t)
    ("\\.[ch]$" . t)
    ("\\.el$" . t)
    ("\\.ps$" . t)
    ("\\.texi?$" . t)
    ("\\.texinfo$" . t)
    ("\\.xml?$" . t)
    ("\\.x[pb]m$" . t)
    ("\\.[xp]bm$" . t)
    ("^paths\\." . t)
    ("^install\\." . t)
715 716 717 718 719 720 721
    ("^\\(TUTORIAL[^/]*\\)" . "tutorials/\\1")
    ("^\\(tree-widget/\\(?:default\\|folder\\)/[-a-z]+\\.png\\)$" .
     "images/\\1")
    ("^\\(images/icons/\\)mac\\(emacs\\)_\\([0-9]+\\)\\(\\.png\\)" .
     "\\1\\2\\3_mac\\4")
    ("\\(images/icons/\\)emacs_\\([0-9][0-9]\\)\\.png" .
     "\\1hicolor/\\2x\\2/apps/emacs.png")
722 723 724 725 726 727 728 729 730
    )
  "List regexps and rewriting rules for renamed files.
Elements are (REGEXP . REPLACE).  If REPLACE is a string, the file
name matching REGEXP is replaced by REPLACE using `replace-string'.
Otherwise, the file name is accepted as is.")

(defvar authors-checked-files-alist)
(defvar authors-invalid-file-names)

Glenn Morris's avatar
Glenn Morris committed
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745
(defun authors-disambiguate-file-name (fullname)
  "Convert FULLNAME to an unambiguous relative-name."
  (let ((relname (file-name-nondirectory fullname))
	parent)
    (if (member relname authors-ambiguous-files)
	;; In case of ambiguity, just prepend the parent directory.
	;; FIXME obviously this is not a perfect solution.
	(if (string-equal "lisp"
			  (setq parent (file-name-nondirectory
					(directory-file-name
					 (file-name-directory fullname)))))
	    relname
	  (format "%s/%s" parent relname))
      relname)))

746
(defun authors-canonical-file-name (file log-file pos author)
747
  "Return canonical file name for FILE found in LOG-FILE.
748
Checks whether FILE is a valid (existing) file name, has been renamed,
Glenn Morris's avatar
Glenn Morris committed
749
or is on the list of removed files.  Returns the non-directory part of
750 751
the file name.  Only uses the LOG-FILE position POS and associated AUTHOR
to print a message if FILE is not found."
752
  ;; FILE should be re-checked in every different directory associated
753
  ;; with a LOG-FILE.  Eg configure.ac from src/ChangeLog is not the
754 755 756 757 758
  ;; same as that from top-level/ChangeLog.
  (let* ((fullname (expand-file-name file (file-name-directory log-file)))
	 (entry (assoc fullname authors-checked-files-alist))
	 relname
	 valid)
759 760 761 762 763 764 765
    (if entry
	(cdr entry)
      (setq relname (file-name-nondirectory file))
      (if (or (member relname authors-valid-file-names)
	      (file-exists-p file)
	      (file-exists-p relname)
	      (file-exists-p (concat "etc/" relname)))
Glenn Morris's avatar
Glenn Morris committed
766
	  (setq valid (authors-disambiguate-file-name fullname))
767 768 769 770 771 772 773 774 775 776 777 778 779
	(setq valid (assoc file authors-renamed-files-alist))
	(if valid
	    (setq valid (cdr valid))
	  (let ((rules authors-renamed-files-regexps))
	    (while rules
	      (if (string-match (car (car rules)) file)
		  (setq valid (if (stringp (cdr (car rules)))
				  (file-name-nondirectory
				   (replace-match (cdr (car rules)) t nil file))
				relname)
			rules nil))
	      (setq rules (cdr rules))))))
      (setq authors-checked-files-alist
780
	    (cons (cons fullname valid) authors-checked-files-alist))
781
      (unless (or valid
782
		  (member file authors-ignored-files)
Glenn Morris's avatar
Glenn Morris committed
783
		  (authors-obsolete-file-p file)
784 785
		  (string-match "[*]" file)
		  (string-match "^[0-9.]+$" file))
786
	(setq authors-invalid-file-names
787 788 789 790 791 792 793
	      (cons (format "%s:%d: unrecognized `%s' for %s"
			    log-file
			    (1+ (count-lines (point-min) pos))
			    file author)
		    authors-invalid-file-names)))
      valid)))

794 795 796 797 798 799 800 801 802 803
(defun authors-add-fixed-entries (table)
  "Add actions from `authors-fixed-entries' to TABLE."
  (dolist (entry authors-fixed-entries)
    (let ((author (car entry))
	  action)
      (dolist (item (cdr entry))
	(if (symbolp item)
	    (setq action item)
	  (authors-add author item action table))))))

804

805 806
(defun authors-obsolete-file-p (file)
  "Return non-nil if FILE is obsolete.
807
FILE is considered obsolete if it matches one of the regular expressions
808 809 810 811 812 813 814 815 816
from `authors-obsolete-files-regexps'."
  (let (obsolete-p
	(regexps authors-obsolete-files-regexps))
    (while (and regexps (not obsolete-p))
      (setq obsolete-p (string-match (car regexps) file)
	    regexps (cdr regexps)))
    obsolete-p))


Gerd Moellmann's avatar
Gerd Moellmann committed
817 818 819 820 821
(defun authors-add (author file action table)
  "Record that AUTHOR worked on FILE.
ACTION is a keyword symbol describing what he did.  Record file,
author and what he did in hash table TABLE.  See the description of
`authors-scan-change-log' for the structure of the hash table."
Kim F. Storm's avatar
Kim F. Storm committed
822 823
  (unless (or (member file authors-ignored-files)
	      (authors-obsolete-file-p file)
824
	      (equal author ""))
825
    (let* ((value (gethash author table))
826 827
	   (entry (assoc file value))
	   slot)
828
      (if (null entry)
829 830 831 832
	  (puthash author (cons (list file (cons action 1)) value) table)
	(if (setq slot (assoc action (cdr entry)))
	    (setcdr slot (1+ (cdr slot)))
	  (nconc entry (list (cons action 1))))))))
Gerd Moellmann's avatar
Gerd Moellmann committed
833 834 835 836


(defun authors-canonical-author-name (author)
  "Return a canonicalized form of AUTHOR, an author name.
837 838 839
If AUTHOR has an entry in `authors-aliases', use that.  Remove
email addresses.  Capitalize words in the author's name, unless
it is found in `authors-fixed-case'."
840 841
  (let* ((aliases authors-aliases)
	 regexps realname)
Gerd Moellmann's avatar
Gerd Moellmann committed
842
    (while aliases
843 844 845 846 847 848 849 850 851 852 853
      (setq realname (car (car aliases))
	    regexps (cdr (car aliases))
	    aliases (cdr aliases))
      (while regexps
	(if (string-match (car regexps) author)
	    (setq author realname
		  regexps nil
		  aliases nil)
	  (setq regexps (cdr regexps))))))
  (when author
    (setq author (replace-regexp-in-string "[ \t]*[(<].*$" "" author))
854
    (setq author (replace-regexp-in-string "\`[ \t]+" "" author))
855
    (setq author (replace-regexp-in-string "[ \t]+$" "" author))
856 857 858
    (setq author (replace-regexp-in-string "[ \t]+" " " author))
    (unless (string-match "[-, \t]" author)
      (setq author ""))
859 860
    (or (car (member author authors-fixed-case))
	(capitalize author))))
861 862 863

(defun authors-scan-change-log (log-file table)
  "Scan change log LOG-FILE for author information.
Gerd Moellmann's avatar
Gerd Moellmann committed
864 865 866 867 868

For each change mentioned in the log, add an entry to hash table TABLE
under the author's canonical name.

Keys of TABLE are author names.  Values are alists of entries (FILE
869 870
\(ACTION . COUNT) ...).  FILE is one file the author worked on.  The
rest of the entry is a list of keyword symbols describing what he did
871
with the file and the number of each action:
Gerd Moellmann's avatar
Gerd Moellmann committed
872 873

:wrote		means the author wrote the file
874
:cowrote	means he wrote the file in collaboration with others
875
:changed	means he changed the file COUNT times."
876

877
  (let* ((enable-local-variables :safe)	; for find-file, hence let*
Glenn Morris's avatar
Glenn Morris committed
878
	 (enable-local-eval nil)
879 880
	 (existing-buffer (get-file-buffer log-file))
	 (buffer (find-file-noselect log-file))
881
	 authors pos)
882
    (with-current-buffer buffer
Gerd Moellmann's avatar
Gerd Moellmann committed
883 884 885 886 887
      (save-restriction
	(widen)
	(goto-char (point-min))
	(while (re-search-forward "^[0-9]\\|^[ \t]+\\* " nil t)
	  (beginning-of-line)
888
	  (setq pos (point))
Gerd Moellmann's avatar
Gerd Moellmann committed
889
	  (cond ((looking-at "^[0-9]+-[0-9]+-[0-9]+")
890 891 892 893 894 895 896 897 898 899 900
		 ;; Handle joint authorship of changes.
		 ;; This can be a bit fragile, and is not too common.
		 (setq authors nil)
		 (while (progn
			  (skip-chars-forward " \t+:0-9-")
			  (not (looking-at "\\($\\|\\*\\|\
Suggested\\|Trivial\\|Version\\|Originally\\|From:\\|Patch[ \t]+[Bb]y\\)")))
		   (push (authors-canonical-author-name
			  (buffer-substring-no-properties
			   (point) (line-end-position))) authors)
		   (forward-line 1)))
Gerd Moellmann's avatar
Gerd Moellmann committed
901 902 903 904 905 906 907 908 909 910 911 912 913 914 915
		((looking-at "^[ \t]+\\*")
		 (let ((line (buffer-substring-no-properties
			      (match-end 0) (line-end-position))))
		   (while (and (not (string-match ":" line))
			       (forward-line 1)
			       (not (looking-at ":\\|^[ \t]*$")))
		     (setq line (concat line
					(buffer-substring-no-properties
					 (line-beginning-position)
					 (line-end-position)))))
		   (when (string-match ":" line)
		     (setq line (substring line 0 (match-beginning 0)))
		     (setq line (replace-regexp-in-string "[[(<{].*$" "" line))
		     (setq line (replace-regexp-in-string "," "" line))
		     (dolist (file (split-string line))
916 917 918 919
		       (when (setq file (authors-canonical-file-name file log-file pos (car authors)))
			 (dolist (author authors)
			   ;;(message "%s changed %s" author file)
			   (authors-add author file :changed table)))))
Gerd Moellmann's avatar
Gerd Moellmann committed
920 921 922 923 924 925 926 927
		   (forward-line 1)))))))
    (unless existing-buffer
      (kill-buffer buffer))))


(defun authors-scan-el (file table)
  "Scan Lisp file FILE for author information.
TABLE is a hash table to add author information to."
928 929 930 931
  (let* ((existing-buffer (get-file-buffer file))
	 (enable-local-variables :safe)	; for find-file, hence let*
	 (enable-local-eval nil)
	 (buffer (find-file-noselect file)))
Glenn Morris's avatar
Glenn Morris committed
932
    (setq file (authors-disambiguate-file-name (expand-file-name file)))
933
    (with-current-buffer buffer
Gerd Moellmann's avatar
Gerd Moellmann committed
934 935 936 937
      (save-restriction
	(widen)
	(goto-char (point-min))
	(while (and (re-search-forward
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961
		     "^;+[ \t]*\\(Authors?\\|Commentary\\|Code\\):[ \t]*" nil t)
		    (not (member (match-string 1) '("Commentary" "Code"))))
	  (let ((continue t)
		(action :wrote)
		authors)
	    (while continue
	      ;; Some entries contain a year range in front of the
	      ;; author's name.
	      (skip-chars-forward "-0-9 \t")
	      (push (authors-canonical-author-name
		     (buffer-substring-no-properties
		      (point) (line-end-position))) authors)
	      ;; tips.texi says the continuation line should begin
	      ;; with a tab, but often spaces are used.
	      (setq continue
		    (and (zerop (forward-line 1))
			 (looking-at ";;;?\\(\t+ *\\|  +\\)[[:alnum:]]")
			 (goto-char (1- (match-end 0)))
			 (not (looking-at "[[:upper:]][-[:alpha:]]+:[ \t]")))))
	    (and (> (length authors) 1)
		 (setq action :cowrote))
	    (mapc (lambda (author)
		    (authors-add author file action table))
		  authors)))))
Gerd Moellmann's avatar
Gerd Moellmann committed
962 963 964 965
    (unless existing-buffer
      (kill-buffer buffer))))


966 967 968 969 970 971 972 973 974 975
(defun authors-public-domain-p (file)
  "Return t if FILE is a file that was put in public domain."
  (let ((public-domain-p nil)
	(list authors-public-domain-files))
    (while (and list (not public-domain-p))
      (when (string-match (car list) file)
	(setq public-domain-p t))
      (setq list (cdr list)))
    public-domain-p))

976 977 978 979 980 981
(defvar authors-author-list)

(defun authors-add-to-author-list (author changes)
  "Insert information about AUTHOR's work on Emacs into `authors-author-list'.
CHANGES is an alist of entries (FILE (ACTION . COUNT) ...), as produced by
`authors-scan-change-log'.
982 983 984
The element added to `authors-author-list' is (AUTHOR WROTE CO-WROTE CHANGED),
where WROTE, CO-WROTE, and CHANGED are lists of the files written, co-written
and changed by AUTHOR."
985 986 987
  (when author
    (let ((nchanged 0)
	  wrote-list
988
	  cowrote-list