ChangeLog fixes prompted by M-x authors.
[bpt/emacs.git] / lisp / emacs-lisp / authors.el
CommitLineData
25b30b16 1;;; authors.el --- utility for maintaining Emacs' AUTHORS file -*-coding: utf-8;-*-
3215096c 2
93da04c0 3;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
114f9c96 4;; 2009, 2010 Free Software Foundation, Inc.
3215096c 5
60e8e0a5 6;; Author: Gerd Moellmann <gerd@gnu.org>
f39caf44 7;; Maintainer: Kim F. Storm <storm@cua.dk>
60e8e0a5 8;; Keywords: maint
aad4679e 9;; Package: emacs
60e8e0a5 10
3215096c
GM
11;; This file is part of GNU Emacs.
12
d6cba7ae 13;; GNU Emacs is free software: you can redistribute it and/or modify
3215096c 14;; it under the terms of the GNU General Public License as published by
d6cba7ae
GM
15;; the Free Software Foundation, either version 3 of the License, or
16;; (at your option) any later version.
3215096c
GM
17
18;; GNU Emacs is distributed in the hope that it will be useful,
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;; GNU General Public License for more details.
22
23;; You should have received a copy of the GNU General Public License
d6cba7ae 24;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
3215096c
GM
25
26;;; Commentary:
27
28;; Use M-x authors RET to create an *Authors* buffer that can used as
29;; or merged with Emacs' AUTHORS file.
30
31;;; Code:
32
25b30b16 33(defvar authors-coding-system 'utf-8
f39caf44
KS
34 "Coding system used in the AUTHORS file.")
35
3215096c
GM
36(defconst authors-many-files 20
37 "Maximum number of files for which to print individual information.
f39caf44
KS
38If an author has modified more files, only the names of the most
39frequently modified files are printed and a count of the additional
40files.")
3215096c
GM
41
42(defconst authors-aliases
f39caf44 43 '(
01cc3e13 44 ("Aaron S. Hawley" "Aaron Hawley")
9109bf49 45 ("Andrew Csillag" "Drew Csillag")
9dfa8726 46 ("Anna M. Bigatti" "Anna Bigatti")
f39caf44
KS
47 ("Barry A. Warsaw" "Barry A. Warsaw, Century Computing, Inc."
48 "Barry A. Warsaw, ITB" "Barry Warsaw")
6b5e47dd
GM
49 ("Bill Mann" "William F. Mann")
50 ("Bill Rozas" "Guillermo J. Rozas")
25b30b16 51 ("Björn Torkelsson" "Bjorn Torkelsson")
f39caf44
KS
52 ("Brian Fox" "Brian J. Fox")
53 ("Christoph Wedler" "Christoph.Wedler@sap.com")
54 ("Daniel Pfeiffer" "<Daniel.Pfeiffer@Informatik.START.db.de>"
55 "<Daniel.Pfeiffer@Informatik.START.dbp.de>")
6b5e47dd 56 ("David De La Harpe Golden" "David Golden")
f39caf44 57 ("David Gillespie" "Dave Gillespie")
25b30b16 58 ("David Kågedal" "David K..edal")
93da04c0 59 ("David M. Koppelman" "David M. Koppelman, Koppel@Ec?e.Lsu.Edu"
605046ef 60 "David Koppelman")
d0f483e8 61 ("David M. Smith" "David Smith" "David M Smith")
01cc3e13 62 ("Deepak Goel" "D. Goel")
d0f483e8 63 ("Ed L. Cashin" "Ed L Cashin")
f39caf44
KS
64 ("Edward M. Reingold" "Ed Reingold" "Edward M Reingold"
65 "Reingold Edward M")
66 ("Eli Zaretskii" "eliz")
4ee02020 67 ("Emilio C. Lopes" "Emilio Lopes")
d0f483e8 68 ("Era Eriksson" "Era@Iki.Fi")
f39caf44
KS
69 ("Eric M. Ludlam" "Eric Ludlam")
70 ("Eric S. Raymond" "Eric Raymond")
71 ("Eric Youngdale" "(Eric Youngdale at youngdale@v6550c.nrl.navy.mil)")
d0f483e8 72 ("Francis J. Wright" "Dr Francis J. Wright" "Francis Wright")
25b30b16
GM
73 ("François Pinard" "Francois Pinard")
74 ("Francesco Potortì" "Francesco Potorti" "Francesco Potorti`")
f39caf44
KS
75 ("Frederic Pierresteguy" "Fred Pierresteguy")
76 ("Geoff Voelker" "voelker")
25b30b16 77 ("Gerd Möllmann" "Gerd Moellmann")
6b5e47dd 78 ("Hallvard B. Furuseth" "Hallvard B Furuseth" "Hallvard Furuseth")
25b30b16 79 ("Hrvoje Nikšić" "Hrvoje Niksic")
2603d79b
GM
80 ;; src/ChangeLog.4, 1994-01-11, since fixed.
81;;; (nil "(afs@hplb.hpl.hp.com)")
82 ;; lisp/gnus/ChangeLog.1, 1998-01-15.
83 ;; http://quimby.gnus.org/cgi-bin/cvsweb.cgi/gnus/lisp/gnus-art.el?rev=4.13
f39caf44 84 (nil "<Use-Author-Address-Header@\\[127.1\\]>")
2603d79b
GM
85 (nil "Code Extracted") ; lisp/newcomment.el's "Author:" header
86 (nil "\\`FSF") ; FIXME what is this for - no effect?
87 ;; lisp/gnus/ChangeLog.1, 1997-10-12, since fixed.
88;;; (nil "ISO-2022-JP")
f39caf44 89 ("Jaeyoun Chung" "Jae-youn Chung" "Jae-you Chung" "Chung Jae-youn")
25b30b16 90 ("Jan Djärv" "Jan D." "Jan Djarv")
d0f483e8 91 ("Jay K. Adams" "jka@ece.cmu.edu" "Jay Adams")
25b30b16 92 ("Jérôme Marant" "Jérôme Marant" "Jerome Marant")
f39caf44 93 ("Jens-Ulrik Holger Petersen" "Jens-Ulrik Petersen")
605046ef 94 ("Jeremy Bertram Maitin-Shepard" "Jeremy Maitin-Shepard")
25b30b16 95 ("Johan Bockgård" "Johan Bockgard")
4ee02020 96 ("John W. Eaton" "John Eaton")
f39caf44
KS
97 ("Jonathan I. Kamens" "Jonathan Kamens")
98 ("Joseph Arceneaux" "Joe Arceneaux")
6b5e47dd 99 ("Joseph M. Kelsey" "Joe Kelsey") ; FIXME ?
25b30b16 100 ("Juan León Lahoz García" "Juan-Leon Lahoz Garcia")
f39caf44 101 ("K. Shane Hartman" "Shane Hartman")
25b30b16 102 ("Kai Großjohann" "Kai Grossjohann" "Kai Großjohann"
d0f483e8
KS
103 "Kai.Grossjohann@Cs.Uni-Dortmund.De"
104 "Kai.Grossjohann@Gmx.Net")
f39caf44 105 ("Karl Berry" "K. Berry")
25b30b16 106 ("Károly Lőrentey" "Károly Lőrentey" "Lőrentey Károly")
d0f483e8 107 ("Kazushi Marukawa" "Kazushi")
f39caf44
KS
108 ("Ken Manheimer" "Kenneth Manheimer")
109 ("Kenichi Handa" "Ken'ichi Handa" "Kenichi HANDA")
4ee02020 110 ("Kevin Greiner" "Kevin J. Greiner")
f39caf44 111 ("Kim F. Storm" "Kim Storm")
d0f483e8 112 ("Kyle Jones" "Kyle E. Jones")
f39caf44 113 ("Marcus G. Daniels" "Marcus Daniels")
d0f483e8 114 ("Mark D. Baushke" "Mark D Baushke")
6b5e47dd 115 ("Marko Kohtala" "Kohtala Marko")
25b30b16 116 ("Agustín Martín" "Agustin Martin")
d0f483e8
KS
117 ("Martin Lorentzon" "Martin Lorentzson")
118 ("Matt Swift" "Matthew Swift")
6b5e47dd 119 ("Maxime Edouard Robert Froumentin" "Max Froumentin")
4ee02020 120 ("Michael R. Mauger" "Michael Mauger")
f39caf44 121 ("Michael D. Ernst" "Michael Ernst")
25b30b16 122 ("Michaël Cadilhac" "Michael Cadilhac")
f39caf44 123 ("Michael I. Bushnell" "Michael I Bushnell" "Michael I. Bushnell, P/Bsg")
6b5e47dd
GM
124 ("Michael R. Cook" "Michael Cook")
125 ("Michael Sperber" "Michael Sperber \\[Mr. Preprocessor\\]")
4ee02020 126 ("Mikio Nakajima" "Nakajima Mikio")
6b5e47dd 127 ("Nelson Jose dos Santos Ferreira" "Nelson Ferreira")
f39caf44
KS
128 ("Paul Eggert" "eggert")
129 ("Paul Reilly" "(pmr@legacy.pajato.com)")
be3f421b 130 ("Pavel Janík" "Pavel Janík Ml." "Pavel Janik Ml." "Pavel Janik" "Pavel Janík" "Pavel@Janik.Cz")
24e15888 131 ("Pavel Kobiakov" "Pavel Kobyakov")
f39caf44 132 ("Per Abrahamsen" "Per Abhiddenware")
24e15888 133 ("Per Starbäck" "Per Starback")
d0f483e8
KS
134 ("Peter S. Galbraith" "Peter Galbraith")
135 ("Peter Runestig" "Peter 'luna' Runestig")
f39caf44 136 ("Peter S. Galbraith" "Peter S Galbraith")
6b5e47dd
GM
137 ("Raja R. Harinath" "Raja R Harinath")
138 ("Richard G. Bielawski" "Richard G Bielawski" "Richard Bielawski")
139 ("Richard King" "Dick King")
f39caf44 140 ("Richard M. Stallman" "Richard M. Stallman,,," "Richard Stallman"
a1506d29 141 "rms" "rms@gnu.org")
f39caf44
KS
142 ("Robert J. Chassell" "Bob Chassell")
143 ("Roland B. Roberts" "Roland B Roberts" "Roland Roberts")
144 ("Rui-Tao Dong" "Rui-Tao Dong ~{6-Hpln~}")
a8d37031 145 ("Sacha Chua" "Sandra Jean Chua")
f39caf44 146 ("Sam Steingold" "Sam Shteingold")
9109bf49 147 ("Satyaki Das" "Indexed search by Satyaki Das")
93da04c0
GM
148 ;; There are other Stefans.
149;;; ("Stefan Monnier" "Stefan")
f39caf44
KS
150 ("Stephen A. Wood" "(saw@cebaf.gov)")
151 ("Steven L. Baur" "SL Baur" "Steven L Baur")
93da04c0 152 ("Stewart M. Clamen" "Stewart Clamen")
6b5e47dd 153 ("Stuart D. Herring" "Stuart Herring" "Davis Herring")
93da04c0 154 ("Taichi Kawabata" "KAWABATA,? Taichi")
f39caf44 155 ("Takaaki Ota" "Tak Ota")
4ee02020 156 ("Takahashi Naoto" "Naoto Takahashi")
d0f483e8 157 ("Teodor Zlatanov" "Ted Zlatanov")
6b5e47dd
GM
158 ("Thomas Horsley" "Tom Horsley") ; FIXME ?
159 ("Thomas Wurgler" "Tom Wurgler")
160 ("Tomohiko Morioka" "MORIOKA Tomohiko")
25b30b16
GM
161 ("Torbjörn Axelsson" "Torbjvrn Axelsson")
162 ("Torbjörn Einarsson" "Torbj.*rn Einarsson")
f39caf44 163 ("Toru Tomabechi" "Toru Tomabechi,")
6b5e47dd 164 ("Tsugutomo Enami" "enami tsugutomo")
f39caf44 165 ("Vincent Del Vecchio" "Vince Del Vecchio")
9109bf49 166 ("William M. Perry" "Bill Perry")
f39caf44 167 ("Wlodzimierz Bzyl" "W.*dek Bzyl")
6b5e47dd
GM
168 ("Yoni Rabkin" "Yoni Rabkin Katzenell")
169 ("Yoshinori Koseki" "KOSEKI Yoshinori" "小関 吉則")
f39caf44 170 ("Yutaka NIIBE" "NIIBE Yutaka")
d5ab63b2 171 )
3215096c
GM
172 "Alist of author aliases.
173
f39caf44 174Each entry is of the form (REALNAME REGEXP...). If an author's name
a1506d29 175matches one of the REGEXPs, use REALNAME instead.
f39caf44 176If REALNAME is nil, ignore that author.")
3215096c 177
eef72fce
GM
178(defconst authors-fixed-case
179 '("Bryan O'Sullivan"
180 "Christian von Roques"
93da04c0 181 "Christophe de Dinechin"
eef72fce
GM
182 "Craig McDaniel"
183 "David J. MacKenzie"
184 "David McCabe"
185 "David O'Toole"
186 "Dominique de Waleffe"
187 "Edward O'Connor"
188 "Exal de Jesus Garcia Carrillo"
189 "Greg McGary"
190 "Hans de Graaff"
191 "James TD Smith"
24e15888 192 "Joel N. Weber II"
eef72fce
GM
193 "Michael McNamara"
194 "Mike McEwan"
6b5e47dd 195 "Nelson Jose dos Santos Ferreira"
eef72fce
GM
196 "Peter von der Ahe"
197 "Peter O'Gorman"
198 "Roland McGrath"
199 "Sean O'Rourke")
200 "List of authors whose names cannot be simply capitalized.")
3215096c 201
0a521885 202(defvar authors-public-domain-files
eef72fce 203 '("emerge\\.el"
0a521885
GM
204 "vi\\.el"
205 "feedmail\\.el"
206 "mailpost\\.el"
207 "hanoi\\.el"
208 "meese\\.el"
209 "studly\\.el"
eef72fce
GM
210 "modula2\\.el"
211 "nnmaildir\\.el"
212 "nnil\\.el"
213 "b2m\\.c"
214 "unexhp9k800\\.c"
215 "emacsclient\\.1"
216 "check-doc-strings")
0a521885
GM
217 "List of regexps matching files for which the FSF doesn't need papers.")
218
219
8a5506f2
GM
220(defvar authors-obsolete-files-regexps
221 '("vc-\\*\\.el$"
222 "spec.txt$"
6b5e47dd 223 ".*loaddefs.el$" ; not obsolete, but auto-generated
fea1add4
GM
224 "\\.\\(cvs\\|git\\)ignore$" ; obsolete or uninteresting
225 "\\.arch-inventory$"
226 "preferences\\.\\(nib\\|gorm\\)"
8a5506f2
GM
227 "vc-\\(rcs\\|cvs\\|sccs\\)-hooks\\.el$")
228 "List of regexps matching obsolete files.
229Changes to files matching one of the regexps in this list are not
230listed.")
231
4ee02020
KS
232(defconst authors-ignored-files
233 '("external-lisp"
234 "lock" "share-lib" "local-lisp"
235 "noleim-Makefile.in"
eef72fce
GM
236 "NEWS" "ORDERS" "PROBLEMS" "FAQ" "AUTHORS" "FOR-RELEASE" "TODO" "todo"
237 "MACHINES" "SERVICE"
238 "README.unicode" "README.multi-tty" "TUTORIAL.translators"
239 "NEWS.unicode" "COPYING.DJ" "Makefile.old" "Makefile.am"
240 "NEWS.1" "OOOOONEWS...OONEWS" "OOOONEWS" "etc/NEWS"
241 "NEWS.1-17" "NEWS.18" "NEWS.19" "NEWS.20" "NEWS.21" "NEWS.22"
6b5e47dd 242 "MAINTAINERS" "MH-E-NEWS"
eef72fce
GM
243 "install-sh" "missing" "mkinstalldirs"
244 "termcap.dat" "termcap.src" "termcap.ucb" "termcap"
245 "ChangeLog.nextstep" "Emacs.clr" "spec.txt"
246 "gfdl.1"
247 "texi/Makefile.in"
248 "Imakefile" "icons/sink.ico" "aixcc.lex"
249 "nxml/char-name/unicode"
1fc28a2c 250 "js2-mode.el" ; only installed very briefly, replaced by js.el
fea1add4
GM
251 "cedet/tests/testtemplates.cpp"
252 "cedet/tests/testusing.cpp"
253 "cedet/tests/scopetest.cpp"
254 "cedet/tests/scopetest.java"
255 "cedet/tests/test.cpp"
256 "cedet/tests/test.py"
257 "cedet/tests/teststruct.cpp"
258 "*.el"
6b5e47dd
GM
259 ;; Autogen:
260 "cus-load.el" "finder-inf.el" "ldefs-boot.el"
eef72fce
GM
261 ;; Never had any meaningful changes logged, now deleted:
262 "split-man" "Xkeymap.txt" "ms-7bkermit" "ulimit.hack"
93da04c0 263 "gnu-hp300" "refcard.bit" "ledit.l" "forms.README" "forms-d2.dat"
eef72fce
GM
264 "CXTERM-DIC/PY.tit" "CXTERM-DIC/ZIRANMA.tit"
265 "CXTERM-DIC/CTLau.tit" "CXTERM-DIC/CTLauB.tit"
266 "NICKLES.WORTH" "INTERVAL.IDEAS" "RCP"
267 "3B-MAXMEM" "AIX.DUMP" "SUN-SUPPORT" "XENIX"
268 "CODINGS" "CHARSETS"
269 "calc/INSTALL" "calc/Makefile"
46e6650e 270 "vms-pp.trans" "_emacs" "batcomp.com" "notes/cpp" ; admin/
eef72fce
GM
271 ;; MH-E stuff not in Emacs:
272 "import-emacs" "release-utils"
273 ;; Erc stuff not in Emacs:
274 "ChangeLog.2001" "ChangeLog.2002" "ChangeLog.2003" "ChangeLog.2004"
275 "ChangeLog.2005"
276 "README.extras" "dir-template" "mkChangeLog" "MkChangeLog" "erc-auto.in"
277 "CREDITS" "HACKING"
278 "debian/changelog"
279 "debian/control"
280 "debian/copyright"
281 "debian/maint/conffiles"
282 "debian/maint/conffiles.in"
283 "debian/maint/postinst"
284 "debian/maint/postinst.in"
285 "debian/maint/prerm"
286 "debian/maint/prerm.in"
287 "debian/README.Debian"
288 "debian/README.erc-speak"
289 "debian/rules"
290 "debian/scripts/install"
291 "debian/scripts/install.in"
292 "debian/scripts/remove"
293 "debian/scripts/remove.in"
294 "debian/scripts/startup"
295 "debian/scripts/startup.erc"
296 "debian/scripts/startup.erc-speak"
297 )
4ee02020
KS
298 "List of files and directories to ignore.
299Changes to files in this list are not listed.")
8a5506f2 300
fea1add4
GM
301;; List via: find . -name '*.el' | sed 's/.*\///g' | sort | uniq -d
302;; FIXME It would be better to discover these dynamically.
303;; Note that traditionally "Makefile.in" etc have not been in this list.
304;; Ditto for "abbrev.texi" etc.
305(defconst authors-ambiguous-files
306 '("chart.el"
307 "compile.el"
308 "complete.el"
309 "cpp.el"
310 "ctxt.el"
311 "debug.el"
312 "dired.el"
313 "el.el"
314 "files.el"
315 "find.el"
316 "format.el"
317 "grep.el"
318 "imenu.el"
319 "java.el"
320 "linux.el"
321 "locate.el"
322 "make.el"
323 "mode.el"
324 "python.el"
325 "semantic.el"
326 "shell.el"
327 "simple.el"
328 "sort.el"
329 "speedbar.el"
330 "srecode.el"
331 "table.el"
332 "texi.el"
333 "util.el"
334 "wisent.el")
335 "List of basenames occurring more than once in the source.")
336
6b5e47dd
GM
337;; FIXME :cowrote entries here can be overwritten by :wrote entries
338;; derived from a file's Author: header (eg mh-e). This really means
339;; the Author: header is erroneous.
d5ab63b2 340(defconst authors-fixed-entries
8b1163a3 341 '(("Richard M. Stallman" :wrote "[The original GNU Emacs and numerous files]")
f39caf44 342 ("Joseph Arceneaux" :wrote "xrdb.c")
6b5e47dd
GM
343 ;; This refers to the obsolete Willisson (qv) version.
344;;; ("Blitz Product Development Corporation" :wrote "ispell.el")
d5ab63b2
GM
345 ("Frank Bresz" :wrote "diff.el")
346 ("David M. Brown" :wrote "array.el")
93da04c0
GM
347 ;; No longer distributed.
348;;; ("Gary Byers" :changed "xenix.h")
d5ab63b2 349 ("Shawn M. Carey" :wrote "freebsd.h")
93da04c0 350 ;; hp800.h renamed from hp9000s800.h, hpux.h merged into hpux10-20.h.
6b5e47dd
GM
351 ;; FIXME overwritten by Author:.
352 ("Satyaki Das" :cowrote "mh-search.el")
93da04c0
GM
353 ("Eric Decker" :changed "hp800.h" "hpux10-20.h" "sysdep.c")
354 ("Lawrence R. Dodd" :cowrote "dired-x.el")
355 ;; No longer distributed.
356;;; ("Viktor Dukhovni" :wrote "unexsunos4.c")
d5ab63b2 357 ("Paul Eggert" :wrote "rcs2log" "vcdiff")
29cf3e20 358 ("Fred Fish" :changed "unexcoff.c")
93da04c0
GM
359 ;; No longer distributed.
360;;; ("Tim Fleehart" :wrote "makefile.nt")
d5ab63b2
GM
361 ("Keith Gabryelski" :wrote "hexl.c")
362 ("Kevin Gallagher" :wrote "flow-ctrl.el")
93da04c0
GM
363 ;; Also wrote an earlier version of disp-table.el, since replaced
364 ;; by Erik Naggum's version; also iso-syntax.el, later renamed to
365 ;; latin-1.el, since deleted.
366 ("Howard Gayle" :wrote "casetab.c")
367 ;; :wrote mh-pick.el, since merged into mh-search.el.
6b5e47dd
GM
368 ;; Originally wrote mh-funcs.el, but it has been rewritten since.
369 ("Stephen Gildea" :wrote "refcard.tex"
370 :cowrote "mh-funcs.el" "mh-search.el")
93da04c0
GM
371 ;; cl.texinfo renamed to cl.texi.
372 ("David Gillespie" :wrote "cl.texi")
373 ;; No longer distributed: emacsserver.c.
374 ("Hewlett-Packard" :changed "emacsclient.c" "server.el" "keyboard.c")
375 ;; No longer distributed.
376;;; ("Thomas Horsley" :wrote "cxux.h" "cxux7.h")
d5ab63b2
GM
377 ("Indiana University Foundation" :changed "buffer.c" "buffer.h"
378 "indent.c" "search.c" "xdisp.c" "region-cache.c" "region-cache.h")
93da04c0 379 ;; ibmrt.h, ibmrt-aix.h no longer distributed.
d5ab63b2 380 ("International Business Machines" :changed "emacs.c" "fileio.c"
29cf3e20 381 "process.c" "sysdep.c" "unexcoff.c")
93da04c0
GM
382 ;; No longer distributed.
383;;; ("Ishikawa Chiaki" :changed "aviion.h" "dgux.h")
384 ;; ymakefile no longer distributed.
d5ab63b2 385 ("Michael K. Johnson" :changed "configure.in" "emacs.c" "intel386.h"
93da04c0 386 "mem-limits.h" "process.c" "template.h" "sysdep.c" "syssignal.h"
29cf3e20 387 "systty.h" "unexcoff.c" "linux.h")
93da04c0
GM
388 ;; No longer distributed.
389;;; ("Kyle Jones" :wrote "mldrag.el")
4ee02020 390 ("Henry Kautz" :wrote "bib-mode.el")
93da04c0
GM
391 ;; No longer distributed: vms-pwd.h, vmsfns.c, uaf.h.
392 ("Joseph M. Kelsey" :changed "fileio.c" "dir.h")
d5ab63b2 393 ("Sam Kendall" :changed "etags.c" "etags.el")
93da04c0
GM
394 ;; ack.texi: "We're not using his backquote.el any more."
395 ("Richard King" :wrote "userlock.el" "filelock.c")
d5ab63b2
GM
396 ("Sebastian Kremer" :changed "add-log.el")
397 ("Mark Lambert" :changed "process.c" "process.h")
398 ("Aaron Larson" :changed "bibtex.el")
6b5e47dd
GM
399 ;; It was :wrote, but it has been rewritten since.
400 ("James R. Larus" :cowrote "mh-e.el")
93da04c0
GM
401 ("Lars Lindberg" :changed "dabbrev.el" :cowrote "imenu.el")
402 ;; No longer distributed: lselect.el.
d5ab63b2
GM
403 ("Lucid, Inc." :changed "bytecode.c" "byte-opt.el" "byte-run.el"
404 "bytecomp.el" "delsel.el" "disass.el" "faces.el" "font-lock.el"
93da04c0 405 "lmenu.el" "mailabbrev.el" "select.el" "xfaces.c" "xselect.c")
6b5e47dd
GM
406 ;; MCC. No longer distributed: emacsserver.c.
407 ("Microelectronics and Computer Technology Corporation"
408 :changed "etags.c" "emacsclient.c" "movemail.c"
d5ab63b2
GM
409 "rmail.el" "rmailedit.el" "rmailkwd.el"
410 "rmailmsc.el" "rmailout.el" "rmailsum.el" "scribe.el"
6b5e47dd 411 ;; It was :wrote for xmenu.c, but it has been rewritten since.
29cf3e20 412 "server.el" "lisp.h" "sysdep.c" "unexcoff.c" "xmenu.c")
d5ab63b2 413 ("Niall Mansfield" :changed "etags.c")
93da04c0 414 ("Brian Marick" :cowrote "hideif.el")
d5ab63b2
GM
415 ("Marko Kohtala" :changed "info.el")
416 ("Sidney Markowitz" :changed "doctor.el")
93da04c0
GM
417 ;; No longer distributed: env.c.
418 ("Richard Mlynarik" :wrote "ehelp.el")
d5ab63b2
GM
419 ("Mosur Mohan" :changed "etags.c")
420 ("Jeff Morgenthaler" :changed "flow-ctrl.el" "vt200.el" "vt201.el"
421 "vt220.el" "vt240.el")
422 ("Motorola" :changed "buff-menu.el")
423 ("Hiroshi Nakano" :changed "ralloc.c")
424 ("Sundar Narasimhan" :changed "rnewspost.el")
93da04c0
GM
425 ;; No longer distributed.
426;;; ("NeXT, Inc." :wrote "unexnext.c")
d5ab63b2 427 ("Mark Neale" :changed "fortran.el")
93da04c0
GM
428 ;; Renamed from sc.el.
429 ("Martin Neitzel" :changed "supercite.el")
430 ("Andrew Oram" :changed "calendar.texi (and other files in man/)")
d5ab63b2
GM
431 ("Frederic Pierresteguy" :wrote "widget.c")
432 ("Michael D. Prange" :changed "tex-mode.el")
93da04c0
GM
433 ;; No longer distributed (dgux5-4r3.h was renamed to dgux5-4-3.h).
434;;; ("Paul Reilly" :wrote "gux5-4r2.h" "dgux5-4-3.h")
435 ("Roland B. Roberts" :changed "files.el" "sort.el"
436 "buffer.h" "callproc.c" "dired.c" "process.c" "sysdep.c" "systty.h")
437 ;; No longer distributed.
438;;; "vmspaths.h" "build.com" "compile.com" "kepteditor.com" "precomp.com"
439;;; "vmsproc.el" :wrote "logout.com" "mailemacs.com")
d5ab63b2
GM
440 ("Guillermo J. Rozas" :wrote "fakemail.c")
441 ("Wolfgang Rupprecht" :changed "lisp-mode.el" "loadup.el"
442 "sort.el" "alloc.c" "callint.c"
93da04c0
GM
443 ;; config.in renamed from config.h.in; ecrt0.c from crt0.c.
444 "config.in" "ecrt0.c" "data.c" "fns.c"
445 "lisp.h" "lread.c" ; "sun3.h" "ymakefile" - no longer distributed
446 "print.c" :wrote "float-sup.el" "floatfns.c")
d5ab63b2 447 ("Schlumberger Technology Corporation" :changed "gud.el")
93da04c0
GM
448 ;; Replaced by tcl.el.
449;;; ("Gregor Schmid" :wrote "tcl-mode.el")
d5ab63b2 450 ("Rainer Schoepf" :wrote "alpha.h" "unexalpha.c")
93da04c0
GM
451 ;; No longer distributed: emacsserver.c.
452 ("William Sommerfeld" :wrote "emacsclient.c" "scribe.el")
453 ;; No longer distributed: emacsserver.c.
454 ("Leigh Stoller" :changed "emacsclient.c" "server.el")
d5ab63b2
GM
455 ("Steve Strassman" :wrote "spook.el")
456 ("Shinichirou Sugou" :changed "etags.c")
93da04c0
GM
457 ;; No longer distributed: emacsserver.c.
458 ("Sun Microsystems, Inc" :changed "emacsclient.c" "server.el"
459 :wrote "emacs.icon" "sun.el")
460 ;; No longer distributed.
461;;; "emacstool.1" "emacstool.c" "sun-curs.el"
462;;; "sun-fns.el" "sun-mouse.el" "sunfns.c")
463 ;; Renamed from sc.el.
464 ("Kayvan Sylvan" :changed "supercite.el")
465 ;; No longer distributed: emacsserver.c, tcp.c.
466 ("Spencer Thomas" :changed "emacsclient.c" "server.el"
29cf3e20 467 "dabbrev.el" "unexcoff.c" "gnus.texi")
d5ab63b2 468 ("Jonathan Vail" :changed "vc.el")
29cf3e20 469 ("James Van Artsdalen" :changed "usg5-4.h" "unexcoff.c")
93da04c0
GM
470 ;; No longer distributed: src/makefile.nt, lisp/makefile.nt
471 ;; winnt.el renamed to w32-fns.el; nt.[ch] to w32.[ch];
472 ;; ntheap.[ch] to w32heap.[ch]; ntinevt.c to w32inevt.c;
473 ;; ntproc.c to w32proc.c; ntterm.c to w32term.c;
474 ;; windowsnt.h to ms-w32.h.
475 ("Geoff Voelker" :wrote "w32-fns.el" "w32.c" "w32.h" "w32heap.c"
476 "w32heap.h" "w32inevt.c" "w32proc.c" "w32term.c" "ms-w32.h")
8fc29035 477 ("Morten Welinder" :wrote "dosfns.c" "[many MS-DOS files]" "msdos.h")
ef43a0f4 478 ("Eli Zaretskii" :wrote "bidi.c" "[bidirectional display in xdisp.c]")
93da04c0
GM
479 ;; Not using this version any more.
480;;; ("Pace Willisson" :wrote "ispell.el")
6b5e47dd
GM
481 ;; FIXME overwritten by Author:.
482 ("Bill Wohler" :cowrote "mh-e.el")
d5ab63b2 483 ("Garrett Wollman" :changed "sendmail.el")
9109bf49 484 ("Dale R. Worley" :changed "mail-extr.el")
93da04c0
GM
485 ("Jamie Zawinski" :changed "bytecode.c" :wrote "tar-mode.el"
486 :cowrote "disass.el"))
d5ab63b2
GM
487 "Actions taken from the original, manually (un)maintained AUTHORS file.")
488
489
f39caf44
KS
490(defconst authors-valid-file-names
491 '("aclocal.m4"
eef72fce
GM
492 "build-ins.in"
493 "Makefile.noleim"
4ee02020 494 "makedist.bat"
eef72fce
GM
495 "makefile.def"
496 "makefile.nt"
497 "debug.bat.in" "emacs.bat.in"
498 ".gdbinit-union"
499 "alloca.s"
500 "make-delta"
501 "config.w95"
502 "emacstool.1"
503 "align.umax"
504 "cxux-crt0.s"
505 "gould-sigvec.s"
506 "getdate.y"
507 "ymakefile"
508 "permute-index" "index.perm"
46e6650e 509 "ibmrs6000.inp"
3fb78d1f 510 "b2m.c"
93da04c0 511 "emacs.ico"
eef72fce
GM
512 "emacs21.ico"
513 "LPF" "LEDIT" "OTHER.EMACSES"
514 "emacs16_mac.png" "emacs24_mac.png"
515 "emacs256_mac.png" "emacs32_mac.png"
516 "emacs48_mac.png" "emacs512_mac.png"
fea1add4
GM
517 "revdiff" ; admin/
518 "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/
519 "mac-fix-env.m"
eef72fce
GM
520 ;; Deleted vms stuff:
521 "temacs.opt" "descrip.mms" "compile.com" "link.com"
522 )
fea1add4
GM
523 "File names which are valid, but no longer exist (or cannot be found)
524in the repository.")
f39caf44
KS
525
526(defconst authors-renamed-files-alist
527 '(("nt.c" . "w32.c") ("nt.h" . "w32.h")
528 ("ntheap.c" . "w32heap.c") ("ntheap.h" . "w32heap.h")
529 ("ntinevt.c" . "w32inevt.c") ("ntinevt.h" . "w32inevt.h")
530 ("ntproc.c" . "w32proc.c")
531 ("w32console.c" . "w32term.c")
532 ("unexnt.c" . "unexw32.c")
533 ("s/windowsnt.h" . "s/ms-w32.h")
93da04c0 534 ("winnt.el" . "w32-fns.el")
f39caf44 535 ("config.emacs" . "configure")
93da04c0
GM
536 ("config.h.dist" . "config.in")
537 ("config.h-dist" . "config.in")
538 ("config.h.in" . "config.in")
eef72fce
GM
539 ("paths.h-dist" . "paths.h.in")
540 ("patch1" . "sed1.inp")
f39caf44 541 ("GETTING.GNU.SOFTWARE" . "FTP")
eef72fce
GM
542 ("etc/MACHINES" . "MACHINES")
543 ("ONEWS" . "NEWS.19")
544 ("ONEWS.1" . "NEWS.1-17")
545 ("ONEWS.2" . "NEWS.1-17")
546 ("ONEWS.3" . "NEWS.18")
547 ("ONEWS.4" . "NEWS.18")
548 ("ORDERS.USA" . "ORDERS")
549 ("EUROPE" . "ORDERS")
550 ("DIFF" . "OTHER.EMACSES")
551 ("CCADIFF" . "OTHER.EMACSES")
552 ("GOSDIFF" . "OTHER.EMACSES")
553 ("Makefile.in.in" . "Makefile.in")
4ee02020
KS
554 ("leim-Makefile" . "leim/Makefile")
555 ("leim-Makefile.in" . "leim/Makefile.in")
92158bc3
KS
556 ("emacs-lisp/testcover-ses.el" . "tcover-ses.el")
557 ("emacs-lisp/testcover-unsafep.el" . "tcover-unsafep.el")
6b5e47dd
GM
558 ;; index and pick merged into search.
559 ("mh-index.el" . "mh-search.el")
560 ("mh-pick.el" . "mh-search.el")
fea1add4 561 ("font-setting.el" . "dynamic-setting.el")
b788a98d
GM
562 ;; INSTALL-CVS -> .CVS -> .BZR
563 ("INSTALL-CVS" . "INSTALL.BZR")
564 ("INSTALL.CVS" . "INSTALL.BZR")
eef72fce
GM
565 ("refcards/fr-drdref.pdf" . "refcards/fr-dired-ref.pdf")
566 ("gnus-logo.eps" . "refcards/gnus-logo.eps")
567 ("build-install" . "build-ins.in")
568 ("build-install.in" . "build-ins.in")
569 ("unidata/Makefile" . "unidata/Makefile.in")
570 ;; Not renamed, but we only have the latter in the Emacs repo.
571 ("trampver.texi.in" . "trampver.texi")
572 ("e/eterm" . "e/eterm-color")
573 ("e/eterm.ti" . "e/eterm-color.ti")
574 ("README.txt" . "README")
575 ("emacs.names" . "JOKES")
576 ("ED.WORSHIP" . "JOKES")
577 ("GNU.JOKES" . "JOKES")
578 ("CHARACTERS" . "TODO")
579 ("schema/xhtml-basic-form.rnc" . "schema/xhtml-bform.rnc" )
580 ("schema/xhtml-basic-table.rnc" . "schema/xhtml-btable.rnc")
581 ("schema/xhtml-list.rnc" . "schema/xhtml-lst.rnc")
582 ("schema/xhtml-target.rnc" . "schema/xhtml-tgt.rnc")
583 ("schema/xhtml-style.rnc" . "schema/xhtml-xstyle.rnc")
584 ("schema/docbook-dyntbl.rnc" . "schema/docbk-dyntbl.rnc")
585 ("schema/docbook-soextbl.rnc" . "schema/docbk-soextbl.rn" )
586 ("texi/url.txi" . "url.texi")
fea1add4 587 ("edt-user.doc" . "edt.texi")
eef72fce
GM
588 ;; Moved to different directories.
589 ("ctags.1" . "ctags.1")
590 ("etags.1" . "etags.1")
591 ("emacs.1" . "emacs.1")
592 ("emacsclient.1" . "emacsclient.1")
593 ("icons/emacs21.ico" . "emacs21.ico")
f39caf44
KS
594 )
595 "Alist of files which have been renamed during their lifetime.
596Elements are (OLDNAME . NEWNAME).")
597
598(defconst authors-renamed-files-regexps
599 '(("^m/m-\\(.*\\.h\\)$" . "m/\\1")
600 ("^m-\\(.*\\.h\\)$" . "\\1")
601 ("^s/s-\\(.*\\.h\\)$" . "s/\\1")
602 ("^s-\\(.*\\.h\\)$" . "\\1")
603 ("^s/[-.a-zA-Z0-9_]+\\.h$" . t)
604 ("\\(.*\\)\\.cmd$" . "\\1.bat")
605 ("\\.bat$" . t)
606 ("\\.[ch]$" . t)
607 ("\\.el$" . t)
608 ("\\.ps$" . t)
609 ("\\.texi?$" . t)
610 ("\\.texinfo$" . t)
611 ("\\.xml?$" . t)
612 ("\\.x[pb]m$" . t)
613 ("\\.[xp]bm$" . t)
614 ("^paths\\." . t)
615 ("^install\\." . t)
eef72fce
GM
616 ("^\\(TUTORIAL[^/]*\\)" . "tutorials/\\1")
617 ("^\\(tree-widget/\\(?:default\\|folder\\)/[-a-z]+\\.png\\)$" .
618 "images/\\1")
619 ("^\\(images/icons/\\)mac\\(emacs\\)_\\([0-9]+\\)\\(\\.png\\)" .
620 "\\1\\2\\3_mac\\4")
621 ("\\(images/icons/\\)emacs_\\([0-9][0-9]\\)\\.png" .
622 "\\1hicolor/\\2x\\2/apps/emacs.png")
f39caf44
KS
623 )
624 "List regexps and rewriting rules for renamed files.
625Elements are (REGEXP . REPLACE). If REPLACE is a string, the file
626name matching REGEXP is replaced by REPLACE using `replace-string'.
627Otherwise, the file name is accepted as is.")
628
629(defvar authors-checked-files-alist)
630(defvar authors-invalid-file-names)
631
fea1add4
GM
632(defun authors-disambiguate-file-name (fullname)
633 "Convert FULLNAME to an unambiguous relative-name."
634 (let ((relname (file-name-nondirectory fullname))
635 parent)
636 (if (member relname authors-ambiguous-files)
637 ;; In case of ambiguity, just prepend the parent directory.
638 ;; FIXME obviously this is not a perfect solution.
639 (if (string-equal "lisp"
640 (setq parent (file-name-nondirectory
641 (directory-file-name
642 (file-name-directory fullname)))))
643 relname
644 (format "%s/%s" parent relname))
645 relname)))
646
f39caf44 647(defun authors-canonical-file-name (file log-file pos author)
6b5e47dd 648 "Return canonical file name for FILE found in LOG-FILE.
f39caf44 649Checks whether FILE is a valid (existing) file name, has been renamed,
fea1add4 650or is on the list of removed files. Returns the non-directory part of
6b5e47dd
GM
651the file name. Only uses the LOG-FILE position POS and associated AUTHOR
652to print a message if FILE is not found."
93da04c0
GM
653 ;; FILE should be re-checked in every different directory associated
654 ;; with a LOG-FILE. Eg configure.in from src/ChangeLog is not the
655 ;; same as that from top-level/ChangeLog.
656 (let* ((fullname (expand-file-name file (file-name-directory log-file)))
657 (entry (assoc fullname authors-checked-files-alist))
658 relname
659 valid)
f39caf44
KS
660 (if entry
661 (cdr entry)
662 (setq relname (file-name-nondirectory file))
663 (if (or (member relname authors-valid-file-names)
664 (file-exists-p file)
665 (file-exists-p relname)
666 (file-exists-p (concat "etc/" relname)))
fea1add4 667 (setq valid (authors-disambiguate-file-name fullname))
f39caf44
KS
668 (setq valid (assoc file authors-renamed-files-alist))
669 (if valid
670 (setq valid (cdr valid))
671 (let ((rules authors-renamed-files-regexps))
672 (while rules
673 (if (string-match (car (car rules)) file)
674 (setq valid (if (stringp (cdr (car rules)))
675 (file-name-nondirectory
676 (replace-match (cdr (car rules)) t nil file))
677 relname)
678 rules nil))
679 (setq rules (cdr rules))))))
680 (setq authors-checked-files-alist
93da04c0 681 (cons (cons fullname valid) authors-checked-files-alist))
9109bf49 682 (unless (or valid
eef72fce 683 (member file authors-ignored-files)
fea1add4 684 (authors-obsolete-file-p file)
9109bf49
KS
685 (string-match "[*]" file)
686 (string-match "^[0-9.]+$" file))
a1506d29 687 (setq authors-invalid-file-names
f39caf44
KS
688 (cons (format "%s:%d: unrecognized `%s' for %s"
689 log-file
690 (1+ (count-lines (point-min) pos))
691 file author)
692 authors-invalid-file-names)))
693 valid)))
694
d5ab63b2
GM
695(defun authors-add-fixed-entries (table)
696 "Add actions from `authors-fixed-entries' to TABLE."
697 (dolist (entry authors-fixed-entries)
698 (let ((author (car entry))
699 action)
700 (dolist (item (cdr entry))
701 (if (symbolp item)
702 (setq action item)
703 (authors-add author item action table))))))
704
3932b29a 705
8a5506f2
GM
706(defun authors-obsolete-file-p (file)
707 "Return non-nil if FILE is obsolete.
3932b29a 708FILE is considered obsolete if it matches one of the regular expressions
8a5506f2
GM
709from `authors-obsolete-files-regexps'."
710 (let (obsolete-p
711 (regexps authors-obsolete-files-regexps))
712 (while (and regexps (not obsolete-p))
713 (setq obsolete-p (string-match (car regexps) file)
714 regexps (cdr regexps)))
715 obsolete-p))
716
717
3215096c
GM
718(defun authors-add (author file action table)
719 "Record that AUTHOR worked on FILE.
720ACTION is a keyword symbol describing what he did. Record file,
721author and what he did in hash table TABLE. See the description of
722`authors-scan-change-log' for the structure of the hash table."
4ee02020
KS
723 (unless (or (member file authors-ignored-files)
724 (authors-obsolete-file-p file)
9c1af546 725 (equal author ""))
8a5506f2 726 (let* ((value (gethash author table))
f39caf44
KS
727 (entry (assoc file value))
728 slot)
8a5506f2 729 (if (null entry)
f39caf44
KS
730 (puthash author (cons (list file (cons action 1)) value) table)
731 (if (setq slot (assoc action (cdr entry)))
732 (setcdr slot (1+ (cdr slot)))
733 (nconc entry (list (cons action 1))))))))
3215096c
GM
734
735
3215096c
GM
736(defun authors-canonical-author-name (author)
737 "Return a canonicalized form of AUTHOR, an author name.
eef72fce
GM
738If AUTHOR has an entry in `authors-aliases', use that. Remove
739email addresses. Capitalize words in the author's name, unless
740it is found in `authors-fixed-case'."
f39caf44
KS
741 (let* ((aliases authors-aliases)
742 regexps realname)
3215096c 743 (while aliases
f39caf44
KS
744 (setq realname (car (car aliases))
745 regexps (cdr (car aliases))
746 aliases (cdr aliases))
747 (while regexps
748 (if (string-match (car regexps) author)
749 (setq author realname
750 regexps nil
751 aliases nil)
752 (setq regexps (cdr regexps))))))
753 (when author
754 (setq author (replace-regexp-in-string "[ \t]*[(<].*$" "" author))
d0f483e8 755 (setq author (replace-regexp-in-string "\`[ \t]+" "" author))
f39caf44 756 (setq author (replace-regexp-in-string "[ \t]+$" "" author))
d0f483e8
KS
757 (setq author (replace-regexp-in-string "[ \t]+" " " author))
758 (unless (string-match "[-, \t]" author)
759 (setq author ""))
eef72fce
GM
760 (or (car (member author authors-fixed-case))
761 (capitalize author))))
f39caf44 762
f39caf44
KS
763(defun authors-scan-change-log (log-file table)
764 "Scan change log LOG-FILE for author information.
3215096c
GM
765
766For each change mentioned in the log, add an entry to hash table TABLE
767under the author's canonical name.
768
769Keys of TABLE are author names. Values are alists of entries (FILE
f39caf44
KS
770\(ACTION . COUNT) ...). FILE is one file the author worked on. The
771rest of the entry is a list of keyword symbols describing what he did
2603d79b 772with the file and the number of each action:
3215096c
GM
773
774:wrote means the author wrote the file
2603d79b 775:cowrote means he wrote the file in collaboration with others
f39caf44 776:changed means he changed the file COUNT times."
3932b29a 777
2603d79b 778 (let* ((enable-local-variables :safe) ; for find-file, hence let*
68013cfa 779 (enable-local-eval nil)
f39caf44
KS
780 (existing-buffer (get-file-buffer log-file))
781 (buffer (find-file-noselect log-file))
6b5e47dd 782 authors file pos)
9a529312 783 (with-current-buffer buffer
3215096c
GM
784 (save-restriction
785 (widen)
786 (goto-char (point-min))
787 (while (re-search-forward "^[0-9]\\|^[ \t]+\\* " nil t)
788 (beginning-of-line)
f39caf44 789 (setq pos (point))
3215096c 790 (cond ((looking-at "^[0-9]+-[0-9]+-[0-9]+")
6b5e47dd
GM
791 ;; Handle joint authorship of changes.
792 ;; This can be a bit fragile, and is not too common.
793 (setq authors nil)
794 (while (progn
795 (skip-chars-forward " \t+:0-9-")
796 (not (looking-at "\\($\\|\\*\\|\
797Suggested\\|Trivial\\|Version\\|Originally\\|From:\\|Patch[ \t]+[Bb]y\\)")))
798 (push (authors-canonical-author-name
799 (buffer-substring-no-properties
800 (point) (line-end-position))) authors)
801 (forward-line 1)))
3215096c
GM
802 ((looking-at "^[ \t]+\\*")
803 (let ((line (buffer-substring-no-properties
804 (match-end 0) (line-end-position))))
805 (while (and (not (string-match ":" line))
806 (forward-line 1)
807 (not (looking-at ":\\|^[ \t]*$")))
808 (setq line (concat line
809 (buffer-substring-no-properties
810 (line-beginning-position)
811 (line-end-position)))))
812 (when (string-match ":" line)
813 (setq line (substring line 0 (match-beginning 0)))
814 (setq line (replace-regexp-in-string "[[(<{].*$" "" line))
815 (setq line (replace-regexp-in-string "," "" line))
816 (dolist (file (split-string line))
6b5e47dd
GM
817 (when (setq file (authors-canonical-file-name file log-file pos (car authors)))
818 (dolist (author authors)
819 ;;(message "%s changed %s" author file)
820 (authors-add author file :changed table)))))
3215096c
GM
821 (forward-line 1)))))))
822 (unless existing-buffer
823 (kill-buffer buffer))))
824
825
826(defun authors-scan-el (file table)
827 "Scan Lisp file FILE for author information.
828TABLE is a hash table to add author information to."
2603d79b
GM
829 (let* ((existing-buffer (get-file-buffer file))
830 (enable-local-variables :safe) ; for find-file, hence let*
831 (enable-local-eval nil)
832 (buffer (find-file-noselect file)))
fea1add4 833 (setq file (authors-disambiguate-file-name (expand-file-name file)))
9a529312 834 (with-current-buffer buffer
3215096c
GM
835 (save-restriction
836 (widen)
837 (goto-char (point-min))
838 (while (and (re-search-forward
93da04c0
GM
839 "^;+[ \t]*\\(Authors?\\|Commentary\\|Code\\):[ \t]*" nil t)
840 (not (member (match-string 1) '("Commentary" "Code"))))
841 (let ((continue t)
842 (action :wrote)
843 authors)
844 (while continue
845 ;; Some entries contain a year range in front of the
846 ;; author's name.
847 (skip-chars-forward "-0-9 \t")
848 (push (authors-canonical-author-name
849 (buffer-substring-no-properties
850 (point) (line-end-position))) authors)
851 ;; tips.texi says the continuation line should begin
852 ;; with a tab, but often spaces are used.
853 (setq continue
854 (and (zerop (forward-line 1))
855 (looking-at ";;;?\\(\t+ *\\| +\\)[[:alnum:]]")
856 (goto-char (1- (match-end 0)))
857 (not (looking-at "[[:upper:]][-[:alpha:]]+:[ \t]")))))
858 (and (> (length authors) 1)
859 (setq action :cowrote))
860 (mapc (lambda (author)
861 (authors-add author file action table))
862 authors)))))
3215096c
GM
863 (unless existing-buffer
864 (kill-buffer buffer))))
865
866
0a521885
GM
867(defun authors-public-domain-p (file)
868 "Return t if FILE is a file that was put in public domain."
869 (let ((public-domain-p nil)
870 (list authors-public-domain-files))
871 (while (and list (not public-domain-p))
872 (when (string-match (car list) file)
873 (setq public-domain-p t))
874 (setq list (cdr list)))
875 public-domain-p))
876
f39caf44
KS
877(defvar authors-author-list)
878
879(defun authors-add-to-author-list (author changes)
880 "Insert information about AUTHOR's work on Emacs into `authors-author-list'.
881CHANGES is an alist of entries (FILE (ACTION . COUNT) ...), as produced by
882`authors-scan-change-log'.
93da04c0
GM
883The element added to `authors-author-list' is (AUTHOR WROTE CO-WROTE CHANGED),
884where WROTE, CO-WROTE, and CHANGED are lists of the files written, co-written
885and changed by AUTHOR."
f39caf44
KS
886 (when author
887 (let ((nchanged 0)
888 wrote-list
93da04c0 889 cowrote-list
f39caf44 890 changed-list)
3215096c 891 (dolist (change changes)
93da04c0
GM
892 (let* ((actions (cdr change))
893 (file (car change))
894 (filestat (if (authors-public-domain-p file)
895 (concat file " (public domain)")
896 file))
897 slot)
898 (cond ((assq :wrote actions)
899 (setq wrote-list (cons filestat wrote-list)))
900 ((assq :cowrote actions)
901 (setq cowrote-list (cons filestat cowrote-list)))
902 (t
903 (setq changed-list
904 (cons (cons file (cdr (assq :changed actions)))
905 changed-list))))))
f39caf44
KS
906 (if wrote-list
907 (setq wrote-list (sort wrote-list 'string-lessp)))
93da04c0
GM
908 (if cowrote-list
909 (setq cowrote-list (sort cowrote-list 'string-lessp)))
f39caf44
KS
910 (when changed-list
911 (setq changed-list (sort changed-list
912 (lambda (a b)
913 (if (= (cdr a) (cdr b))
914 (string-lessp (car a) (car b))
915 (> (cdr a) (cdr b))))))
916 (setq nchanged (length changed-list))
917 (setq changed-list (mapcar 'car changed-list)))
918 (if (> (- nchanged authors-many-files) 2)
919 (setcdr (nthcdr authors-many-files changed-list)
920 (list (format "and %d other files" (- nchanged authors-many-files)))))
921 (setq authors-author-list
93da04c0 922 (cons (list author wrote-list cowrote-list changed-list)
f39caf44 923 authors-author-list)))))
3215096c 924
3215096c
GM
925(defun authors (root)
926 "Extract author information from change logs and Lisp source files.
927ROOT is the root directory under which to find the files. If called
a1506d29 928interactively, ROOT is read from the minibuffer.
f39caf44
KS
929Result is a buffer *Authors* containing authorship information, and a
930buffer *Authors Errors* containing references to unknown files."
3215096c 931 (interactive "DEmacs source directory: ")
d2f288c6 932 (setq root (expand-file-name root))
c7efbb12 933 (let ((logs (process-lines find-program root "-name" "ChangeLog*"))
3215096c 934 (table (make-hash-table :test 'equal))
f39caf44
KS
935 (buffer-name "*Authors*")
936 authors-checked-files-alist
937 authors-invalid-file-names)
621af279
DK
938 (authors-add-fixed-entries table)
939 (unless (file-exists-p (expand-file-name "src/emacs.c" root))
be3f421b
RS
940 (unless (y-or-n-p
941 (format "Not the root directory of Emacs: %s, continue? " root))
5a0c3f56 942 (error "Not the root directory")))
3215096c 943 (dolist (log logs)
77777daf 944 (when (string-match "ChangeLog\\(.[0-9]+\\)?$" log)
3215096c
GM
945 (message "Scanning %s..." log)
946 (authors-scan-change-log log table)))
c7efbb12 947 (let ((els (process-lines find-program root "-name" "*.el")))
3215096c
GM
948 (dolist (file els)
949 (message "Scanning %s..." file)
950 (authors-scan-el file table)))
f39caf44 951 (message "Generating buffer %s..." buffer-name)
3215096c
GM
952 (set-buffer (get-buffer-create buffer-name))
953 (erase-buffer)
f39caf44 954 (set-buffer-file-coding-system authors-coding-system)
a1506d29 955 (insert
f39caf44
KS
956"Many people have contributed code included in the Free Software
957Foundation's distribution of GNU Emacs. To show our appreciation for
958their public spirit, we list here in alphabetical order a condensed
959list of their contributions.\n")
960 (let (authors-author-list a)
961 (maphash #'authors-add-to-author-list table)
a1506d29 962 (setq authors-author-list
f39caf44
KS
963 (sort authors-author-list
964 (lambda (a b) (string-lessp (car a) (car b)))))
965 (dolist (a authors-author-list)
966 (let ((author (car a))
967 (wrote (nth 1 a))
93da04c0
GM
968 (cowrote (nth 2 a))
969 (changed (nth 3 a))
f39caf44
KS
970 file)
971 (insert "\n" author ": ")
972 (when wrote
973 (insert "wrote")
974 (dolist (file wrote)
975 (if (> (+ (current-column) (length file)) 72)
976 (insert "\n "))
977 (insert " " file))
978 (insert "\n"))
93da04c0 979 (when cowrote
f39caf44
KS
980 (if wrote
981 (insert "and "))
93da04c0
GM
982 (insert "co-wrote")
983 (dolist (file cowrote)
984 (if (> (+ (current-column) (length file)) 72)
985 (insert "\n "))
986 (insert " " file))
987 (insert "\n"))
988 (when changed
989 (if (or wrote cowrote)
990 (insert "and "))
f39caf44
KS
991 (insert "changed")
992 (dolist (file changed)
993 (if (> (+ (current-column) (length file)) 72)
994 (insert "\n "))
995 (insert " " file))
996 (insert "\n")))))
a1506d29 997 (insert "\nLocal" " Variables:\ncoding: "
f39caf44
KS
998 (symbol-name authors-coding-system) "\nEnd:\n")
999 (message "Generating buffer %s... done" buffer-name)
d5ab63b2 1000 (unless noninteractive
f39caf44
KS
1001 (when authors-invalid-file-names
1002 (with-current-buffer (get-buffer-create "*Authors Errors*")
eef72fce 1003 (setq buffer-read-only nil)
f39caf44
KS
1004 (erase-buffer)
1005 (set-buffer-file-coding-system authors-coding-system)
1006 (insert "Unrecognized file entries found:\n\n")
0c8b414f
JB
1007 (mapc (lambda (f) (if (not (string-match "^[A-Za-z]+$" f)) (insert f "\n")))
1008 (sort authors-invalid-file-names 'string-lessp))
f39caf44
KS
1009 (goto-char (point-min))
1010 (compilation-mode)
1011 (message "Errors were found. See buffer %s" (buffer-name))))
d5ab63b2
GM
1012 (pop-to-buffer buffer-name))))
1013
1014
d5ab63b2
GM
1015(defun batch-update-authors ()
1016 "Produce an AUTHORS file.
1017Call this function in batch mode with two command line arguments FILE
1018and ROOT. FILE is the file to write, ROOT is the root directory of
1019the Emacs source tree, from which to build the file."
1020 (unless noninteractive
1021 (error "`batch-update-authors' is to be used only with -batch"))
1022 (when (/= (length command-line-args-left) 2)
1023 (error "Call `batch-update-authors' with the name of the file to write"))
8e13db77
EZ
1024 (let* ((file (pop command-line-args-left))
1025 (root (pop command-line-args-left)))
d5ab63b2
GM
1026 (authors root)
1027 (write-file file)))
3215096c 1028
c420eb36
GM
1029(provide 'authors)
1030
55535639 1031;;; authors.el ends here