comparison lisp/emacs-lisp/authors.el @ 91204:53108e6cea98

Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-294
author Miles Bader <miles@gnu.org>
date Thu, 06 Dec 2007 09:51:45 +0000
parents 880960b70474 5b6b3d2be3dd
children 606f2d163a64
comparison
equal deleted inserted replaced
91203:db40129142b2 91204:53108e6cea98
416 (if (setq slot (assoc action (cdr entry))) 416 (if (setq slot (assoc action (cdr entry)))
417 (setcdr slot (1+ (cdr slot))) 417 (setcdr slot (1+ (cdr slot)))
418 (nconc entry (list (cons action 1)))))))) 418 (nconc entry (list (cons action 1))))))))
419 419
420 420
421 (defun authors-process-lines (program &rest args)
422 "Execute PROGRAM with ARGS, returning its output as a list of lines.
423 Signal an error if the program returns with a non-zero exit status."
424 (with-temp-buffer
425 (let ((status (apply 'call-process program nil (current-buffer) nil args)))
426 (unless (eq status 0)
427 (error "%s exited with status %s" program status))
428 (goto-char (point-min))
429 (let (lines)
430 (while (not (eobp))
431 (setq lines (cons (buffer-substring-no-properties
432 (line-beginning-position)
433 (line-end-position))
434 lines))
435 (forward-line 1))
436 (nreverse lines)))))
437
438
439 (defun authors-canonical-author-name (author) 421 (defun authors-canonical-author-name (author)
440 "Return a canonicalized form of AUTHOR, an author name. 422 "Return a canonicalized form of AUTHOR, an author name.
441 If AUTHOR has an alias, use that. Remove email addresses. Capitalize 423 If AUTHOR has an alias, use that. Remove email addresses. Capitalize
442 words in the author's name." 424 words in the author's name."
443 (let* ((aliases authors-aliases) 425 (let* ((aliases authors-aliases)
603 interactively, ROOT is read from the minibuffer. 585 interactively, ROOT is read from the minibuffer.
604 Result is a buffer *Authors* containing authorship information, and a 586 Result is a buffer *Authors* containing authorship information, and a
605 buffer *Authors Errors* containing references to unknown files." 587 buffer *Authors Errors* containing references to unknown files."
606 (interactive "DEmacs source directory: ") 588 (interactive "DEmacs source directory: ")
607 (setq root (expand-file-name root)) 589 (setq root (expand-file-name root))
608 (let ((logs (authors-process-lines "find" root "-name" "ChangeLog*")) 590 (let ((logs (process-lines "find" root "-name" "ChangeLog*"))
609 (table (make-hash-table :test 'equal)) 591 (table (make-hash-table :test 'equal))
610 (buffer-name "*Authors*") 592 (buffer-name "*Authors*")
611 authors-checked-files-alist 593 authors-checked-files-alist
612 authors-invalid-file-names) 594 authors-invalid-file-names)
613 (authors-add-fixed-entries table) 595 (authors-add-fixed-entries table)
615 (error "Not the root directory of Emacs: %s" root)) 597 (error "Not the root directory of Emacs: %s" root))
616 (dolist (log logs) 598 (dolist (log logs)
617 (when (string-match "ChangeLog\\(.[0-9]+\\)?$" log) 599 (when (string-match "ChangeLog\\(.[0-9]+\\)?$" log)
618 (message "Scanning %s..." log) 600 (message "Scanning %s..." log)
619 (authors-scan-change-log log table))) 601 (authors-scan-change-log log table)))
620 (let ((els (authors-process-lines "find" root "-name" "*.el"))) 602 (let ((els (process-lines "find" root "-name" "*.el")))
621 (dolist (file els) 603 (dolist (file els)
622 (message "Scanning %s..." file) 604 (message "Scanning %s..." file)
623 (authors-scan-el file table))) 605 (authors-scan-el file table)))
624 (message "Generating buffer %s..." buffer-name) 606 (message "Generating buffer %s..." buffer-name)
625 (set-buffer (get-buffer-create buffer-name)) 607 (set-buffer (get-buffer-create buffer-name))