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