From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.bugs Subject: bug#48592: [PATCH 1/2] Support plural forms of Author and Maintainer library headers Date: Sat, 22 May 2021 22:32:49 +0200 Message-ID: <20210522203250.2216-1-jonas@bernoul.li> References: <20210522202519.32549-1-jonas@bernoul.li> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3361"; mail-complaints-to="usenet@ciao.gmane.io" To: 48592@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 22 22:33:30 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lkYJO-0000j6-15 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 22:33:30 +0200 Original-Received: from localhost ([::1]:43286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkYJM-0005mc-Vy for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 16:33:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkYIw-0005iU-Sc for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 16:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkYIw-0001W0-K1 for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 16:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lkYIw-0002Zu-FR for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 16:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonas Bernoulli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 May 2021 20:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48592 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 48592-submit@debbugs.gnu.org id=B48592.16217155779897 (code B ref 48592); Sat, 22 May 2021 20:33:02 +0000 Original-Received: (at 48592) by debbugs.gnu.org; 22 May 2021 20:32:57 +0000 Original-Received: from localhost ([127.0.0.1]:40122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkYIq-0002ZZ-Lj for submit@debbugs.gnu.org; Sat, 22 May 2021 16:32:56 -0400 Original-Received: from mail.hostpark.net ([212.243.197.30]:54666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkYIn-0002ZP-M2 for 48592@debbugs.gnu.org; Sat, 22 May 2021 16:32:54 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id D1EEB160BF; Sat, 22 May 2021 22:32:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=sel2011a; t=1621715570; bh=/fK1gu0H0f8Idtj KnmkdcpewfLFcAL2zF4XQNjaj3TM=; b=E5G4X4uLCCDh+f2i5OZ4YrwvxTbrpNK 4eKsUIDM5vRCJEtUvGCtxpiFh2hLQTpa7I+8g6GoPbOp9d4LnaWmaYdnMxfIzrpy AvU3bl+gP+GyU2g21zhl5RA7bt92r1AK30wpS4SzzP5LgfNJenUmVQJKgZ0r31na yAkTZ26KD3PY= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id jWYmin2D_3Qs; Sat, 22 May 2021 22:32:50 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id A04D1160CE; Sat, 22 May 2021 22:32:50 +0200 (CEST) X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210522202519.32549-1-jonas@bernoul.li> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207063 Archived-At: * 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 +;; Authors: Your Name ;; Someone Else ;; Another Person @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