Spelling fixes.
[bpt/emacs.git] / lisp / emacs-lisp / authors.el
CommitLineData
25b30b16 1;;; authors.el --- utility for maintaining Emacs' AUTHORS file -*-coding: utf-8;-*-
3215096c 2
73b0cd50 3;; Copyright (C) 2000-2011 Free Software Foundation, Inc.
3215096c 4
60e8e0a5 5;; Author: Gerd Moellmann <gerd@gnu.org>
f39caf44 6;; Maintainer: Kim F. Storm <storm@cua.dk>
60e8e0a5 7;; Keywords: maint
aad4679e 8;; Package: emacs
60e8e0a5 9
3215096c
GM
10;; This file is part of GNU Emacs.
11
d6cba7ae 12;; GNU Emacs is free software: you can redistribute it and/or modify
3215096c 13;; it under the terms of the GNU General Public License as published by
d6cba7ae
GM
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
3215096c
GM
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
d6cba7ae 23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
3215096c
GM
24
25;;; Commentary:
26
27;; Use M-x authors RET to create an *Authors* buffer that can used as
28;; or merged with Emacs' AUTHORS file.
29
30;;; Code:
31
25b30b16 32(defvar authors-coding-system 'utf-8
f39caf44
KS
33 "Coding system used in the AUTHORS file.")
34
3215096c
GM
35(defconst authors-many-files 20
36 "Maximum number of files for which to print individual information.
f39caf44
KS
37If an author has modified more files, only the names of the most
38frequently modified files are printed and a count of the additional
39files.")
3215096c
GM
40
41(defconst authors-aliases
f39caf44 42 '(
01cc3e13 43 ("Aaron S. Hawley" "Aaron Hawley")
9109bf49 44 ("Andrew Csillag" "Drew Csillag")
9dfa8726 45 ("Anna M. Bigatti" "Anna Bigatti")
f39caf44
KS
46 ("Barry A. Warsaw" "Barry A. Warsaw, Century Computing, Inc."
47 "Barry A. Warsaw, ITB" "Barry Warsaw")
6b5e47dd
GM
48 ("Bill Mann" "William F. Mann")
49 ("Bill Rozas" "Guillermo J. Rozas")
25b30b16 50 ("Björn Torkelsson" "Bjorn Torkelsson")
f39caf44
KS
51 ("Brian Fox" "Brian J. Fox")
52 ("Christoph Wedler" "Christoph.Wedler@sap.com")
53 ("Daniel Pfeiffer" "<Daniel.Pfeiffer@Informatik.START.db.de>"
54 "<Daniel.Pfeiffer@Informatik.START.dbp.de>")
6b5e47dd 55 ("David De La Harpe Golden" "David Golden")
f39caf44 56 ("David Gillespie" "Dave Gillespie")
25b30b16 57 ("David Kågedal" "David K..edal")
93da04c0 58 ("David M. Koppelman" "David M. Koppelman, Koppel@Ec?e.Lsu.Edu"
605046ef 59 "David Koppelman")
d0f483e8 60 ("David M. Smith" "David Smith" "David M Smith")
01cc3e13 61 ("Deepak Goel" "D. Goel")
d0f483e8 62 ("Ed L. Cashin" "Ed L Cashin")
f39caf44
KS
63 ("Edward M. Reingold" "Ed Reingold" "Edward M Reingold"
64 "Reingold Edward M")
65 ("Eli Zaretskii" "eliz")
4ee02020 66 ("Emilio C. Lopes" "Emilio Lopes")
d0f483e8 67 ("Era Eriksson" "Era@Iki.Fi")
f39caf44
KS
68 ("Eric M. Ludlam" "Eric Ludlam")
69 ("Eric S. Raymond" "Eric Raymond")
70 ("Eric Youngdale" "(Eric Youngdale at youngdale@v6550c.nrl.navy.mil)")
d0f483e8 71 ("Francis J. Wright" "Dr Francis J. Wright" "Francis Wright")
25b30b16
GM
72 ("François Pinard" "Francois Pinard")
73 ("Francesco Potortì" "Francesco Potorti" "Francesco Potorti`")
f39caf44
KS
74 ("Frederic Pierresteguy" "Fred Pierresteguy")
75 ("Geoff Voelker" "voelker")
25b30b16 76 ("Gerd Möllmann" "Gerd Moellmann")
6b5e47dd 77 ("Hallvard B. Furuseth" "Hallvard B Furuseth" "Hallvard Furuseth")
25b30b16 78 ("Hrvoje Nikšić" "Hrvoje Niksic")
2603d79b
GM
79 ;; src/ChangeLog.4, 1994-01-11, since fixed.
80;;; (nil "(afs@hplb.hpl.hp.com)")
81 ;; lisp/gnus/ChangeLog.1, 1998-01-15.
82 ;; http://quimby.gnus.org/cgi-bin/cvsweb.cgi/gnus/lisp/gnus-art.el?rev=4.13
f39caf44 83 (nil "<Use-Author-Address-Header@\\[127.1\\]>")
2603d79b
GM
84 (nil "Code Extracted") ; lisp/newcomment.el's "Author:" header
85 (nil "\\`FSF") ; FIXME what is this for - no effect?
86 ;; lisp/gnus/ChangeLog.1, 1997-10-12, since fixed.
87;;; (nil "ISO-2022-JP")
f39caf44 88 ("Jaeyoun Chung" "Jae-youn Chung" "Jae-you Chung" "Chung Jae-youn")
25b30b16 89 ("Jan Djärv" "Jan D." "Jan Djarv")
d0f483e8 90 ("Jay K. Adams" "jka@ece.cmu.edu" "Jay Adams")
25b30b16 91 ("Jérôme Marant" "Jérôme Marant" "Jerome Marant")
f39caf44 92 ("Jens-Ulrik Holger Petersen" "Jens-Ulrik Petersen")
605046ef 93 ("Jeremy Bertram Maitin-Shepard" "Jeremy Maitin-Shepard")
25b30b16 94 ("Johan Bockgård" "Johan Bockgard")
4ee02020 95 ("John W. Eaton" "John Eaton")
f39caf44
KS
96 ("Jonathan I. Kamens" "Jonathan Kamens")
97 ("Joseph Arceneaux" "Joe Arceneaux")
6b5e47dd 98 ("Joseph M. Kelsey" "Joe Kelsey") ; FIXME ?
25b30b16 99 ("Juan León Lahoz García" "Juan-Leon Lahoz Garcia")
f39caf44 100 ("K. Shane Hartman" "Shane Hartman")
25b30b16 101 ("Kai Großjohann" "Kai Grossjohann" "Kai Großjohann"
d0f483e8
KS
102 "Kai.Grossjohann@Cs.Uni-Dortmund.De"
103 "Kai.Grossjohann@Gmx.Net")
f39caf44 104 ("Karl Berry" "K. Berry")
25b30b16 105 ("Károly Lőrentey" "Károly Lőrentey" "Lőrentey Károly")
d0f483e8 106 ("Kazushi Marukawa" "Kazushi")
f39caf44
KS
107 ("Ken Manheimer" "Kenneth Manheimer")
108 ("Kenichi Handa" "Ken'ichi Handa" "Kenichi HANDA")
4ee02020 109 ("Kevin Greiner" "Kevin J. Greiner")
f39caf44 110 ("Kim F. Storm" "Kim Storm")
d0f483e8 111 ("Kyle Jones" "Kyle E. Jones")
f39caf44 112 ("Marcus G. Daniels" "Marcus Daniels")
d0f483e8 113 ("Mark D. Baushke" "Mark D Baushke")
6b5e47dd 114 ("Marko Kohtala" "Kohtala Marko")
25b30b16 115 ("Agustín Martín" "Agustin Martin")
d0f483e8
KS
116 ("Martin Lorentzon" "Martin Lorentzson")
117 ("Matt Swift" "Matthew Swift")
6b5e47dd 118 ("Maxime Edouard Robert Froumentin" "Max Froumentin")
4ee02020 119 ("Michael R. Mauger" "Michael Mauger")
f39caf44 120 ("Michael D. Ernst" "Michael Ernst")
25b30b16 121 ("Michaël Cadilhac" "Michael Cadilhac")
f39caf44 122 ("Michael I. Bushnell" "Michael I Bushnell" "Michael I. Bushnell, P/Bsg")
6b5e47dd
GM
123 ("Michael R. Cook" "Michael Cook")
124 ("Michael Sperber" "Michael Sperber \\[Mr. Preprocessor\\]")
4ee02020 125 ("Mikio Nakajima" "Nakajima Mikio")
6b5e47dd 126 ("Nelson Jose dos Santos Ferreira" "Nelson Ferreira")
f39caf44
KS
127 ("Paul Eggert" "eggert")
128 ("Paul Reilly" "(pmr@legacy.pajato.com)")
be3f421b 129 ("Pavel Janík" "Pavel Janík Ml." "Pavel Janik Ml." "Pavel Janik" "Pavel Janík" "Pavel@Janik.Cz")
24e15888 130 ("Pavel Kobiakov" "Pavel Kobyakov")
f39caf44 131 ("Per Abrahamsen" "Per Abhiddenware")
24e15888 132 ("Per Starbäck" "Per Starback")
d0f483e8
KS
133 ("Peter S. Galbraith" "Peter Galbraith")
134 ("Peter Runestig" "Peter 'luna' Runestig")
f39caf44 135 ("Peter S. Galbraith" "Peter S Galbraith")
6b5e47dd
GM
136 ("Raja R. Harinath" "Raja R Harinath")
137 ("Richard G. Bielawski" "Richard G Bielawski" "Richard Bielawski")
138 ("Richard King" "Dick King")
f39caf44 139 ("Richard M. Stallman" "Richard M. Stallman,,," "Richard Stallman"
a1506d29 140 "rms" "rms@gnu.org")
f39caf44
KS
141 ("Robert J. Chassell" "Bob Chassell")
142 ("Roland B. Roberts" "Roland B Roberts" "Roland Roberts")
143 ("Rui-Tao Dong" "Rui-Tao Dong ~{6-Hpln~}")
a8d37031 144 ("Sacha Chua" "Sandra Jean Chua")
f39caf44 145 ("Sam Steingold" "Sam Shteingold")
9109bf49 146 ("Satyaki Das" "Indexed search by Satyaki Das")
93da04c0
GM
147 ;; There are other Stefans.
148;;; ("Stefan Monnier" "Stefan")
f39caf44
KS
149 ("Stephen A. Wood" "(saw@cebaf.gov)")
150 ("Steven L. Baur" "SL Baur" "Steven L Baur")
93da04c0 151 ("Stewart M. Clamen" "Stewart Clamen")
6b5e47dd 152 ("Stuart D. Herring" "Stuart Herring" "Davis Herring")
93da04c0 153 ("Taichi Kawabata" "KAWABATA,? Taichi")
f39caf44 154 ("Takaaki Ota" "Tak Ota")
4ee02020 155 ("Takahashi Naoto" "Naoto Takahashi")
d0f483e8 156 ("Teodor Zlatanov" "Ted Zlatanov")
6b5e47dd
GM
157 ("Thomas Horsley" "Tom Horsley") ; FIXME ?
158 ("Thomas Wurgler" "Tom Wurgler")
159 ("Tomohiko Morioka" "MORIOKA Tomohiko")
25b30b16
GM
160 ("Torbjörn Axelsson" "Torbjvrn Axelsson")
161 ("Torbjörn Einarsson" "Torbj.*rn Einarsson")
f39caf44 162 ("Toru Tomabechi" "Toru Tomabechi,")
6b5e47dd 163 ("Tsugutomo Enami" "enami tsugutomo")
f39caf44 164 ("Vincent Del Vecchio" "Vince Del Vecchio")
9109bf49 165 ("William M. Perry" "Bill Perry")
f39caf44 166 ("Wlodzimierz Bzyl" "W.*dek Bzyl")
6b5e47dd
GM
167 ("Yoni Rabkin" "Yoni Rabkin Katzenell")
168 ("Yoshinori Koseki" "KOSEKI Yoshinori" "小関 吉則")
f39caf44 169 ("Yutaka NIIBE" "NIIBE Yutaka")
d5ab63b2 170 )
3215096c
GM
171 "Alist of author aliases.
172
f39caf44 173Each entry is of the form (REALNAME REGEXP...). If an author's name
a1506d29 174matches one of the REGEXPs, use REALNAME instead.
f39caf44 175If REALNAME is nil, ignore that author.")
3215096c 176
eef72fce
GM
177(defconst authors-fixed-case
178 '("Bryan O'Sullivan"
179 "Christian von Roques"
93da04c0 180 "Christophe de Dinechin"
eef72fce
GM
181 "Craig McDaniel"
182 "David J. MacKenzie"
183 "David McCabe"
184 "David O'Toole"
185 "Dominique de Waleffe"
186 "Edward O'Connor"
187 "Exal de Jesus Garcia Carrillo"
188 "Greg McGary"
189 "Hans de Graaff"
190 "James TD Smith"
24e15888 191 "Joel N. Weber II"
eef72fce
GM
192 "Michael McNamara"
193 "Mike McEwan"
6b5e47dd 194 "Nelson Jose dos Santos Ferreira"
eef72fce
GM
195 "Peter von der Ahe"
196 "Peter O'Gorman"
197 "Roland McGrath"
198 "Sean O'Rourke")
199 "List of authors whose names cannot be simply capitalized.")
3215096c 200
0a521885 201(defvar authors-public-domain-files
eef72fce 202 '("emerge\\.el"
0a521885
GM
203 "vi\\.el"
204 "feedmail\\.el"
205 "mailpost\\.el"
206 "hanoi\\.el"
207 "meese\\.el"
208 "studly\\.el"
eef72fce
GM
209 "modula2\\.el"
210 "nnmaildir\\.el"
211 "nnil\\.el"
212 "b2m\\.c"
213 "unexhp9k800\\.c"
214 "emacsclient\\.1"
215 "check-doc-strings")
0a521885
GM
216 "List of regexps matching files for which the FSF doesn't need papers.")
217
218
8a5506f2
GM
219(defvar authors-obsolete-files-regexps
220 '("vc-\\*\\.el$"
221 "spec.txt$"
6b5e47dd 222 ".*loaddefs.el$" ; not obsolete, but auto-generated
fea1add4
GM
223 "\\.\\(cvs\\|git\\)ignore$" ; obsolete or uninteresting
224 "\\.arch-inventory$"
225 "preferences\\.\\(nib\\|gorm\\)"
8a5506f2
GM
226 "vc-\\(rcs\\|cvs\\|sccs\\)-hooks\\.el$")
227 "List of regexps matching obsolete files.
228Changes to files matching one of the regexps in this list are not
229listed.")
230
4ee02020
KS
231(defconst authors-ignored-files
232 '("external-lisp"
233 "lock" "share-lib" "local-lisp"
234 "noleim-Makefile.in"
eef72fce
GM
235 "NEWS" "ORDERS" "PROBLEMS" "FAQ" "AUTHORS" "FOR-RELEASE" "TODO" "todo"
236 "MACHINES" "SERVICE"
237 "README.unicode" "README.multi-tty" "TUTORIAL.translators"
238 "NEWS.unicode" "COPYING.DJ" "Makefile.old" "Makefile.am"
239 "NEWS.1" "OOOOONEWS...OONEWS" "OOOONEWS" "etc/NEWS"
240 "NEWS.1-17" "NEWS.18" "NEWS.19" "NEWS.20" "NEWS.21" "NEWS.22"
6b5e47dd 241 "MAINTAINERS" "MH-E-NEWS"
eef72fce
GM
242 "install-sh" "missing" "mkinstalldirs"
243 "termcap.dat" "termcap.src" "termcap.ucb" "termcap"
244 "ChangeLog.nextstep" "Emacs.clr" "spec.txt"
245 "gfdl.1"
246 "texi/Makefile.in"
247 "Imakefile" "icons/sink.ico" "aixcc.lex"
248 "nxml/char-name/unicode"
1fc28a2c 249 "js2-mode.el" ; only installed very briefly, replaced by js.el
fea1add4
GM
250 "cedet/tests/testtemplates.cpp"
251 "cedet/tests/testusing.cpp"
252 "cedet/tests/scopetest.cpp"
253 "cedet/tests/scopetest.java"
254 "cedet/tests/test.cpp"
255 "cedet/tests/test.py"
256 "cedet/tests/teststruct.cpp"
257 "*.el"
6b5e47dd
GM
258 ;; Autogen:
259 "cus-load.el" "finder-inf.el" "ldefs-boot.el"
eef72fce
GM
260 ;; Never had any meaningful changes logged, now deleted:
261 "split-man" "Xkeymap.txt" "ms-7bkermit" "ulimit.hack"
93da04c0 262 "gnu-hp300" "refcard.bit" "ledit.l" "forms.README" "forms-d2.dat"
eef72fce
GM
263 "CXTERM-DIC/PY.tit" "CXTERM-DIC/ZIRANMA.tit"
264 "CXTERM-DIC/CTLau.tit" "CXTERM-DIC/CTLauB.tit"
265 "NICKLES.WORTH" "INTERVAL.IDEAS" "RCP"
266 "3B-MAXMEM" "AIX.DUMP" "SUN-SUPPORT" "XENIX"
267 "CODINGS" "CHARSETS"
268 "calc/INSTALL" "calc/Makefile"
46e6650e 269 "vms-pp.trans" "_emacs" "batcomp.com" "notes/cpp" ; admin/
c11cc37a 270 "emacsver.texi.in"
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")
4ac0ba71 440;;; ("Guillermo J. Rozas" :wrote "fakemail.c")
d5ab63b2
GM
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")
22bcf204 455 ("Steve Strassmann" :wrote "spook.el")
d5ab63b2 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"
c11cc37a
GM
510 "b2m.c" "b2m.1" "b2m.pl"
511 "emacs.bash" "emacs.csh" "ms-kermit"
93da04c0 512 "emacs.ico"
eef72fce 513 "emacs21.ico"
c11cc37a 514 "BABYL" "LPF" "LEDIT" "OTHER.EMACSES"
eef72fce
GM
515 "emacs16_mac.png" "emacs24_mac.png"
516 "emacs256_mac.png" "emacs32_mac.png"
517 "emacs48_mac.png" "emacs512_mac.png"
fea1add4
GM
518 "revdiff" ; admin/
519 "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/
520 "mac-fix-env.m"
eef72fce
GM
521 ;; Deleted vms stuff:
522 "temacs.opt" "descrip.mms" "compile.com" "link.com"
523 )
fea1add4
GM
524 "File names which are valid, but no longer exist (or cannot be found)
525in the repository.")
f39caf44
KS
526
527(defconst authors-renamed-files-alist
528 '(("nt.c" . "w32.c") ("nt.h" . "w32.h")
529 ("ntheap.c" . "w32heap.c") ("ntheap.h" . "w32heap.h")
530 ("ntinevt.c" . "w32inevt.c") ("ntinevt.h" . "w32inevt.h")
531 ("ntproc.c" . "w32proc.c")
532 ("w32console.c" . "w32term.c")
533 ("unexnt.c" . "unexw32.c")
534 ("s/windowsnt.h" . "s/ms-w32.h")
93da04c0 535 ("winnt.el" . "w32-fns.el")
f39caf44 536 ("config.emacs" . "configure")
93da04c0
GM
537 ("config.h.dist" . "config.in")
538 ("config.h-dist" . "config.in")
539 ("config.h.in" . "config.in")
eef72fce
GM
540 ("paths.h-dist" . "paths.h.in")
541 ("patch1" . "sed1.inp")
f39caf44 542 ("GETTING.GNU.SOFTWARE" . "FTP")
eef72fce
GM
543 ("etc/MACHINES" . "MACHINES")
544 ("ONEWS" . "NEWS.19")
545 ("ONEWS.1" . "NEWS.1-17")
546 ("ONEWS.2" . "NEWS.1-17")
547 ("ONEWS.3" . "NEWS.18")
548 ("ONEWS.4" . "NEWS.18")
549 ("ORDERS.USA" . "ORDERS")
550 ("EUROPE" . "ORDERS")
551 ("DIFF" . "OTHER.EMACSES")
552 ("CCADIFF" . "OTHER.EMACSES")
553 ("GOSDIFF" . "OTHER.EMACSES")
554 ("Makefile.in.in" . "Makefile.in")
4ee02020
KS
555 ("leim-Makefile" . "leim/Makefile")
556 ("leim-Makefile.in" . "leim/Makefile.in")
92158bc3
KS
557 ("emacs-lisp/testcover-ses.el" . "tcover-ses.el")
558 ("emacs-lisp/testcover-unsafep.el" . "tcover-unsafep.el")
6b5e47dd
GM
559 ;; index and pick merged into search.
560 ("mh-index.el" . "mh-search.el")
561 ("mh-pick.el" . "mh-search.el")
fea1add4 562 ("font-setting.el" . "dynamic-setting.el")
b788a98d
GM
563 ;; INSTALL-CVS -> .CVS -> .BZR
564 ("INSTALL-CVS" . "INSTALL.BZR")
565 ("INSTALL.CVS" . "INSTALL.BZR")
eef72fce
GM
566 ("refcards/fr-drdref.pdf" . "refcards/fr-dired-ref.pdf")
567 ("gnus-logo.eps" . "refcards/gnus-logo.eps")
568 ("build-install" . "build-ins.in")
569 ("build-install.in" . "build-ins.in")
570 ("unidata/Makefile" . "unidata/Makefile.in")
571 ;; Not renamed, but we only have the latter in the Emacs repo.
572 ("trampver.texi.in" . "trampver.texi")
573 ("e/eterm" . "e/eterm-color")
574 ("e/eterm.ti" . "e/eterm-color.ti")
575 ("README.txt" . "README")
576 ("emacs.names" . "JOKES")
577 ("ED.WORSHIP" . "JOKES")
578 ("GNU.JOKES" . "JOKES")
579 ("CHARACTERS" . "TODO")
580 ("schema/xhtml-basic-form.rnc" . "schema/xhtml-bform.rnc" )
581 ("schema/xhtml-basic-table.rnc" . "schema/xhtml-btable.rnc")
582 ("schema/xhtml-list.rnc" . "schema/xhtml-lst.rnc")
583 ("schema/xhtml-target.rnc" . "schema/xhtml-tgt.rnc")
584 ("schema/xhtml-style.rnc" . "schema/xhtml-xstyle.rnc")
585 ("schema/docbook-dyntbl.rnc" . "schema/docbk-dyntbl.rnc")
586 ("schema/docbook-soextbl.rnc" . "schema/docbk-soextbl.rn" )
587 ("texi/url.txi" . "url.texi")
fea1add4 588 ("edt-user.doc" . "edt.texi")
c11cc37a 589 ("DEV-NOTES" . "nextstep")
eef72fce
GM
590 ;; Moved to different directories.
591 ("ctags.1" . "ctags.1")
592 ("etags.1" . "etags.1")
593 ("emacs.1" . "emacs.1")
594 ("emacsclient.1" . "emacsclient.1")
595 ("icons/emacs21.ico" . "emacs21.ico")
c11cc37a
GM
596 ;; Moved from admin/nt/ to nt/.
597 ("nt/README.W32" . "README.W32")
f39caf44
KS
598 )
599 "Alist of files which have been renamed during their lifetime.
600Elements are (OLDNAME . NEWNAME).")
601
602(defconst authors-renamed-files-regexps
603 '(("^m/m-\\(.*\\.h\\)$" . "m/\\1")
604 ("^m-\\(.*\\.h\\)$" . "\\1")
605 ("^s/s-\\(.*\\.h\\)$" . "s/\\1")
606 ("^s-\\(.*\\.h\\)$" . "\\1")
607 ("^s/[-.a-zA-Z0-9_]+\\.h$" . t)
608 ("\\(.*\\)\\.cmd$" . "\\1.bat")
609 ("\\.bat$" . t)
610 ("\\.[ch]$" . t)
611 ("\\.el$" . t)
612 ("\\.ps$" . t)
613 ("\\.texi?$" . t)
614 ("\\.texinfo$" . t)
615 ("\\.xml?$" . t)
616 ("\\.x[pb]m$" . t)
617 ("\\.[xp]bm$" . t)
618 ("^paths\\." . t)
619 ("^install\\." . t)
eef72fce
GM
620 ("^\\(TUTORIAL[^/]*\\)" . "tutorials/\\1")
621 ("^\\(tree-widget/\\(?:default\\|folder\\)/[-a-z]+\\.png\\)$" .
622 "images/\\1")
623 ("^\\(images/icons/\\)mac\\(emacs\\)_\\([0-9]+\\)\\(\\.png\\)" .
624 "\\1\\2\\3_mac\\4")
625 ("\\(images/icons/\\)emacs_\\([0-9][0-9]\\)\\.png" .
626 "\\1hicolor/\\2x\\2/apps/emacs.png")
f39caf44
KS
627 )
628 "List regexps and rewriting rules for renamed files.
629Elements are (REGEXP . REPLACE). If REPLACE is a string, the file
630name matching REGEXP is replaced by REPLACE using `replace-string'.
631Otherwise, the file name is accepted as is.")
632
633(defvar authors-checked-files-alist)
634(defvar authors-invalid-file-names)
635
fea1add4
GM
636(defun authors-disambiguate-file-name (fullname)
637 "Convert FULLNAME to an unambiguous relative-name."
638 (let ((relname (file-name-nondirectory fullname))
639 parent)
640 (if (member relname authors-ambiguous-files)
641 ;; In case of ambiguity, just prepend the parent directory.
642 ;; FIXME obviously this is not a perfect solution.
643 (if (string-equal "lisp"
644 (setq parent (file-name-nondirectory
645 (directory-file-name
646 (file-name-directory fullname)))))
647 relname
648 (format "%s/%s" parent relname))
649 relname)))
650
f39caf44 651(defun authors-canonical-file-name (file log-file pos author)
6b5e47dd 652 "Return canonical file name for FILE found in LOG-FILE.
f39caf44 653Checks whether FILE is a valid (existing) file name, has been renamed,
fea1add4 654or is on the list of removed files. Returns the non-directory part of
6b5e47dd
GM
655the file name. Only uses the LOG-FILE position POS and associated AUTHOR
656to print a message if FILE is not found."
93da04c0
GM
657 ;; FILE should be re-checked in every different directory associated
658 ;; with a LOG-FILE. Eg configure.in from src/ChangeLog is not the
659 ;; same as that from top-level/ChangeLog.
660 (let* ((fullname (expand-file-name file (file-name-directory log-file)))
661 (entry (assoc fullname authors-checked-files-alist))
662 relname
663 valid)
f39caf44
KS
664 (if entry
665 (cdr entry)
666 (setq relname (file-name-nondirectory file))
667 (if (or (member relname authors-valid-file-names)
668 (file-exists-p file)
669 (file-exists-p relname)
670 (file-exists-p (concat "etc/" relname)))
fea1add4 671 (setq valid (authors-disambiguate-file-name fullname))
f39caf44
KS
672 (setq valid (assoc file authors-renamed-files-alist))
673 (if valid
674 (setq valid (cdr valid))
675 (let ((rules authors-renamed-files-regexps))
676 (while rules
677 (if (string-match (car (car rules)) file)
678 (setq valid (if (stringp (cdr (car rules)))
679 (file-name-nondirectory
680 (replace-match (cdr (car rules)) t nil file))
681 relname)
682 rules nil))
683 (setq rules (cdr rules))))))
684 (setq authors-checked-files-alist
93da04c0 685 (cons (cons fullname valid) authors-checked-files-alist))
9109bf49 686 (unless (or valid
eef72fce 687 (member file authors-ignored-files)
fea1add4 688 (authors-obsolete-file-p file)
9109bf49
KS
689 (string-match "[*]" file)
690 (string-match "^[0-9.]+$" file))
a1506d29 691 (setq authors-invalid-file-names
f39caf44
KS
692 (cons (format "%s:%d: unrecognized `%s' for %s"
693 log-file
694 (1+ (count-lines (point-min) pos))
695 file author)
696 authors-invalid-file-names)))
697 valid)))
698
d5ab63b2
GM
699(defun authors-add-fixed-entries (table)
700 "Add actions from `authors-fixed-entries' to TABLE."
701 (dolist (entry authors-fixed-entries)
702 (let ((author (car entry))
703 action)
704 (dolist (item (cdr entry))
705 (if (symbolp item)
706 (setq action item)
707 (authors-add author item action table))))))
708
3932b29a 709
8a5506f2
GM
710(defun authors-obsolete-file-p (file)
711 "Return non-nil if FILE is obsolete.
3932b29a 712FILE is considered obsolete if it matches one of the regular expressions
8a5506f2
GM
713from `authors-obsolete-files-regexps'."
714 (let (obsolete-p
715 (regexps authors-obsolete-files-regexps))
716 (while (and regexps (not obsolete-p))
717 (setq obsolete-p (string-match (car regexps) file)
718 regexps (cdr regexps)))
719 obsolete-p))
720
721
3215096c
GM
722(defun authors-add (author file action table)
723 "Record that AUTHOR worked on FILE.
724ACTION is a keyword symbol describing what he did. Record file,
725author and what he did in hash table TABLE. See the description of
726`authors-scan-change-log' for the structure of the hash table."
4ee02020
KS
727 (unless (or (member file authors-ignored-files)
728 (authors-obsolete-file-p file)
9c1af546 729 (equal author ""))
8a5506f2 730 (let* ((value (gethash author table))
f39caf44
KS
731 (entry (assoc file value))
732 slot)
8a5506f2 733 (if (null entry)
f39caf44
KS
734 (puthash author (cons (list file (cons action 1)) value) table)
735 (if (setq slot (assoc action (cdr entry)))
736 (setcdr slot (1+ (cdr slot)))
737 (nconc entry (list (cons action 1))))))))
3215096c
GM
738
739
3215096c
GM
740(defun authors-canonical-author-name (author)
741 "Return a canonicalized form of AUTHOR, an author name.
eef72fce
GM
742If AUTHOR has an entry in `authors-aliases', use that. Remove
743email addresses. Capitalize words in the author's name, unless
744it is found in `authors-fixed-case'."
f39caf44
KS
745 (let* ((aliases authors-aliases)
746 regexps realname)
3215096c 747 (while aliases
f39caf44
KS
748 (setq realname (car (car aliases))
749 regexps (cdr (car aliases))
750 aliases (cdr aliases))
751 (while regexps
752 (if (string-match (car regexps) author)
753 (setq author realname
754 regexps nil
755 aliases nil)
756 (setq regexps (cdr regexps))))))
757 (when author
758 (setq author (replace-regexp-in-string "[ \t]*[(<].*$" "" author))
d0f483e8 759 (setq author (replace-regexp-in-string "\`[ \t]+" "" author))
f39caf44 760 (setq author (replace-regexp-in-string "[ \t]+$" "" author))
d0f483e8
KS
761 (setq author (replace-regexp-in-string "[ \t]+" " " author))
762 (unless (string-match "[-, \t]" author)
763 (setq author ""))
eef72fce
GM
764 (or (car (member author authors-fixed-case))
765 (capitalize author))))
f39caf44 766
f39caf44
KS
767(defun authors-scan-change-log (log-file table)
768 "Scan change log LOG-FILE for author information.
3215096c
GM
769
770For each change mentioned in the log, add an entry to hash table TABLE
771under the author's canonical name.
772
773Keys of TABLE are author names. Values are alists of entries (FILE
f39caf44
KS
774\(ACTION . COUNT) ...). FILE is one file the author worked on. The
775rest of the entry is a list of keyword symbols describing what he did
2603d79b 776with the file and the number of each action:
3215096c
GM
777
778:wrote means the author wrote the file
2603d79b 779:cowrote means he wrote the file in collaboration with others
f39caf44 780:changed means he changed the file COUNT times."
3932b29a 781
2603d79b 782 (let* ((enable-local-variables :safe) ; for find-file, hence let*
68013cfa 783 (enable-local-eval nil)
f39caf44
KS
784 (existing-buffer (get-file-buffer log-file))
785 (buffer (find-file-noselect log-file))
6b5e47dd 786 authors file pos)
9a529312 787 (with-current-buffer buffer
3215096c
GM
788 (save-restriction
789 (widen)
790 (goto-char (point-min))
791 (while (re-search-forward "^[0-9]\\|^[ \t]+\\* " nil t)
792 (beginning-of-line)
f39caf44 793 (setq pos (point))
3215096c 794 (cond ((looking-at "^[0-9]+-[0-9]+-[0-9]+")
6b5e47dd
GM
795 ;; Handle joint authorship of changes.
796 ;; This can be a bit fragile, and is not too common.
797 (setq authors nil)
798 (while (progn
799 (skip-chars-forward " \t+:0-9-")
800 (not (looking-at "\\($\\|\\*\\|\
801Suggested\\|Trivial\\|Version\\|Originally\\|From:\\|Patch[ \t]+[Bb]y\\)")))
802 (push (authors-canonical-author-name
803 (buffer-substring-no-properties
804 (point) (line-end-position))) authors)
805 (forward-line 1)))
3215096c
GM
806 ((looking-at "^[ \t]+\\*")
807 (let ((line (buffer-substring-no-properties
808 (match-end 0) (line-end-position))))
809 (while (and (not (string-match ":" line))
810 (forward-line 1)
811 (not (looking-at ":\\|^[ \t]*$")))
812 (setq line (concat line
813 (buffer-substring-no-properties
814 (line-beginning-position)
815 (line-end-position)))))
816 (when (string-match ":" line)
817 (setq line (substring line 0 (match-beginning 0)))
818 (setq line (replace-regexp-in-string "[[(<{].*$" "" line))
819 (setq line (replace-regexp-in-string "," "" line))
820 (dolist (file (split-string line))
6b5e47dd
GM
821 (when (setq file (authors-canonical-file-name file log-file pos (car authors)))
822 (dolist (author authors)
823 ;;(message "%s changed %s" author file)
824 (authors-add author file :changed table)))))
3215096c
GM
825 (forward-line 1)))))))
826 (unless existing-buffer
827 (kill-buffer buffer))))
828
829
830(defun authors-scan-el (file table)
831 "Scan Lisp file FILE for author information.
832TABLE is a hash table to add author information to."
2603d79b
GM
833 (let* ((existing-buffer (get-file-buffer file))
834 (enable-local-variables :safe) ; for find-file, hence let*
835 (enable-local-eval nil)
836 (buffer (find-file-noselect file)))
fea1add4 837 (setq file (authors-disambiguate-file-name (expand-file-name file)))
9a529312 838 (with-current-buffer buffer
3215096c
GM
839 (save-restriction
840 (widen)
841 (goto-char (point-min))
842 (while (and (re-search-forward
93da04c0
GM
843 "^;+[ \t]*\\(Authors?\\|Commentary\\|Code\\):[ \t]*" nil t)
844 (not (member (match-string 1) '("Commentary" "Code"))))
845 (let ((continue t)
846 (action :wrote)
847 authors)
848 (while continue
849 ;; Some entries contain a year range in front of the
850 ;; author's name.
851 (skip-chars-forward "-0-9 \t")
852 (push (authors-canonical-author-name
853 (buffer-substring-no-properties
854 (point) (line-end-position))) authors)
855 ;; tips.texi says the continuation line should begin
856 ;; with a tab, but often spaces are used.
857 (setq continue
858 (and (zerop (forward-line 1))
859 (looking-at ";;;?\\(\t+ *\\| +\\)[[:alnum:]]")
860 (goto-char (1- (match-end 0)))
861 (not (looking-at "[[:upper:]][-[:alpha:]]+:[ \t]")))))
862 (and (> (length authors) 1)
863 (setq action :cowrote))
864 (mapc (lambda (author)
865 (authors-add author file action table))
866 authors)))))
3215096c
GM
867 (unless existing-buffer
868 (kill-buffer buffer))))
869
870
0a521885
GM
871(defun authors-public-domain-p (file)
872 "Return t if FILE is a file that was put in public domain."
873 (let ((public-domain-p nil)
874 (list authors-public-domain-files))
875 (while (and list (not public-domain-p))
876 (when (string-match (car list) file)
877 (setq public-domain-p t))
878 (setq list (cdr list)))
879 public-domain-p))
880
f39caf44
KS
881(defvar authors-author-list)
882
883(defun authors-add-to-author-list (author changes)
884 "Insert information about AUTHOR's work on Emacs into `authors-author-list'.
885CHANGES is an alist of entries (FILE (ACTION . COUNT) ...), as produced by
886`authors-scan-change-log'.
93da04c0
GM
887The element added to `authors-author-list' is (AUTHOR WROTE CO-WROTE CHANGED),
888where WROTE, CO-WROTE, and CHANGED are lists of the files written, co-written
889and changed by AUTHOR."
f39caf44
KS
890 (when author
891 (let ((nchanged 0)
892 wrote-list
93da04c0 893 cowrote-list
f39caf44 894 changed-list)
3215096c 895 (dolist (change changes)
93da04c0
GM
896 (let* ((actions (cdr change))
897 (file (car change))
898 (filestat (if (authors-public-domain-p file)
899 (concat file " (public domain)")
900 file))
901 slot)
902 (cond ((assq :wrote actions)
903 (setq wrote-list (cons filestat wrote-list)))
904 ((assq :cowrote actions)
905 (setq cowrote-list (cons filestat cowrote-list)))
906 (t
907 (setq changed-list
908 (cons (cons file (cdr (assq :changed actions)))
909 changed-list))))))
f39caf44
KS
910 (if wrote-list
911 (setq wrote-list (sort wrote-list 'string-lessp)))
93da04c0
GM
912 (if cowrote-list
913 (setq cowrote-list (sort cowrote-list 'string-lessp)))
f39caf44
KS
914 (when changed-list
915 (setq changed-list (sort changed-list
916 (lambda (a b)
917 (if (= (cdr a) (cdr b))
918 (string-lessp (car a) (car b))
919 (> (cdr a) (cdr b))))))
920 (setq nchanged (length changed-list))
921 (setq changed-list (mapcar 'car changed-list)))
922 (if (> (- nchanged authors-many-files) 2)
923 (setcdr (nthcdr authors-many-files changed-list)
924 (list (format "and %d other files" (- nchanged authors-many-files)))))
925 (setq authors-author-list
93da04c0 926 (cons (list author wrote-list cowrote-list changed-list)
f39caf44 927 authors-author-list)))))
3215096c 928
3215096c
GM
929(defun authors (root)
930 "Extract author information from change logs and Lisp source files.
931ROOT is the root directory under which to find the files. If called
a1506d29 932interactively, ROOT is read from the minibuffer.
f39caf44
KS
933Result is a buffer *Authors* containing authorship information, and a
934buffer *Authors Errors* containing references to unknown files."
3215096c 935 (interactive "DEmacs source directory: ")
d2f288c6 936 (setq root (expand-file-name root))
c7efbb12 937 (let ((logs (process-lines find-program root "-name" "ChangeLog*"))
3215096c 938 (table (make-hash-table :test 'equal))
f39caf44
KS
939 (buffer-name "*Authors*")
940 authors-checked-files-alist
941 authors-invalid-file-names)
621af279
DK
942 (authors-add-fixed-entries table)
943 (unless (file-exists-p (expand-file-name "src/emacs.c" root))
be3f421b
RS
944 (unless (y-or-n-p
945 (format "Not the root directory of Emacs: %s, continue? " root))
5a0c3f56 946 (error "Not the root directory")))
3215096c 947 (dolist (log logs)
77777daf 948 (when (string-match "ChangeLog\\(.[0-9]+\\)?$" log)
3215096c
GM
949 (message "Scanning %s..." log)
950 (authors-scan-change-log log table)))
c7efbb12 951 (let ((els (process-lines find-program root "-name" "*.el")))
3215096c
GM
952 (dolist (file els)
953 (message "Scanning %s..." file)
954 (authors-scan-el file table)))
f39caf44 955 (message "Generating buffer %s..." buffer-name)
3215096c
GM
956 (set-buffer (get-buffer-create buffer-name))
957 (erase-buffer)
f39caf44 958 (set-buffer-file-coding-system authors-coding-system)
a1506d29 959 (insert
f39caf44
KS
960"Many people have contributed code included in the Free Software
961Foundation's distribution of GNU Emacs. To show our appreciation for
962their public spirit, we list here in alphabetical order a condensed
963list of their contributions.\n")
964 (let (authors-author-list a)
965 (maphash #'authors-add-to-author-list table)
a1506d29 966 (setq authors-author-list
f39caf44
KS
967 (sort authors-author-list
968 (lambda (a b) (string-lessp (car a) (car b)))))
969 (dolist (a authors-author-list)
970 (let ((author (car a))
971 (wrote (nth 1 a))
93da04c0
GM
972 (cowrote (nth 2 a))
973 (changed (nth 3 a))
f39caf44
KS
974 file)
975 (insert "\n" author ": ")
976 (when wrote
977 (insert "wrote")
978 (dolist (file wrote)
979 (if (> (+ (current-column) (length file)) 72)
980 (insert "\n "))
981 (insert " " file))
982 (insert "\n"))
93da04c0 983 (when cowrote
f39caf44
KS
984 (if wrote
985 (insert "and "))
93da04c0
GM
986 (insert "co-wrote")
987 (dolist (file cowrote)
988 (if (> (+ (current-column) (length file)) 72)
989 (insert "\n "))
990 (insert " " file))
991 (insert "\n"))
992 (when changed
993 (if (or wrote cowrote)
994 (insert "and "))
f39caf44
KS
995 (insert "changed")
996 (dolist (file changed)
997 (if (> (+ (current-column) (length file)) 72)
998 (insert "\n "))
999 (insert " " file))
1000 (insert "\n")))))
a1506d29 1001 (insert "\nLocal" " Variables:\ncoding: "
f39caf44
KS
1002 (symbol-name authors-coding-system) "\nEnd:\n")
1003 (message "Generating buffer %s... done" buffer-name)
d5ab63b2 1004 (unless noninteractive
f39caf44
KS
1005 (when authors-invalid-file-names
1006 (with-current-buffer (get-buffer-create "*Authors Errors*")
eef72fce 1007 (setq buffer-read-only nil)
f39caf44
KS
1008 (erase-buffer)
1009 (set-buffer-file-coding-system authors-coding-system)
1010 (insert "Unrecognized file entries found:\n\n")
0c8b414f
JB
1011 (mapc (lambda (f) (if (not (string-match "^[A-Za-z]+$" f)) (insert f "\n")))
1012 (sort authors-invalid-file-names 'string-lessp))
f39caf44
KS
1013 (goto-char (point-min))
1014 (compilation-mode)
1015 (message "Errors were found. See buffer %s" (buffer-name))))
d5ab63b2
GM
1016 (pop-to-buffer buffer-name))))
1017
1018
d5ab63b2
GM
1019(defun batch-update-authors ()
1020 "Produce an AUTHORS file.
1021Call this function in batch mode with two command line arguments FILE
1022and ROOT. FILE is the file to write, ROOT is the root directory of
1023the Emacs source tree, from which to build the file."
1024 (unless noninteractive
1025 (error "`batch-update-authors' is to be used only with -batch"))
1026 (when (/= (length command-line-args-left) 2)
1027 (error "Call `batch-update-authors' with the name of the file to write"))
8e13db77
EZ
1028 (let* ((file (pop command-line-args-left))
1029 (root (pop command-line-args-left)))
d5ab63b2
GM
1030 (authors root)
1031 (write-file file)))
3215096c 1032
c420eb36
GM
1033(provide 'authors)
1034
55535639 1035;;; authors.el ends here