Subject: [PATCH 1/2] Support plural forms of Author and Maintainer library headers

From: Jonas Bernoulli <[email-masked]>
Date: Sat, 22 May 2021 22:32:49 +0200

* doc/lispref/tips.texi (Library Headers): Mention that in addition to
the "Author" and "Maintainer" headers, their plural forms are also
supported.
* lisp/emacs-lisp/lisp-mnt.el (lm-authors): Consider "Authors" header
in addition to "Author".
(lm-maintainers): New function.
(lm-maintainer): Make obsolete in favor of lm-maintainer.
(lm-verify): Use lm-maintainers.  Mention plural headers also.
(lm-report-bug): Use lm-maintainers.
---
 doc/lispref/tips.texi       | 24 +++++++++++++-----------
 lisp/emacs-lisp/lisp-mnt.el | 28 ++++++++++++++++++----------
 2 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 36c68ee5ce..25d43dfcfe 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -1034,7 +1034,8 @@ Library Headers
 
 @table @samp
 @item Author
-This line states the name and email address of at least the principal
+@itemx Authors
+This header states the name and email address of at least the principal
 author of the library.  If there are multiple authors, list them on
 continuation lines led by @code{;;} and a tab or at least two spaces.
 We recommend including a contact email address, of the form
@@ -1042,22 +1043,23 @@ Library Headers
 
 @smallexample
 @group
-;; Author: Your Name <yourname@@example.com>
+;; Authors: Your Name <yourname@@example.com>
 ;;      Someone Else <someone@@example.com>
 ;;      Another Person <another@@example.com>
 @end group
 @end smallexample
 
 @item Maintainer
-This header has the same format as the Author header.  It lists the
-person(s) who currently maintain(s) the file (respond to bug reports,
-etc.).
-
-If there is no maintainer line, the person(s) in the Author field
-is/are presumed to be the maintainers.  Some files in Emacs use
-@samp{emacs-devel@@gnu.org} for the maintainer, which means the author is
-no longer responsible for the file, and that it is maintained as part
-of Emacs.
+@itemx Maintainers
+This header has the same format as the Author(s) header.  It lists the
+person(s) who currently maintain(s) the file (respond(s) to bug
+reports, etc.).
+
+If there is no Maintainer(s) header, the person(s) in the Author(s)
+header is/are presumed to be the maintainer(s).  Some files in Emacs
+use @samp{emacs-devel@@gnu.org} for the maintainer, which means the
+author is no longer responsible for the file, and that it is
+maintained as part of Emacs.
 
 @item Created
 This optional line gives the original creation date of the file, and
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index 73a33a553f..25b5e8c5bd 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -375,17 +375,25 @@ lm-authors
 Each element of the list is a cons; the car is the full name,
 the cdr is an email address."
   (lm-with-file file
-    (let ((authorlist (lm-header-multiline "author")))
+    (let ((authorlist (lm-header-multiline "authors?")))
       (mapcar #'lm-crack-address authorlist))))
 
+(defun lm-maintainers (&optional file)
+  "Return the maintainer list of file FILE, or current buffer if FILE is nil.
+If the maintainers are unspecified, then return the authors.
+Each element of the list is a cons; the car is the full name,
+the cdr is an email address."
+  (lm-with-file file
+    (mapcar #'lm-crack-address
+            (or (lm-header-multiline "maintainers?")
+                (lm-header-multiline "authors?")))))
+
 (defun lm-maintainer (&optional file)
   "Return the maintainer of file FILE, or current buffer if FILE is nil.
+If the maintainer is unspecified, then return the author.
 The return value has the form (NAME . ADDRESS)."
-  (lm-with-file file
-    (let ((maint (lm-header "maintainer")))
-      (if maint
-	  (lm-crack-address maint)
-	(car (lm-authors))))))
+  (declare (obsolete lm-maintainers "28.1"))
+  (car (lm-maintainers file)))
 
 (defun lm-creation-date (&optional file)
   "Return the created date given in file FILE, or current buffer if FILE is nil."
@@ -544,9 +552,9 @@ lm-verify
 	       ((null name)
 		"Can't find package name")
 	       ((not (lm-authors))
-		"`Author:' tag missing")
-	       ((not (lm-maintainer))
-		"`Maintainer:' tag missing")
+		"`Author:' or `Authors:' tag missing")
+	       ((not (lm-maintainers))
+		"`Maintainer:' or `Maintainers:' tag missing")
 	       ((not (lm-summary))
 		"Can't find the one-line summary description")
 	       ((not (lm-keywords))
@@ -613,7 +621,7 @@ lm-report-bug
   (interactive "sBug Subject: ")
   (require 'emacsbug)
   (let ((package (lm-get-package-name))
-	(addr (lm-maintainer))
+	(addr (car (lm-maintainers)))
 	(version (lm-version)))
     (compose-mail (if addr
 		      (concat (car addr) " <" (cdr addr) ">")
-- 
2.30.1