comparison lisp/emacs-lisp/authors.el @ 108095:5d8908130ff2

Minor authors.el updates. * emacs-lisp/authors.el (authors-obsolete-files-regexps): Ignore VCS-ignore files, and deleted nextstep preferences files. (authors-ignored-files): Ignore deleted cedet test files, and "*.el". (authors-ambiguous-files): New list. (authors-valid-file-names): Add some deleted files. (authors-renamed-files-alist): Add font-setting.el, edt-user.doc. (authors-disambiguate-file-name): New function. (Bug#5501) (authors-canonical-file-name): Doc fix. Don't warn about obsolete files. (authors-canonical-file-name, authors-scan-el): Use authors-disambiguate-file-name.
author Glenn Morris <rgm@gnu.org>
date Fri, 23 Apr 2010 19:16:13 -0700
parents ff4ed96c4bfa
children 9e4a56f788ec
comparison
equal deleted inserted replaced
108094:7a80cd5e5722 108095:5d8908130ff2
218 218
219 (defvar authors-obsolete-files-regexps 219 (defvar authors-obsolete-files-regexps
220 '("vc-\\*\\.el$" 220 '("vc-\\*\\.el$"
221 "spec.txt$" 221 "spec.txt$"
222 ".*loaddefs.el$" ; not obsolete, but auto-generated 222 ".*loaddefs.el$" ; not obsolete, but auto-generated
223 "\\.\\(cvs\\|git\\)ignore$" ; obsolete or uninteresting
224 "\\.arch-inventory$"
225 "preferences\\.\\(nib\\|gorm\\)"
223 "vc-\\(rcs\\|cvs\\|sccs\\)-hooks\\.el$") 226 "vc-\\(rcs\\|cvs\\|sccs\\)-hooks\\.el$")
224 "List of regexps matching obsolete files. 227 "List of regexps matching obsolete files.
225 Changes to files matching one of the regexps in this list are not 228 Changes to files matching one of the regexps in this list are not
226 listed.") 229 listed.")
227 230
242 "gfdl.1" 245 "gfdl.1"
243 "texi/Makefile.in" 246 "texi/Makefile.in"
244 "Imakefile" "icons/sink.ico" "aixcc.lex" 247 "Imakefile" "icons/sink.ico" "aixcc.lex"
245 "nxml/char-name/unicode" 248 "nxml/char-name/unicode"
246 "js2-mode.el" ; only installed very briefly, replaced by js.el 249 "js2-mode.el" ; only installed very briefly, replaced by js.el
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"
247 ;; Autogen: 258 ;; Autogen:
248 "cus-load.el" "finder-inf.el" "ldefs-boot.el" 259 "cus-load.el" "finder-inf.el" "ldefs-boot.el"
249 ;; Never had any meaningful changes logged, now deleted: 260 ;; Never had any meaningful changes logged, now deleted:
250 "split-man" "Xkeymap.txt" "ms-7bkermit" "ulimit.hack" 261 "split-man" "Xkeymap.txt" "ms-7bkermit" "ulimit.hack"
251 "gnu-hp300" "refcard.bit" "ledit.l" "forms.README" "forms-d2.dat" 262 "gnu-hp300" "refcard.bit" "ledit.l" "forms.README" "forms-d2.dat"
283 "debian/scripts/startup.erc" 294 "debian/scripts/startup.erc"
284 "debian/scripts/startup.erc-speak" 295 "debian/scripts/startup.erc-speak"
285 ) 296 )
286 "List of files and directories to ignore. 297 "List of files and directories to ignore.
287 Changes to files in this list are not listed.") 298 Changes to files in this list are not listed.")
299
300 ;; List via: find . -name '*.el' | sed 's/.*\///g' | sort | uniq -d
301 ;; FIXME It would be better to discover these dynamically.
302 ;; Note that traditionally "Makefile.in" etc have not been in this list.
303 ;; Ditto for "abbrev.texi" etc.
304 (defconst authors-ambiguous-files
305 '("chart.el"
306 "compile.el"
307 "complete.el"
308 "cpp.el"
309 "ctxt.el"
310 "debug.el"
311 "dired.el"
312 "el.el"
313 "files.el"
314 "find.el"
315 "format.el"
316 "grep.el"
317 "imenu.el"
318 "java.el"
319 "linux.el"
320 "locate.el"
321 "make.el"
322 "mode.el"
323 "python.el"
324 "semantic.el"
325 "shell.el"
326 "simple.el"
327 "sort.el"
328 "speedbar.el"
329 "srecode.el"
330 "table.el"
331 "texi.el"
332 "util.el"
333 "wisent.el")
334 "List of basenames occurring more than once in the source.")
288 335
289 ;; FIXME :cowrote entries here can be overwritten by :wrote entries 336 ;; FIXME :cowrote entries here can be overwritten by :wrote entries
290 ;; derived from a file's Author: header (eg mh-e). This really means 337 ;; derived from a file's Author: header (eg mh-e). This really means
291 ;; the Author: header is erroneous. 338 ;; the Author: header is erroneous.
292 (defconst authors-fixed-entries 339 (defconst authors-fixed-entries
462 "emacs21.ico" 509 "emacs21.ico"
463 "LPF" "LEDIT" "OTHER.EMACSES" 510 "LPF" "LEDIT" "OTHER.EMACSES"
464 "emacs16_mac.png" "emacs24_mac.png" 511 "emacs16_mac.png" "emacs24_mac.png"
465 "emacs256_mac.png" "emacs32_mac.png" 512 "emacs256_mac.png" "emacs32_mac.png"
466 "emacs48_mac.png" "emacs512_mac.png" 513 "emacs48_mac.png" "emacs512_mac.png"
514 "revdiff" ; admin/
515 "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/
516 "mac-fix-env.m"
467 ;; Deleted vms stuff: 517 ;; Deleted vms stuff:
468 "temacs.opt" "descrip.mms" "compile.com" "link.com" 518 "temacs.opt" "descrip.mms" "compile.com" "link.com"
469 ) 519 )
470 "File names which are valid, but no longer exist (or cannot be 520 "File names which are valid, but no longer exist (or cannot be found)
471 found) in the repository.") 521 in the repository.")
472 522
473 (defconst authors-renamed-files-alist 523 (defconst authors-renamed-files-alist
474 '(("nt.c" . "w32.c") ("nt.h" . "w32.h") 524 '(("nt.c" . "w32.c") ("nt.h" . "w32.h")
475 ("ntheap.c" . "w32heap.c") ("ntheap.h" . "w32heap.h") 525 ("ntheap.c" . "w32heap.c") ("ntheap.h" . "w32heap.h")
476 ("ntinevt.c" . "w32inevt.c") ("ntinevt.h" . "w32inevt.h") 526 ("ntinevt.c" . "w32inevt.c") ("ntinevt.h" . "w32inevt.h")
503 ("emacs-lisp/testcover-ses.el" . "tcover-ses.el") 553 ("emacs-lisp/testcover-ses.el" . "tcover-ses.el")
504 ("emacs-lisp/testcover-unsafep.el" . "tcover-unsafep.el") 554 ("emacs-lisp/testcover-unsafep.el" . "tcover-unsafep.el")
505 ;; index and pick merged into search. 555 ;; index and pick merged into search.
506 ("mh-index.el" . "mh-search.el") 556 ("mh-index.el" . "mh-search.el")
507 ("mh-pick.el" . "mh-search.el") 557 ("mh-pick.el" . "mh-search.el")
558 ("font-setting.el" . "dynamic-setting.el")
508 ;; INSTALL-CVS -> .CVS -> .BZR 559 ;; INSTALL-CVS -> .CVS -> .BZR
509 ("INSTALL-CVS" . "INSTALL.BZR") 560 ("INSTALL-CVS" . "INSTALL.BZR")
510 ("INSTALL.CVS" . "INSTALL.BZR") 561 ("INSTALL.CVS" . "INSTALL.BZR")
511 ("refcards/fr-drdref.pdf" . "refcards/fr-dired-ref.pdf") 562 ("refcards/fr-drdref.pdf" . "refcards/fr-dired-ref.pdf")
512 ("gnus-logo.eps" . "refcards/gnus-logo.eps") 563 ("gnus-logo.eps" . "refcards/gnus-logo.eps")
528 ("schema/xhtml-target.rnc" . "schema/xhtml-tgt.rnc") 579 ("schema/xhtml-target.rnc" . "schema/xhtml-tgt.rnc")
529 ("schema/xhtml-style.rnc" . "schema/xhtml-xstyle.rnc") 580 ("schema/xhtml-style.rnc" . "schema/xhtml-xstyle.rnc")
530 ("schema/docbook-dyntbl.rnc" . "schema/docbk-dyntbl.rnc") 581 ("schema/docbook-dyntbl.rnc" . "schema/docbk-dyntbl.rnc")
531 ("schema/docbook-soextbl.rnc" . "schema/docbk-soextbl.rn" ) 582 ("schema/docbook-soextbl.rnc" . "schema/docbk-soextbl.rn" )
532 ("texi/url.txi" . "url.texi") 583 ("texi/url.txi" . "url.texi")
584 ("edt-user.doc" . "edt.texi")
533 ;; Moved to different directories. 585 ;; Moved to different directories.
534 ("ctags.1" . "ctags.1") 586 ("ctags.1" . "ctags.1")
535 ("etags.1" . "etags.1") 587 ("etags.1" . "etags.1")
536 ("emacs.1" . "emacs.1") 588 ("emacs.1" . "emacs.1")
537 ("emacsclient.1" . "emacsclient.1") 589 ("emacsclient.1" . "emacsclient.1")
572 Otherwise, the file name is accepted as is.") 624 Otherwise, the file name is accepted as is.")
573 625
574 (defvar authors-checked-files-alist) 626 (defvar authors-checked-files-alist)
575 (defvar authors-invalid-file-names) 627 (defvar authors-invalid-file-names)
576 628
629 (defun authors-disambiguate-file-name (fullname)
630 "Convert FULLNAME to an unambiguous relative-name."
631 (let ((relname (file-name-nondirectory fullname))
632 parent)
633 (if (member relname authors-ambiguous-files)
634 ;; In case of ambiguity, just prepend the parent directory.
635 ;; FIXME obviously this is not a perfect solution.
636 (if (string-equal "lisp"
637 (setq parent (file-name-nondirectory
638 (directory-file-name
639 (file-name-directory fullname)))))
640 relname
641 (format "%s/%s" parent relname))
642 relname)))
643
577 (defun authors-canonical-file-name (file log-file pos author) 644 (defun authors-canonical-file-name (file log-file pos author)
578 "Return canonical file name for FILE found in LOG-FILE. 645 "Return canonical file name for FILE found in LOG-FILE.
579 Checks whether FILE is a valid (existing) file name, has been renamed, 646 Checks whether FILE is a valid (existing) file name, has been renamed,
580 or is on the list of removed files. Returns the non-diretory part of 647 or is on the list of removed files. Returns the non-directory part of
581 the file name. Only uses the LOG-FILE position POS and associated AUTHOR 648 the file name. Only uses the LOG-FILE position POS and associated AUTHOR
582 to print a message if FILE is not found." 649 to print a message if FILE is not found."
583 ;; FILE should be re-checked in every different directory associated 650 ;; FILE should be re-checked in every different directory associated
584 ;; with a LOG-FILE. Eg configure.in from src/ChangeLog is not the 651 ;; with a LOG-FILE. Eg configure.in from src/ChangeLog is not the
585 ;; same as that from top-level/ChangeLog. 652 ;; same as that from top-level/ChangeLog.
592 (setq relname (file-name-nondirectory file)) 659 (setq relname (file-name-nondirectory file))
593 (if (or (member relname authors-valid-file-names) 660 (if (or (member relname authors-valid-file-names)
594 (file-exists-p file) 661 (file-exists-p file)
595 (file-exists-p relname) 662 (file-exists-p relname)
596 (file-exists-p (concat "etc/" relname))) 663 (file-exists-p (concat "etc/" relname)))
597 (setq valid relname) 664 (setq valid (authors-disambiguate-file-name fullname))
598 (setq valid (assoc file authors-renamed-files-alist)) 665 (setq valid (assoc file authors-renamed-files-alist))
599 (if valid 666 (if valid
600 (setq valid (cdr valid)) 667 (setq valid (cdr valid))
601 (let ((rules authors-renamed-files-regexps)) 668 (let ((rules authors-renamed-files-regexps))
602 (while rules 669 (while rules
609 (setq rules (cdr rules)))))) 676 (setq rules (cdr rules))))))
610 (setq authors-checked-files-alist 677 (setq authors-checked-files-alist
611 (cons (cons fullname valid) authors-checked-files-alist)) 678 (cons (cons fullname valid) authors-checked-files-alist))
612 (unless (or valid 679 (unless (or valid
613 (member file authors-ignored-files) 680 (member file authors-ignored-files)
681 (authors-obsolete-file-p file)
614 (string-match "[*]" file) 682 (string-match "[*]" file)
615 (string-match "^[0-9.]+$" file)) 683 (string-match "^[0-9.]+$" file))
616 (setq authors-invalid-file-names 684 (setq authors-invalid-file-names
617 (cons (format "%s:%d: unrecognized `%s' for %s" 685 (cons (format "%s:%d: unrecognized `%s' for %s"
618 log-file 686 log-file
757 TABLE is a hash table to add author information to." 825 TABLE is a hash table to add author information to."
758 (let* ((existing-buffer (get-file-buffer file)) 826 (let* ((existing-buffer (get-file-buffer file))
759 (enable-local-variables :safe) ; for find-file, hence let* 827 (enable-local-variables :safe) ; for find-file, hence let*
760 (enable-local-eval nil) 828 (enable-local-eval nil)
761 (buffer (find-file-noselect file))) 829 (buffer (find-file-noselect file)))
762 (setq file (file-name-nondirectory file)) 830 (setq file (authors-disambiguate-file-name (expand-file-name file)))
763 (with-current-buffer buffer 831 (with-current-buffer buffer
764 (save-restriction 832 (save-restriction
765 (widen) 833 (widen)
766 (goto-char (point-min)) 834 (goto-char (point-min))
767 (while (and (re-search-forward 835 (while (and (re-search-forward