From 8a5506f2971851273b4f46d1650018e95f85b544 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Sat, 30 Sep 2000 12:06:40 +0000 Subject: [PATCH] (authors-obsolete-file-p): New function. (authors-obsolete-files-regexps): New variable. (authors-add): Don't record changes in obsolete files. --- lisp/ChangeLog | 6 ++++++ lisp/emacs-lisp/authors.el | 34 ++++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3d6280a7c49..c897e57567f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2000-09-30 Gerd Moellmann + + * emacs-lisp/authors.el (authors-obsolete-file-p): New function. + (authors-obsolete-files-regexps): New variable. + (authors-add): Don't record changes in obsolete files. + 2000-09-29 Stefan Monnier * autoinsert.el (auto-insert-mode): Use define-minor-mode. diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index 7ff37ca9de9..0f2c2d2db0d 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el @@ -87,17 +87,39 @@ matches REGEXP, use ALIAS instead. The special alias \"ignore\" means ignore that author.") +(defvar authors-obsolete-files-regexps + '("vc-\\*\\.el$" + "spec.txt$" + "vc-\\(rcs\\|cvs\\|sccs\\)-hooks\\.el$") + "List of regexps matching obsolete files. +Changes to files matching one of the regexps in this list are not +listed.") + + +(defun authors-obsolete-file-p (file) + "Return non-nil if FILE is obsolete. +FILE is considered obsolete if it matches on of the regular expressions +from `authors-obsolete-files-regexps'." + (let (obsolete-p + (regexps authors-obsolete-files-regexps)) + (while (and regexps (not obsolete-p)) + (setq obsolete-p (string-match (car regexps) file) + regexps (cdr regexps))) + obsolete-p)) + + (defun authors-add (author file action table) "Record that AUTHOR worked on FILE. ACTION is a keyword symbol describing what he did. Record file, author and what he did in hash table TABLE. See the description of `authors-scan-change-log' for the structure of the hash table." - (let* ((value (gethash author table)) - (entry (assoc file value))) - (if (null entry) - (puthash author (cons (list file action) value) table) - (unless (memq action entry) - (nconc entry (list action)))))) + (unless (authors-obsolete-file-p file) + (let* ((value (gethash author table)) + (entry (assoc file value))) + (if (null entry) + (puthash author (cons (list file action) value) table) + (unless (memq action entry) + (nconc entry (list action))))))) (defun authors-process-lines (program &rest args) -- 2.39.2