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