aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorGlenn Morris2017-06-05 20:39:29 -0400
committerGlenn Morris2017-06-05 20:39:29 -0400
commit6aa1466713c9ded09b57a71592b0fd2c6e43e599 (patch)
tree021bc5dd5245c1942b10d45558896676a9c7194b /admin
parentfcaf9327c1dabd7c045baf42de1bc6786b3f2077 (diff)
downloademacs-6aa1466713c9ded09b57a71592b0fd2c6e43e599.tar.gz
emacs-6aa1466713c9ded09b57a71592b0fd2c6e43e599.zip
Make authors.el report names that were ignored
* admin/authors.el (authors-ignored-names): New. (authors-canonical-author-name): Add file and position arguments. Record ignored authors. (authors-scan-change-log, authors-scan-el): Pass file and position to authors-canonical-author-name. (authors): Also print authors that were ignored.
Diffstat (limited to 'admin')
-rw-r--r--admin/authors.el34
1 files changed, 24 insertions, 10 deletions
diff --git a/admin/authors.el b/admin/authors.el
index ac5da82136f..4dfd183415a 100644
--- a/admin/authors.el
+++ b/admin/authors.el
@@ -1077,6 +1077,7 @@ Additionally, for these logs we apply the `lax' elements of
1077 1077
1078(defvar authors-checked-files-alist) 1078(defvar authors-checked-files-alist)
1079(defvar authors-invalid-file-names) 1079(defvar authors-invalid-file-names)
1080(defvar authors-ignored-names)
1080 1081
1081;; This has become rather yucky. :( 1082;; This has become rather yucky. :(
1082(defun authors-disambiguate-file-name (fullname) 1083(defun authors-disambiguate-file-name (fullname)
@@ -1219,7 +1220,7 @@ author and what he did in hash table TABLE. See the description of
1219 (nconc entry (list (cons action 1)))))))) 1220 (nconc entry (list (cons action 1))))))))
1220 1221
1221 1222
1222(defun authors-canonical-author-name (author) 1223(defun authors-canonical-author-name (author file pos)
1223 "Return a canonicalized form of AUTHOR, an author name. 1224 "Return a canonicalized form of AUTHOR, an author name.
1224If AUTHOR has an entry in `authors-aliases', use that. Remove 1225If AUTHOR has an entry in `authors-aliases', use that. Remove
1225email addresses. Capitalize words in the author's name, unless 1226email addresses. Capitalize words in the author's name, unless
@@ -1243,6 +1244,9 @@ it is found in `authors-fixed-case'."
1243 (setq author (replace-regexp-in-string "[ \t]+" " " author)) 1244 (setq author (replace-regexp-in-string "[ \t]+" " " author))
1244 ;; NB this ignores the first name only case. 1245 ;; NB this ignores the first name only case.
1245 (unless (string-match "[-, \t]" author) 1246 (unless (string-match "[-, \t]" author)
1247 (push (format-message "%s:%d: ignored `%s'"
1248 file (1+ (count-lines (point-min) pos)) author)
1249 authors-ignored-names)
1246 (setq author "")) 1250 (setq author ""))
1247 (or (car (member author authors-fixed-case)) 1251 (or (car (member author authors-fixed-case))
1248 (capitalize author)))) 1252 (capitalize author))))
@@ -1284,7 +1288,7 @@ with the file and the number of each action:
1284Suggested\\|Trivial\\|Version\\|Originally\\|From:\\|Patch[ \t]+[Bb]y\\)"))) 1288Suggested\\|Trivial\\|Version\\|Originally\\|From:\\|Patch[ \t]+[Bb]y\\)")))
1285 (push (authors-canonical-author-name 1289 (push (authors-canonical-author-name
1286 (buffer-substring-no-properties 1290 (buffer-substring-no-properties
1287 (point) (line-end-position))) authors) 1291 (point) (line-end-position)) log-file pos) authors)
1288 (forward-line 1))) 1292 (forward-line 1)))
1289 ((looking-at "^[ \t]+\\*") 1293 ((looking-at "^[ \t]+\\*")
1290 (let ((line (buffer-substring-no-properties 1294 (let ((line (buffer-substring-no-properties
@@ -1317,7 +1321,7 @@ TABLE is a hash table to add author information to."
1317 (enable-local-variables :safe) ; for find-file, hence let* 1321 (enable-local-variables :safe) ; for find-file, hence let*
1318 (enable-local-eval nil) 1322 (enable-local-eval nil)
1319 (buffer (find-file-noselect file))) 1323 (buffer (find-file-noselect file)))
1320 (setq file (authors-disambiguate-file-name (expand-file-name file))) 1324 (setq file (expand-file-name file))
1321 (with-current-buffer buffer 1325 (with-current-buffer buffer
1322 (save-restriction 1326 (save-restriction
1323 (widen) 1327 (widen)
@@ -1334,7 +1338,8 @@ TABLE is a hash table to add author information to."
1334 (skip-chars-forward "-0-9 \t") 1338 (skip-chars-forward "-0-9 \t")
1335 (push (authors-canonical-author-name 1339 (push (authors-canonical-author-name
1336 (buffer-substring-no-properties 1340 (buffer-substring-no-properties
1337 (point) (line-end-position))) authors) 1341 (point) (line-end-position))
1342 file (line-beginning-position)) authors)
1338 ;; tips.texi says the continuation line should begin 1343 ;; tips.texi says the continuation line should begin
1339 ;; with a tab, but often spaces are used. 1344 ;; with a tab, but often spaces are used.
1340 (setq continue 1345 (setq continue
@@ -1345,7 +1350,9 @@ TABLE is a hash table to add author information to."
1345 (and (> (length authors) 1) 1350 (and (> (length authors) 1)
1346 (setq action :cowrote)) 1351 (setq action :cowrote))
1347 (mapc (lambda (author) 1352 (mapc (lambda (author)
1348 (authors-add author file action table)) 1353 (authors-add
1354 author
1355 (authors-disambiguate-file-name file) action table))
1349 authors))))) 1356 authors)))))
1350 (unless existing-buffer 1357 (unless existing-buffer
1351 (kill-buffer buffer)))) 1358 (kill-buffer buffer))))
@@ -1436,7 +1443,8 @@ and a buffer *Authors Errors* containing references to unknown files."
1436 (table (make-hash-table :test 'equal)) 1443 (table (make-hash-table :test 'equal))
1437 (buffer-name "*Authors*") 1444 (buffer-name "*Authors*")
1438 authors-checked-files-alist 1445 authors-checked-files-alist
1439 authors-invalid-file-names) 1446 authors-invalid-file-names
1447 authors-ignored-names)
1440 (authors-add-fixed-entries table) 1448 (authors-add-fixed-entries table)
1441 (dolist (log logs) 1449 (dolist (log logs)
1442 (when (string-match "ChangeLog\\(.[0-9]+\\)?$" log) 1450 (when (string-match "ChangeLog\\(.[0-9]+\\)?$" log)
@@ -1500,14 +1508,20 @@ list of their contributions.\n")
1500 (symbol-name authors-coding-system) "\nEnd:\n") 1508 (symbol-name authors-coding-system) "\nEnd:\n")
1501 (message "Generating buffer %s... done" buffer-name) 1509 (message "Generating buffer %s... done" buffer-name)
1502 (unless noninteractive 1510 (unless noninteractive
1503 (when authors-invalid-file-names 1511 (when (or authors-invalid-file-names authors-ignored-names)
1504 (with-current-buffer (get-buffer-create "*Authors Errors*") 1512 (with-current-buffer (get-buffer-create "*Authors Errors*")
1505 (setq buffer-read-only nil) 1513 (setq buffer-read-only nil)
1506 (erase-buffer) 1514 (erase-buffer)
1507 (set-buffer-file-coding-system authors-coding-system) 1515 (set-buffer-file-coding-system authors-coding-system)
1508 (insert "Unrecognized file entries found:\n\n") 1516 (when authors-invalid-file-names
1509 (mapc (lambda (f) (if (not (string-match "^[A-Za-z]+$" f)) (insert f "\n"))) 1517 (insert "Unrecognized file entries found:\n\n")
1510 (sort authors-invalid-file-names 'string-lessp)) 1518 (mapc (lambda (f) (if (not (string-match "^[A-Za-z]+$" f)) (insert f "\n")))
1519 (sort authors-invalid-file-names 'string-lessp)))
1520 (when authors-ignored-names
1521 (insert "\n\nThese authors were ignored:\n\n"
1522 (mapconcat
1523 'identity
1524 (sort authors-ignored-names 'string-lessp) "\n")))
1511 (goto-char (point-min)) 1525 (goto-char (point-min))
1512 (compilation-mode) 1526 (compilation-mode)
1513 (message "Errors were found. See buffer %s" (buffer-name)))) 1527 (message "Errors were found. See buffer %s" (buffer-name))))