Merge from emacs-23
[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,
5df4f04c 4;; 2009, 2010, 2011 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/
c11cc37a 271 "emacsver.texi.in"
eef72fce
GM
272 ;; MH-E stuff not in Emacs:
273 "import-emacs" "release-utils"
274 ;; Erc stuff not in Emacs:
275 "ChangeLog.2001" "ChangeLog.2002" "ChangeLog.2003" "ChangeLog.2004"
276 "ChangeLog.2005"
277 "README.extras" "dir-template" "mkChangeLog" "MkChangeLog" "erc-auto.in"
278 "CREDITS" "HACKING"
279 "debian/changelog"
280 "debian/control"
281 "debian/copyright"
282 "debian/maint/conffiles"
283 "debian/maint/conffiles.in"
284 "debian/maint/postinst"
285 "debian/maint/postinst.in"
286 "debian/maint/prerm"
287 "debian/maint/prerm.in"
288 "debian/README.Debian"
289 "debian/README.erc-speak"
290 "debian/rules"
291 "debian/scripts/install"
292 "debian/scripts/install.in"
293 "debian/scripts/remove"
294 "debian/scripts/remove.in"
295 "debian/scripts/startup"
296 "debian/scripts/startup.erc"
297 "debian/scripts/startup.erc-speak"
298 )
4ee02020
KS
299 "List of files and directories to ignore.
300Changes to files in this list are not listed.")
8a5506f2 301
fea1add4
GM
302;; List via: find . -name '*.el' | sed 's/.*\///g' | sort | uniq -d
303;; FIXME It would be better to discover these dynamically.
304;; Note that traditionally "Makefile.in" etc have not been in this list.
305;; Ditto for "abbrev.texi" etc.
306(defconst authors-ambiguous-files
307 '("chart.el"
308 "compile.el"
309 "complete.el"
310 "cpp.el"
311 "ctxt.el"
312 "debug.el"
313 "dired.el"
314 "el.el"
315 "files.el"
316 "find.el"
317 "format.el"
318 "grep.el"
319 "imenu.el"
320 "java.el"
321 "linux.el"
322 "locate.el"
323 "make.el"
324 "mode.el"
325 "python.el"
326 "semantic.el"
327 "shell.el"
328 "simple.el"
329 "sort.el"
330 "speedbar.el"
331 "srecode.el"
332 "table.el"
333 "texi.el"
334 "util.el"
335 "wisent.el")
336 "List of basenames occurring more than once in the source.")
337
6b5e47dd
GM
338;; FIXME :cowrote entries here can be overwritten by :wrote entries
339;; derived from a file's Author: header (eg mh-e). This really means
340;; the Author: header is erroneous.
d5ab63b2 341(defconst authors-fixed-entries
8b1163a3 342 '(("Richard M. Stallman" :wrote "[The original GNU Emacs and numerous files]")
f39caf44 343 ("Joseph Arceneaux" :wrote "xrdb.c")
6b5e47dd
GM
344 ;; This refers to the obsolete Willisson (qv) version.
345;;; ("Blitz Product Development Corporation" :wrote "ispell.el")
d5ab63b2
GM
346 ("Frank Bresz" :wrote "diff.el")
347 ("David M. Brown" :wrote "array.el")
93da04c0
GM
348 ;; No longer distributed.
349;;; ("Gary Byers" :changed "xenix.h")
d5ab63b2 350 ("Shawn M. Carey" :wrote "freebsd.h")
93da04c0 351 ;; hp800.h renamed from hp9000s800.h, hpux.h merged into hpux10-20.h.
6b5e47dd
GM
352 ;; FIXME overwritten by Author:.
353 ("Satyaki Das" :cowrote "mh-search.el")
93da04c0
GM
354 ("Eric Decker" :changed "hp800.h" "hpux10-20.h" "sysdep.c")
355 ("Lawrence R. Dodd" :cowrote "dired-x.el")
356 ;; No longer distributed.
357;;; ("Viktor Dukhovni" :wrote "unexsunos4.c")
d5ab63b2 358 ("Paul Eggert" :wrote "rcs2log" "vcdiff")
29cf3e20 359 ("Fred Fish" :changed "unexcoff.c")
93da04c0
GM
360 ;; No longer distributed.
361;;; ("Tim Fleehart" :wrote "makefile.nt")
d5ab63b2
GM
362 ("Keith Gabryelski" :wrote "hexl.c")
363 ("Kevin Gallagher" :wrote "flow-ctrl.el")
93da04c0
GM
364 ;; Also wrote an earlier version of disp-table.el, since replaced
365 ;; by Erik Naggum's version; also iso-syntax.el, later renamed to
366 ;; latin-1.el, since deleted.
367 ("Howard Gayle" :wrote "casetab.c")
368 ;; :wrote mh-pick.el, since merged into mh-search.el.
6b5e47dd
GM
369 ;; Originally wrote mh-funcs.el, but it has been rewritten since.
370 ("Stephen Gildea" :wrote "refcard.tex"
371 :cowrote "mh-funcs.el" "mh-search.el")
93da04c0
GM
372 ;; cl.texinfo renamed to cl.texi.
373 ("David Gillespie" :wrote "cl.texi")
374 ;; No longer distributed: emacsserver.c.
375 ("Hewlett-Packard" :changed "emacsclient.c" "server.el" "keyboard.c")
376 ;; No longer distributed.
377;;; ("Thomas Horsley" :wrote "cxux.h" "cxux7.h")
d5ab63b2
GM
378 ("Indiana University Foundation" :changed "buffer.c" "buffer.h"
379 "indent.c" "search.c" "xdisp.c" "region-cache.c" "region-cache.h")
93da04c0 380 ;; ibmrt.h, ibmrt-aix.h no longer distributed.
d5ab63b2 381 ("International Business Machines" :changed "emacs.c" "fileio.c"
29cf3e20 382 "process.c" "sysdep.c" "unexcoff.c")
93da04c0
GM
383 ;; No longer distributed.
384;;; ("Ishikawa Chiaki" :changed "aviion.h" "dgux.h")
385 ;; ymakefile no longer distributed.
d5ab63b2 386 ("Michael K. Johnson" :changed "configure.in" "emacs.c" "intel386.h"
93da04c0 387 "mem-limits.h" "process.c" "template.h" "sysdep.c" "syssignal.h"
29cf3e20 388 "systty.h" "unexcoff.c" "linux.h")
93da04c0
GM
389 ;; No longer distributed.
390;;; ("Kyle Jones" :wrote "mldrag.el")
4ee02020 391 ("Henry Kautz" :wrote "bib-mode.el")
93da04c0
GM
392 ;; No longer distributed: vms-pwd.h, vmsfns.c, uaf.h.
393 ("Joseph M. Kelsey" :changed "fileio.c" "dir.h")
d5ab63b2 394 ("Sam Kendall" :changed "etags.c" "etags.el")
93da04c0
GM
395 ;; ack.texi: "We're not using his backquote.el any more."
396 ("Richard King" :wrote "userlock.el" "filelock.c")
d5ab63b2
GM
397 ("Sebastian Kremer" :changed "add-log.el")
398 ("Mark Lambert" :changed "process.c" "process.h")
399 ("Aaron Larson" :changed "bibtex.el")
6b5e47dd
GM
400 ;; It was :wrote, but it has been rewritten since.
401 ("James R. Larus" :cowrote "mh-e.el")
93da04c0
GM
402 ("Lars Lindberg" :changed "dabbrev.el" :cowrote "imenu.el")
403 ;; No longer distributed: lselect.el.
d5ab63b2
GM
404 ("Lucid, Inc." :changed "bytecode.c" "byte-opt.el" "byte-run.el"
405 "bytecomp.el" "delsel.el" "disass.el" "faces.el" "font-lock.el"
93da04c0 406 "lmenu.el" "mailabbrev.el" "select.el" "xfaces.c" "xselect.c")
6b5e47dd
GM
407 ;; MCC. No longer distributed: emacsserver.c.
408 ("Microelectronics and Computer Technology Corporation"
409 :changed "etags.c" "emacsclient.c" "movemail.c"
d5ab63b2
GM
410 "rmail.el" "rmailedit.el" "rmailkwd.el"
411 "rmailmsc.el" "rmailout.el" "rmailsum.el" "scribe.el"
6b5e47dd 412 ;; It was :wrote for xmenu.c, but it has been rewritten since.
29cf3e20 413 "server.el" "lisp.h" "sysdep.c" "unexcoff.c" "xmenu.c")
d5ab63b2 414 ("Niall Mansfield" :changed "etags.c")
93da04c0 415 ("Brian Marick" :cowrote "hideif.el")
d5ab63b2
GM
416 ("Marko Kohtala" :changed "info.el")
417 ("Sidney Markowitz" :changed "doctor.el")
93da04c0
GM
418 ;; No longer distributed: env.c.
419 ("Richard Mlynarik" :wrote "ehelp.el")
d5ab63b2
GM
420 ("Mosur Mohan" :changed "etags.c")
421 ("Jeff Morgenthaler" :changed "flow-ctrl.el" "vt200.el" "vt201.el"
422 "vt220.el" "vt240.el")
423 ("Motorola" :changed "buff-menu.el")
424 ("Hiroshi Nakano" :changed "ralloc.c")
425 ("Sundar Narasimhan" :changed "rnewspost.el")
93da04c0
GM
426 ;; No longer distributed.
427;;; ("NeXT, Inc." :wrote "unexnext.c")
d5ab63b2 428 ("Mark Neale" :changed "fortran.el")
93da04c0
GM
429 ;; Renamed from sc.el.
430 ("Martin Neitzel" :changed "supercite.el")
431 ("Andrew Oram" :changed "calendar.texi (and other files in man/)")
d5ab63b2
GM
432 ("Frederic Pierresteguy" :wrote "widget.c")
433 ("Michael D. Prange" :changed "tex-mode.el")
93da04c0
GM
434 ;; No longer distributed (dgux5-4r3.h was renamed to dgux5-4-3.h).
435;;; ("Paul Reilly" :wrote "gux5-4r2.h" "dgux5-4-3.h")
436 ("Roland B. Roberts" :changed "files.el" "sort.el"
437 "buffer.h" "callproc.c" "dired.c" "process.c" "sysdep.c" "systty.h")
438 ;; No longer distributed.
439;;; "vmspaths.h" "build.com" "compile.com" "kepteditor.com" "precomp.com"
440;;; "vmsproc.el" :wrote "logout.com" "mailemacs.com")
d5ab63b2
GM
441 ("Guillermo J. Rozas" :wrote "fakemail.c")
442 ("Wolfgang Rupprecht" :changed "lisp-mode.el" "loadup.el"
443 "sort.el" "alloc.c" "callint.c"
93da04c0
GM
444 ;; config.in renamed from config.h.in; ecrt0.c from crt0.c.
445 "config.in" "ecrt0.c" "data.c" "fns.c"
446 "lisp.h" "lread.c" ; "sun3.h" "ymakefile" - no longer distributed
447 "print.c" :wrote "float-sup.el" "floatfns.c")
d5ab63b2 448 ("Schlumberger Technology Corporation" :changed "gud.el")
93da04c0
GM
449 ;; Replaced by tcl.el.
450;;; ("Gregor Schmid" :wrote "tcl-mode.el")
d5ab63b2 451 ("Rainer Schoepf" :wrote "alpha.h" "unexalpha.c")
93da04c0
GM
452 ;; No longer distributed: emacsserver.c.
453 ("William Sommerfeld" :wrote "emacsclient.c" "scribe.el")
454 ;; No longer distributed: emacsserver.c.
455 ("Leigh Stoller" :changed "emacsclient.c" "server.el")
d5ab63b2
GM
456 ("Steve Strassman" :wrote "spook.el")
457 ("Shinichirou Sugou" :changed "etags.c")
93da04c0
GM
458 ;; No longer distributed: emacsserver.c.
459 ("Sun Microsystems, Inc" :changed "emacsclient.c" "server.el"
460 :wrote "emacs.icon" "sun.el")
461 ;; No longer distributed.
462;;; "emacstool.1" "emacstool.c" "sun-curs.el"
463;;; "sun-fns.el" "sun-mouse.el" "sunfns.c")
464 ;; Renamed from sc.el.
465 ("Kayvan Sylvan" :changed "supercite.el")
466 ;; No longer distributed: emacsserver.c, tcp.c.
467 ("Spencer Thomas" :changed "emacsclient.c" "server.el"
29cf3e20 468 "dabbrev.el" "unexcoff.c" "gnus.texi")
d5ab63b2 469 ("Jonathan Vail" :changed "vc.el")
29cf3e20 470 ("James Van Artsdalen" :changed "usg5-4.h" "unexcoff.c")
93da04c0
GM
471 ;; No longer distributed: src/makefile.nt, lisp/makefile.nt
472 ;; winnt.el renamed to w32-fns.el; nt.[ch] to w32.[ch];
473 ;; ntheap.[ch] to w32heap.[ch]; ntinevt.c to w32inevt.c;
474 ;; ntproc.c to w32proc.c; ntterm.c to w32term.c;
475 ;; windowsnt.h to ms-w32.h.
476 ("Geoff Voelker" :wrote "w32-fns.el" "w32.c" "w32.h" "w32heap.c"
477 "w32heap.h" "w32inevt.c" "w32proc.c" "w32term.c" "ms-w32.h")
8fc29035 478 ("Morten Welinder" :wrote "dosfns.c" "[many MS-DOS files]" "msdos.h")
ef43a0f4 479 ("Eli Zaretskii" :wrote "bidi.c" "[bidirectional display in xdisp.c]")
93da04c0
GM
480 ;; Not using this version any more.
481;;; ("Pace Willisson" :wrote "ispell.el")
6b5e47dd
GM
482 ;; FIXME overwritten by Author:.
483 ("Bill Wohler" :cowrote "mh-e.el")
d5ab63b2 484 ("Garrett Wollman" :changed "sendmail.el")
9109bf49 485 ("Dale R. Worley" :changed "mail-extr.el")
93da04c0
GM
486 ("Jamie Zawinski" :changed "bytecode.c" :wrote "tar-mode.el"
487 :cowrote "disass.el"))
d5ab63b2
GM
488 "Actions taken from the original, manually (un)maintained AUTHORS file.")
489
490
f39caf44
KS
491(defconst authors-valid-file-names
492 '("aclocal.m4"
eef72fce
GM
493 "build-ins.in"
494 "Makefile.noleim"
4ee02020 495 "makedist.bat"
eef72fce
GM
496 "makefile.def"
497 "makefile.nt"
498 "debug.bat.in" "emacs.bat.in"
499 ".gdbinit-union"
500 "alloca.s"
501 "make-delta"
502 "config.w95"
503 "emacstool.1"
504 "align.umax"
505 "cxux-crt0.s"
506 "gould-sigvec.s"
507 "getdate.y"
508 "ymakefile"
509 "permute-index" "index.perm"
46e6650e 510 "ibmrs6000.inp"
c11cc37a
GM
511 "b2m.c" "b2m.1" "b2m.pl"
512 "emacs.bash" "emacs.csh" "ms-kermit"
93da04c0 513 "emacs.ico"
eef72fce 514 "emacs21.ico"
c11cc37a 515 "BABYL" "LPF" "LEDIT" "OTHER.EMACSES"
eef72fce
GM
516 "emacs16_mac.png" "emacs24_mac.png"
517 "emacs256_mac.png" "emacs32_mac.png"
518 "emacs48_mac.png" "emacs512_mac.png"
fea1add4
GM
519 "revdiff" ; admin/
520 "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/
521 "mac-fix-env.m"
eef72fce
GM
522 ;; Deleted vms stuff:
523 "temacs.opt" "descrip.mms" "compile.com" "link.com"
524 )
fea1add4
GM
525 "File names which are valid, but no longer exist (or cannot be found)
526in the repository.")
f39caf44
KS
527
528(defconst authors-renamed-files-alist
529 '(("nt.c" . "w32.c") ("nt.h" . "w32.h")
530 ("ntheap.c" . "w32heap.c") ("ntheap.h" . "w32heap.h")
531 ("ntinevt.c" . "w32inevt.c") ("ntinevt.h" . "w32inevt.h")
532 ("ntproc.c" . "w32proc.c")
533 ("w32console.c" . "w32term.c")
534 ("unexnt.c" . "unexw32.c")
535 ("s/windowsnt.h" . "s/ms-w32.h")
93da04c0 536 ("winnt.el" . "w32-fns.el")
f39caf44 537 ("config.emacs" . "configure")
93da04c0
GM
538 ("config.h.dist" . "config.in")
539 ("config.h-dist" . "config.in")
540 ("config.h.in" . "config.in")
eef72fce
GM
541 ("paths.h-dist" . "paths.h.in")
542 ("patch1" . "sed1.inp")
f39caf44 543 ("GETTING.GNU.SOFTWARE" . "FTP")
eef72fce
GM
544 ("etc/MACHINES" . "MACHINES")
545 ("ONEWS" . "NEWS.19")
546 ("ONEWS.1" . "NEWS.1-17")
547 ("ONEWS.2" . "NEWS.1-17")
548 ("ONEWS.3" . "NEWS.18")
549 ("ONEWS.4" . "NEWS.18")
550 ("ORDERS.USA" . "ORDERS")
551 ("EUROPE" . "ORDERS")
552 ("DIFF" . "OTHER.EMACSES")
553 ("CCADIFF" . "OTHER.EMACSES")
554 ("GOSDIFF" . "OTHER.EMACSES")
555 ("Makefile.in.in" . "Makefile.in")
4ee02020
KS
556 ("leim-Makefile" . "leim/Makefile")
557 ("leim-Makefile.in" . "leim/Makefile.in")
92158bc3
KS
558 ("emacs-lisp/testcover-ses.el" . "tcover-ses.el")
559 ("emacs-lisp/testcover-unsafep.el" . "tcover-unsafep.el")
6b5e47dd
GM
560 ;; index and pick merged into search.
561 ("mh-index.el" . "mh-search.el")
562 ("mh-pick.el" . "mh-search.el")
fea1add4 563 ("font-setting.el" . "dynamic-setting.el")
b788a98d
GM
564 ;; INSTALL-CVS -> .CVS -> .BZR
565 ("INSTALL-CVS" . "INSTALL.BZR")
566 ("INSTALL.CVS" . "INSTALL.BZR")
eef72fce
GM
567 ("refcards/fr-drdref.pdf" . "refcards/fr-dired-ref.pdf")
568 ("gnus-logo.eps" . "refcards/gnus-logo.eps")
569 ("build-install" . "build-ins.in")
570 ("build-install.in" . "build-ins.in")
571 ("unidata/Makefile" . "unidata/Makefile.in")
572 ;; Not renamed, but we only have the latter in the Emacs repo.
573 ("trampver.texi.in" . "trampver.texi")
574 ("e/eterm" . "e/eterm-color")
575 ("e/eterm.ti" . "e/eterm-color.ti")
576 ("README.txt" . "README")
577 ("emacs.names" . "JOKES")
578 ("ED.WORSHIP" . "JOKES")
579 ("GNU.JOKES" . "JOKES")
580 ("CHARACTERS" . "TODO")
581 ("schema/xhtml-basic-form.rnc" . "schema/xhtml-bform.rnc" )
582 ("schema/xhtml-basic-table.rnc" . "schema/xhtml-btable.rnc")
583 ("schema/xhtml-list.rnc" . "schema/xhtml-lst.rnc")
584 ("schema/xhtml-target.rnc" . "schema/xhtml-tgt.rnc")
585 ("schema/xhtml-style.rnc" . "schema/xhtml-xstyle.rnc")
586 ("schema/docbook-dyntbl.rnc" . "schema/docbk-dyntbl.rnc")
587 ("schema/docbook-soextbl.rnc" . "schema/docbk-soextbl.rn" )
588 ("texi/url.txi" . "url.texi")
fea1add4 589 ("edt-user.doc" . "edt.texi")
c11cc37a 590 ("DEV-NOTES" . "nextstep")
eef72fce
GM
591 ;; Moved to different directories.
592 ("ctags.1" . "ctags.1")
593 ("etags.1" . "etags.1")
594 ("emacs.1" . "emacs.1")
595 ("emacsclient.1" . "emacsclient.1")
596 ("icons/emacs21.ico" . "emacs21.ico")
c11cc37a
GM
597 ;; Moved from admin/nt/ to nt/.
598 ("nt/README.W32" . "README.W32")
f39caf44
KS
599 )
600 "Alist of files which have been renamed during their lifetime.
601Elements are (OLDNAME . NEWNAME).")
602
603(defconst authors-renamed-files-regexps
604 '(("^m/m-\\(.*\\.h\\)$" . "m/\\1")
605 ("^m-\\(.*\\.h\\)$" . "\\1")
606 ("^s/s-\\(.*\\.h\\)$" . "s/\\1")
607 ("^s-\\(.*\\.h\\)$" . "\\1")
608 ("^s/[-.a-zA-Z0-9_]+\\.h$" . t)
609 ("\\(.*\\)\\.cmd$" . "\\1.bat")
610 ("\\.bat$" . t)
611 ("\\.[ch]$" . t)
612 ("\\.el$" . t)
613 ("\\.ps$" . t)
614 ("\\.texi?$" . t)
615 ("\\.texinfo$" . t)
616 ("\\.xml?$" . t)
617 ("\\.x[pb]m$" . t)
618 ("\\.[xp]bm$" . t)
619 ("^paths\\." . t)
620 ("^install\\." . t)
eef72fce
GM
621 ("^\\(TUTORIAL[^/]*\\)" . "tutorials/\\1")
622 ("^\\(tree-widget/\\(?:default\\|folder\\)/[-a-z]+\\.png\\)$" .
623 "images/\\1")
624 ("^\\(images/icons/\\)mac\\(emacs\\)_\\([0-9]+\\)\\(\\.png\\)" .
625 "\\1\\2\\3_mac\\4")
626 ("\\(images/icons/\\)emacs_\\([0-9][0-9]\\)\\.png" .
627 "\\1hicolor/\\2x\\2/apps/emacs.png")
f39caf44
KS
628 )
629 "List regexps and rewriting rules for renamed files.
630Elements are (REGEXP . REPLACE). If REPLACE is a string, the file
631name matching REGEXP is replaced by REPLACE using `replace-string'.
632Otherwise, the file name is accepted as is.")
633
634(defvar authors-checked-files-alist)
635(defvar authors-invalid-file-names)
636
fea1add4
GM
637(defun authors-disambiguate-file-name (fullname)
638 "Convert FULLNAME to an unambiguous relative-name."
639 (let ((relname (file-name-nondirectory fullname))
640 parent)
641 (if (member relname authors-ambiguous-files)
642 ;; In case of ambiguity, just prepend the parent directory.
643 ;; FIXME obviously this is not a perfect solution.
644 (if (string-equal "lisp"
645 (setq parent (file-name-nondirectory
646 (directory-file-name
647 (file-name-directory fullname)))))
648 relname
649 (format "%s/%s" parent relname))
650 relname)))
651
f39caf44 652(defun authors-canonical-file-name (file log-file pos author)
6b5e47dd 653 "Return canonical file name for FILE found in LOG-FILE.
f39caf44 654Checks whether FILE is a valid (existing) file name, has been renamed,
fea1add4 655or is on the list of removed files. Returns the non-directory part of
6b5e47dd
GM
656the file name. Only uses the LOG-FILE position POS and associated AUTHOR
657to print a message if FILE is not found."
93da04c0
GM
658 ;; FILE should be re-checked in every different directory associated
659 ;; with a LOG-FILE. Eg configure.in from src/ChangeLog is not the
660 ;; same as that from top-level/ChangeLog.
661 (let* ((fullname (expand-file-name file (file-name-directory log-file)))
662 (entry (assoc fullname authors-checked-files-alist))
663 relname
664 valid)
f39caf44
KS
665 (if entry
666 (cdr entry)
667 (setq relname (file-name-nondirectory file))
668 (if (or (member relname authors-valid-file-names)
669 (file-exists-p file)
670 (file-exists-p relname)
671 (file-exists-p (concat "etc/" relname)))
fea1add4 672 (setq valid (authors-disambiguate-file-name fullname))
f39caf44
KS
673 (setq valid (assoc file authors-renamed-files-alist))
674 (if valid
675 (setq valid (cdr valid))
676 (let ((rules authors-renamed-files-regexps))
677 (while rules
678 (if (string-match (car (car rules)) file)
679 (setq valid (if (stringp (cdr (car rules)))
680 (file-name-nondirectory
681 (replace-match (cdr (car rules)) t nil file))
682 relname)
683 rules nil))
684 (setq rules (cdr rules))))))
685 (setq authors-checked-files-alist
93da04c0 686 (cons (cons fullname valid) authors-checked-files-alist))
9109bf49 687 (unless (or valid
eef72fce 688 (member file authors-ignored-files)
fea1add4 689 (authors-obsolete-file-p file)
9109bf49
KS
690 (string-match "[*]" file)
691 (string-match "^[0-9.]+$" file))
a1506d29 692 (setq authors-invalid-file-names
f39caf44
KS
693 (cons (format "%s:%d: unrecognized `%s' for %s"
694 log-file
695 (1+ (count-lines (point-min) pos))
696 file author)
697 authors-invalid-file-names)))
698 valid)))
699
d5ab63b2
GM
700(defun authors-add-fixed-entries (table)
701 "Add actions from `authors-fixed-entries' to TABLE."
702 (dolist (entry authors-fixed-entries)
703 (let ((author (car entry))
704 action)
705 (dolist (item (cdr entry))
706 (if (symbolp item)
707 (setq action item)
708 (authors-add author item action table))))))
709
3932b29a 710
8a5506f2
GM
711(defun authors-obsolete-file-p (file)
712 "Return non-nil if FILE is obsolete.
3932b29a 713FILE is considered obsolete if it matches one of the regular expressions
8a5506f2
GM
714from `authors-obsolete-files-regexps'."
715 (let (obsolete-p
716 (regexps authors-obsolete-files-regexps))
717 (while (and regexps (not obsolete-p))
718 (setq obsolete-p (string-match (car regexps) file)
719 regexps (cdr regexps)))
720 obsolete-p))
721
722
3215096c
GM
723(defun authors-add (author file action table)
724 "Record that AUTHOR worked on FILE.
725ACTION is a keyword symbol describing what he did. Record file,
726author and what he did in hash table TABLE. See the description of
727`authors-scan-change-log' for the structure of the hash table."
4ee02020
KS
728 (unless (or (member file authors-ignored-files)
729 (authors-obsolete-file-p file)
9c1af546 730 (equal author ""))
8a5506f2 731 (let* ((value (gethash author table))
f39caf44
KS
732 (entry (assoc file value))
733 slot)
8a5506f2 734 (if (null entry)
f39caf44
KS
735 (puthash author (cons (list file (cons action 1)) value) table)
736 (if (setq slot (assoc action (cdr entry)))
737 (setcdr slot (1+ (cdr slot)))
738 (nconc entry (list (cons action 1))))))))
3215096c
GM
739
740
3215096c
GM
741(defun authors-canonical-author-name (author)
742 "Return a canonicalized form of AUTHOR, an author name.
eef72fce
GM
743If AUTHOR has an entry in `authors-aliases', use that. Remove
744email addresses. Capitalize words in the author's name, unless
745it is found in `authors-fixed-case'."
f39caf44
KS
746 (let* ((aliases authors-aliases)
747 regexps realname)
3215096c 748 (while aliases
f39caf44
KS
749 (setq realname (car (car aliases))
750 regexps (cdr (car aliases))
751 aliases (cdr aliases))
752 (while regexps
753 (if (string-match (car regexps) author)
754 (setq author realname
755 regexps nil
756 aliases nil)
757 (setq regexps (cdr regexps))))))
758 (when author
759 (setq author (replace-regexp-in-string "[ \t]*[(<].*$" "" author))
d0f483e8 760 (setq author (replace-regexp-in-string "\`[ \t]+" "" author))
f39caf44 761 (setq author (replace-regexp-in-string "[ \t]+$" "" author))
d0f483e8
KS
762 (setq author (replace-regexp-in-string "[ \t]+" " " author))
763 (unless (string-match "[-, \t]" author)
764 (setq author ""))
eef72fce
GM
765 (or (car (member author authors-fixed-case))
766 (capitalize author))))
f39caf44 767
f39caf44
KS
768(defun authors-scan-change-log (log-file table)
769 "Scan change log LOG-FILE for author information.
3215096c
GM
770
771For each change mentioned in the log, add an entry to hash table TABLE
772under the author's canonical name.
773
774Keys of TABLE are author names. Values are alists of entries (FILE
f39caf44
KS
775\(ACTION . COUNT) ...). FILE is one file the author worked on. The
776rest of the entry is a list of keyword symbols describing what he did
2603d79b 777with the file and the number of each action:
3215096c
GM
778
779:wrote means the author wrote the file
2603d79b 780:cowrote means he wrote the file in collaboration with others
f39caf44 781:changed means he changed the file COUNT times."
3932b29a 782
2603d79b 783 (let* ((enable-local-variables :safe) ; for find-file, hence let*
68013cfa 784 (enable-local-eval nil)
f39caf44
KS
785 (existing-buffer (get-file-buffer log-file))
786 (buffer (find-file-noselect log-file))
6b5e47dd 787 authors file pos)
9a529312 788 (with-current-buffer buffer
3215096c
GM
789 (save-restriction
790 (widen)
791 (goto-char (point-min))
792 (while (re-search-forward "^[0-9]\\|^[ \t]+\\* " nil t)
793 (beginning-of-line)
f39caf44 794 (setq pos (point))
3215096c 795 (cond ((looking-at "^[0-9]+-[0-9]+-[0-9]+")
6b5e47dd
GM
796 ;; Handle joint authorship of changes.
797 ;; This can be a bit fragile, and is not too common.
798 (setq authors nil)
799 (while (progn
800 (skip-chars-forward " \t+:0-9-")
801 (not (looking-at "\\($\\|\\*\\|\
802Suggested\\|Trivial\\|Version\\|Originally\\|From:\\|Patch[ \t]+[Bb]y\\)")))
803 (push (authors-canonical-author-name
804 (buffer-substring-no-properties
805 (point) (line-end-position))) authors)
806 (forward-line 1)))
3215096c
GM
807 ((looking-at "^[ \t]+\\*")
808 (let ((line (buffer-substring-no-properties
809 (match-end 0) (line-end-position))))
810 (while (and (not (string-match ":" line))
811 (forward-line 1)
812 (not (looking-at ":\\|^[ \t]*$")))
813 (setq line (concat line
814 (buffer-substring-no-properties
815 (line-beginning-position)
816 (line-end-position)))))
817 (when (string-match ":" line)
818 (setq line (substring line 0 (match-beginning 0)))
819 (setq line (replace-regexp-in-string "[[(<{].*$" "" line))
820 (setq line (replace-regexp-in-string "," "" line))
821 (dolist (file (split-string line))
6b5e47dd
GM
822 (when (setq file (authors-canonical-file-name file log-file pos (car authors)))
823 (dolist (author authors)
824 ;;(message "%s changed %s" author file)
825 (authors-add author file :changed table)))))
3215096c
GM
826 (forward-line 1)))))))
827 (unless existing-buffer
828 (kill-buffer buffer))))
829
830
831(defun authors-scan-el (file table)
832 "Scan Lisp file FILE for author information.
833TABLE is a hash table to add author information to."
2603d79b
GM
834 (let* ((existing-buffer (get-file-buffer file))
835 (enable-local-variables :safe) ; for find-file, hence let*
836 (enable-local-eval nil)
837 (buffer (find-file-noselect file)))
fea1add4 838 (setq file (authors-disambiguate-file-name (expand-file-name file)))
9a529312 839 (with-current-buffer buffer
3215096c
GM
840 (save-restriction
841 (widen)
842 (goto-char (point-min))
843 (while (and (re-search-forward
93da04c0
GM
844 "^;+[ \t]*\\(Authors?\\|Commentary\\|Code\\):[ \t]*" nil t)
845 (not (member (match-string 1) '("Commentary" "Code"))))
846 (let ((continue t)
847 (action :wrote)
848 authors)
849 (while continue
850 ;; Some entries contain a year range in front of the
851 ;; author's name.
852 (skip-chars-forward "-0-9 \t")
853 (push (authors-canonical-author-name
854 (buffer-substring-no-properties
855 (point) (line-end-position))) authors)
856 ;; tips.texi says the continuation line should begin
857 ;; with a tab, but often spaces are used.
858 (setq continue
859 (and (zerop (forward-line 1))
860 (looking-at ";;;?\\(\t+ *\\| +\\)[[:alnum:]]")
861 (goto-char (1- (match-end 0)))
862 (not (looking-at "[[:upper:]][-[:alpha:]]+:[ \t]")))))
863 (and (> (length authors) 1)
864 (setq action :cowrote))
865 (mapc (lambda (author)
866 (authors-add author file action table))
867 authors)))))
3215096c
GM
868 (unless existing-buffer
869 (kill-buffer buffer))))
870
871
0a521885
GM
872(defun authors-public-domain-p (file)
873 "Return t if FILE is a file that was put in public domain."
874 (let ((public-domain-p nil)
875 (list authors-public-domain-files))
876 (while (and list (not public-domain-p))
877 (when (string-match (car list) file)
878 (setq public-domain-p t))
879 (setq list (cdr list)))
880 public-domain-p))
881
f39caf44
KS
882(defvar authors-author-list)
883
884(defun authors-add-to-author-list (author changes)
885 "Insert information about AUTHOR's work on Emacs into `authors-author-list'.
886CHANGES is an alist of entries (FILE (ACTION . COUNT) ...), as produced by
887`authors-scan-change-log'.
93da04c0
GM
888The element added to `authors-author-list' is (AUTHOR WROTE CO-WROTE CHANGED),
889where WROTE, CO-WROTE, and CHANGED are lists of the files written, co-written
890and changed by AUTHOR."
f39caf44
KS
891 (when author
892 (let ((nchanged 0)
893 wrote-list
93da04c0 894 cowrote-list
f39caf44 895 changed-list)
3215096c 896 (dolist (change changes)
93da04c0
GM
897 (let* ((actions (cdr change))
898 (file (car change))
899 (filestat (if (authors-public-domain-p file)
900 (concat file " (public domain)")
901 file))
902 slot)
903 (cond ((assq :wrote actions)
904 (setq wrote-list (cons filestat wrote-list)))
905 ((assq :cowrote actions)
906 (setq cowrote-list (cons filestat cowrote-list)))
907 (t
908 (setq changed-list
909 (cons (cons file (cdr (assq :changed actions)))
910 changed-list))))))
f39caf44
KS
911 (if wrote-list
912 (setq wrote-list (sort wrote-list 'string-lessp)))
93da04c0
GM
913 (if cowrote-list
914 (setq cowrote-list (sort cowrote-list 'string-lessp)))
f39caf44
KS
915 (when changed-list
916 (setq changed-list (sort changed-list
917 (lambda (a b)
918 (if (= (cdr a) (cdr b))
919 (string-lessp (car a) (car b))
920 (> (cdr a) (cdr b))))))
921 (setq nchanged (length changed-list))
922 (setq changed-list (mapcar 'car changed-list)))
923 (if (> (- nchanged authors-many-files) 2)
924 (setcdr (nthcdr authors-many-files changed-list)
925 (list (format "and %d other files" (- nchanged authors-many-files)))))
926 (setq authors-author-list
93da04c0 927 (cons (list author wrote-list cowrote-list changed-list)
f39caf44 928 authors-author-list)))))
3215096c 929
3215096c
GM
930(defun authors (root)
931 "Extract author information from change logs and Lisp source files.
932ROOT is the root directory under which to find the files. If called
a1506d29 933interactively, ROOT is read from the minibuffer.
f39caf44
KS
934Result is a buffer *Authors* containing authorship information, and a
935buffer *Authors Errors* containing references to unknown files."
3215096c 936 (interactive "DEmacs source directory: ")
d2f288c6 937 (setq root (expand-file-name root))
c7efbb12 938 (let ((logs (process-lines find-program root "-name" "ChangeLog*"))
3215096c 939 (table (make-hash-table :test 'equal))
f39caf44
KS
940 (buffer-name "*Authors*")
941 authors-checked-files-alist
942 authors-invalid-file-names)
621af279
DK
943 (authors-add-fixed-entries table)
944 (unless (file-exists-p (expand-file-name "src/emacs.c" root))
be3f421b
RS
945 (unless (y-or-n-p
946 (format "Not the root directory of Emacs: %s, continue? " root))
5a0c3f56 947 (error "Not the root directory")))
3215096c 948 (dolist (log logs)
77777daf 949 (when (string-match "ChangeLog\\(.[0-9]+\\)?$" log)
3215096c
GM
950 (message "Scanning %s..." log)
951 (authors-scan-change-log log table)))
c7efbb12 952 (let ((els (process-lines find-program root "-name" "*.el")))
3215096c
GM
953 (dolist (file els)
954 (message "Scanning %s..." file)
955 (authors-scan-el file table)))
f39caf44 956 (message "Generating buffer %s..." buffer-name)
3215096c
GM
957 (set-buffer (get-buffer-create buffer-name))
958 (erase-buffer)
f39caf44 959 (set-buffer-file-coding-system authors-coding-system)
a1506d29 960 (insert
f39caf44
KS
961"Many people have contributed code included in the Free Software
962Foundation's distribution of GNU Emacs. To show our appreciation for
963their public spirit, we list here in alphabetical order a condensed
964list of their contributions.\n")
965 (let (authors-author-list a)
966 (maphash #'authors-add-to-author-list table)
a1506d29 967 (setq authors-author-list
f39caf44
KS
968 (sort authors-author-list
969 (lambda (a b) (string-lessp (car a) (car b)))))
970 (dolist (a authors-author-list)
971 (let ((author (car a))
972 (wrote (nth 1 a))
93da04c0
GM
973 (cowrote (nth 2 a))
974 (changed (nth 3 a))
f39caf44
KS
975 file)
976 (insert "\n" author ": ")
977 (when wrote
978 (insert "wrote")
979 (dolist (file wrote)
980 (if (> (+ (current-column) (length file)) 72)
981 (insert "\n "))
982 (insert " " file))
983 (insert "\n"))
93da04c0 984 (when cowrote
f39caf44
KS
985 (if wrote
986 (insert "and "))
93da04c0
GM
987 (insert "co-wrote")
988 (dolist (file cowrote)
989 (if (> (+ (current-column) (length file)) 72)
990 (insert "\n "))
991 (insert " " file))
992 (insert "\n"))
993 (when changed
994 (if (or wrote cowrote)
995 (insert "and "))
f39caf44
KS
996 (insert "changed")
997 (dolist (file changed)
998 (if (> (+ (current-column) (length file)) 72)
999 (insert "\n "))
1000 (insert " " file))
1001 (insert "\n")))))
a1506d29 1002 (insert "\nLocal" " Variables:\ncoding: "
f39caf44
KS
1003 (symbol-name authors-coding-system) "\nEnd:\n")
1004 (message "Generating buffer %s... done" buffer-name)
d5ab63b2 1005 (unless noninteractive
f39caf44
KS
1006 (when authors-invalid-file-names
1007 (with-current-buffer (get-buffer-create "*Authors Errors*")
eef72fce 1008 (setq buffer-read-only nil)
f39caf44
KS
1009 (erase-buffer)
1010 (set-buffer-file-coding-system authors-coding-system)
1011 (insert "Unrecognized file entries found:\n\n")
0c8b414f
JB
1012 (mapc (lambda (f) (if (not (string-match "^[A-Za-z]+$" f)) (insert f "\n")))
1013 (sort authors-invalid-file-names 'string-lessp))
f39caf44
KS
1014 (goto-char (point-min))
1015 (compilation-mode)
1016 (message "Errors were found. See buffer %s" (buffer-name))))
d5ab63b2
GM
1017 (pop-to-buffer buffer-name))))
1018
1019
d5ab63b2
GM
1020(defun batch-update-authors ()
1021 "Produce an AUTHORS file.
1022Call this function in batch mode with two command line arguments FILE
1023and ROOT. FILE is the file to write, ROOT is the root directory of
1024the Emacs source tree, from which to build the file."
1025 (unless noninteractive
1026 (error "`batch-update-authors' is to be used only with -batch"))
1027 (when (/= (length command-line-args-left) 2)
1028 (error "Call `batch-update-authors' with the name of the file to write"))
8e13db77
EZ
1029 (let* ((file (pop command-line-args-left))
1030 (root (pop command-line-args-left)))
d5ab63b2
GM
1031 (authors root)
1032 (write-file file)))
3215096c 1033
c420eb36
GM
1034(provide 'authors)
1035
55535639 1036;;; authors.el ends here