From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] I regret using subtree Date: Mon, 13 Mar 2017 19:01:45 +0900 Message-ID: <87inndlcl2.fsf@calancha-pc> References: <83eg75jk5h.fsf@gnu.org> <87lh1cb6p0.fsf@lifelogs.com> <87oa5sa176.fsf_-_@lifelogs.com> <874m7kmkcm.fsf@gmx.de> <871t2o6t94.fsf@gmx.de> <87wpkf6pup.fsf@lifelogs.com> <87poq6iweb.fsf@ericabrahamsen.net> <87shv0uy3w.fsf@ericabrahamsen.net> <87oa5ouf6x.fsf@ericabrahamsen.net> <87y44qu40k.fsf@ericabrahamsen.net> <87twfetz6s.fsf@ericabrahamsen.net> <87innet48i.fsf_-_@ericabrahamsen.net> <87bmt5udfl.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1489399359 4688 195.159.176.226 (13 Mar 2017 10:02:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Mar 2017 10:02:39 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: tino.calancha@gmail.com, Stefan Monnier , emacs-devel@gnu.org To: Eric Abrahamsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 13 11:02:34 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnMoA-0000OG-Do for ged-emacs-devel@m.gmane.org; Mon, 13 Mar 2017 11:02:30 +0100 Original-Received: from localhost ([::1]:51115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnMoG-0007sW-Cg for ged-emacs-devel@m.gmane.org; Mon, 13 Mar 2017 06:02:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnMnc-0007sK-E0 for emacs-devel@gnu.org; Mon, 13 Mar 2017 06:01:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnMnZ-0000f8-Ae for emacs-devel@gnu.org; Mon, 13 Mar 2017 06:01:56 -0400 Original-Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:33801) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cnMnZ-0000dH-1d for emacs-devel@gnu.org; Mon, 13 Mar 2017 06:01:53 -0400 Original-Received: by mail-pf0-x242.google.com with SMTP id o126so18528273pfb.1 for ; Mon, 13 Mar 2017 03:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=U+L4403R2jn5nmarXIDhFiimOsy6WGWuAhwWUICO484=; b=SIOuQbjIQ2u8NuZpPAAtK/ADfP/1JwqrhWuGjJZZb6k5k0zPnLwTy/qDpA/vKd3QHb jvRmMEKjFPoCPvjRo5qCGHek3oBMt9ft+RDNTh0SbUoiirRJVsV3YhC8gcr/F1xJDpyL +xHgLtE2riLdI3KSL/YoZO/cexQ75LMg6o4xBW8KKlCHfpyW9vAaXBpJmofPITardqv6 e0aiamcmS+zgCa3UXvLhsn9fh8N/An+Yt69QTzPX3dBQ1JcPra4AG2/fXXhGJX/EGhc4 ZvaEQBE2K4IN/xLJM9AhfOH3QNUpy6TRpXvjgln7XoME8mLxb1pO7+4PNsb41KO7YE6n faWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=U+L4403R2jn5nmarXIDhFiimOsy6WGWuAhwWUICO484=; b=F166JTznY67PX8AcdAdu7nbyAVgnCw8kqUTr5+Tf5m+Xw1iCqZvqCyZPvOPC362gUX 3wF/5ooMRDVKvIKoLAvrMoQg0u0sEf1jvMSSFJ5dD2jdbjwPdXWAUbtjKFHX9MwB++fB WP64w8zIjIQ57/d/9Me62d60b0jz2R7Y+c9Kz+JX2kfvxTbzXYgQwmIPi047sCmwur7p PqT/FZiSunqhtpYXU4QA1qCwmQtEi/qZk/ozt+9gM4nVV3EIR41Cd5PgJ3PEeXOCS/7l hLtzq0deuoCrHUeycfjSF70BiO3QVWinN/TpFg6xtyuI/331z94PKPb9OnGRtMh7MjxI HRHA== X-Gm-Message-State: AMke39nwWD5nJLhlOJbJMdJMKX8xXzDH4CkOuMfvbHnRXPD/hpOYmP8oEDkLdlL0mc/YOA== X-Received: by 10.99.217.69 with SMTP id e5mr36074953pgj.56.1489399310335; Mon, 13 Mar 2017 03:01:50 -0700 (PDT) Original-Received: from calancha-pc (161.224.128.101.dy.bbexcite.jp. [101.128.224.161]) by smtp.gmail.com with ESMTPSA id a16sm32395916pgd.62.2017.03.13.03.01.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Mar 2017 03:01:49 -0700 (PDT) In-Reply-To: <87bmt5udfl.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 12 Mar 2017 19:18:38 -0700") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::242 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212981 Archived-At: Eric Abrahamsen writes: > Stefan Monnier writes: >> The patch seems OK, except it should put the Cc in the "X-Debbugs-Cc:" >> header (so that the maintainer gets the email with the bug-number >> rather than email before assigned a bug-number). > > Here's an updated version. I) There are files with more than 1 maintainer/author. Just pick up the first= one may not suffice. E.g., (lm-authors (find-library-name "tramp")) =3D> (("Kai Gro=C3=9Fjohann" . "kai.grossjohann@gmx.net") ("Michael Albinus" . "michael.albinus@gmx.de")) (lm-maintainer (find-library-name "tramp")) =3D> ("Kai Gro=C3=9Fjohann" . "kai.grossjohann@gmx.net") ;; Your patch won't send CC to Michael. I suggest to CC all of them. In order to do that `lm-maintainer' must be updated. See patches below. II) There are files with plural versions of 'Author', 'Maintainer' headers For instance, lisp/net/rcirc.el In this case `lm-maintainer' fall back in `lm-authors' so that Liu wouldn't be in CC. Another example, lisp/color.el Just 'Authors' header, no 'Maintainer' one. There wouldn't be CC in this c= ase. III) The e-mail format might confuse these tools. E.g. lisp/org/org-protocol.el ;; Maintainer: Sebastian Rose or in lisp/progmodes/prolog.el ;; Maintainer: Stefan Bruda --8<-----------------------------cut here---------------start------------->= 8--- >From b0a51241e4393ee62673c181c03317649e9652fe Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 13 Mar 2017 18:56:45 +0900 Subject: [PATCH 1/3] lm-maintainer: Allow return more than 1 maintainer * lisp/emacs-lisp/lisp-mnt.el (lm-authors, lm-maintainer): Pluralize regexp. (lm-header-multiline): Fix regexp. (lm-maintainer): Add second argument ALL. --- lisp/emacs-lisp/lisp-mnt.el | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index fc3caf3359..c96d224679 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -118,6 +118,8 @@ =20 ;;; Variables: =20 +(eval-when-compile (require 'subr-x)) + (defgroup lisp-mnt nil "Utility functions for Emacs Lisp maintainers." :prefix "lm-" @@ -285,7 +287,7 @@ lm-header-multiline (when res (setq res (list res)) (forward-line 1) - (while (looking-at "^;+\\(\t\\|[\t\s]\\{2,\\}\\)\\(.+\\)") + (while (looking-at "^;+\\(\t+\s?+\\|[[:blank:]]\\{2,\\}\\)\\(.+\\)") (push (match-string-no-properties 2) res) (forward-line 1))) (nreverse res)))) @@ -383,17 +385,20 @@ 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 "author[s]?"))) (mapcar 'lm-crack-address authorlist)))) =20 -(defun lm-maintainer (&optional file) +(defun lm-maintainer (&optional file all) "Return the maintainer of file FILE, or current buffer if FILE is nil. -The return value has the form (NAME . ADDRESS)." +If optional arg ALL is non-nil, then return all maintainers. Otherwise, +return just the first one. In the former case the return value has +the form ((NAME1 . ADDRESS1) (NAME2 . ADDRESS2) ...); in the latter case, +the return value is just (NAME1 . ADDRESS1)." (lm-with-file file - (let ((maint (lm-header "maintainer"))) - (if maint - (lm-crack-address maint) - (car (lm-authors)))))) + (let ((people (if-let (maint (lm-header-multiline "maintainer[s]?")) + (mapcar 'lm-crack-address maint) + (lm-authors)))) + (if all people (car people))))) =20 (defun lm-creation-date (&optional file) "Return the created date given in file FILE, or current buffer if FILE i= s nil." --=20 2.11.0 >From 26be86a780cc9c5f497a6e99bd41fc81a2be8ad6 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 13 Mar 2017 18:56:45 +0900 Subject: [PATCH 2/3] * lisp/mail/emacsbug.el (report-emacs-bug): Apply Eric patch. --- lisp/mail/emacsbug.el | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index c1aec6923f..656eeabe0f 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -123,17 +123,26 @@ message-send-mail-function (defvar message-sendmail-envelope-from) =20 ;;;###autoload -(defun report-emacs-bug (topic &optional unused) +(defun report-emacs-bug (topic package &optional unused) "Report a bug in GNU Emacs. Prompts for bug subject. Leaves you in a mail buffer." (declare (advertised-calling-convention (topic) "24.5")) - (interactive "sBug Subject: ") + (interactive (list + (read-string "Bug Subject: ") + (completing-read + "Package: " + (progn + (package-initialize) + package-alist)))) ;; The syntax `version;' is preferred to `[version]' because the ;; latter could be mistakenly stripped by mailing software. (setq topic (concat emacs-version "; " topic)) (let ((from-buffer (current-buffer)) (can-insert-mail (or (report-emacs-bug-can-use-xdg-email) (report-emacs-bug-can-use-osx-open))) + (cc (unless (or (string-empty-p package) (string=3D package "emacs= ")) + (require 'finder) + (lm-maintainer (find-library-name package)))) user-point message-end-point) (setq message-end-point (with-current-buffer (messages-buffer) @@ -160,6 +169,13 @@ report-emacs-bug (when (and (not message-sendmail-envelope-from) (message-bogus-recipient-p (message-make-address))) (set (make-local-variable 'message-sendmail-envelope-from) 'header))) + (when (cdr cc) ;; cdr is the email address. + (if (eq major-mode 'message-mode) + (message-position-on-field "X-Debbugs-Cc") + (mail-cc)) + (if (car cc) + (insert (format "%s <%s>" (car cc) (cdr cc))) + (insert (format "%s" (cdr cc))))) (rfc822-goto-eoh) (forward-line 1) ;; Move the mail signature to the proper place. --=20 2.11.0 >From 2114a448ad145923980dbe4d09ae5feff18eb49d Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 13 Mar 2017 18:56:45 +0900 Subject: [PATCH 3/3] * lisp/mail/emacsbug.el (report-emacs-bug): Send Cc to all maintainers. --- lisp/mail/emacsbug.el | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 656eeabe0f..018d2ea6a7 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -142,7 +142,7 @@ report-emacs-bug (report-emacs-bug-can-use-osx-open))) (cc (unless (or (string-empty-p package) (string=3D package "emacs= ")) (require 'finder) - (lm-maintainer (find-library-name package)))) + (lm-maintainer (find-library-name package) 'all))) user-point message-end-point) (setq message-end-point (with-current-buffer (messages-buffer) @@ -169,13 +169,19 @@ report-emacs-bug (when (and (not message-sendmail-envelope-from) (message-bogus-recipient-p (message-make-address))) (set (make-local-variable 'message-sendmail-envelope-from) 'header))) - (when (cdr cc) ;; cdr is the email address. - (if (eq major-mode 'message-mode) - (message-position-on-field "X-Debbugs-Cc") - (mail-cc)) - (if (car cc) - (insert (format "%s <%s>" (car cc) (cdr cc))) - (insert (format "%s" (cdr cc))))) + (dolist (maint cc) + (when (cdr maint) ;; cdr is the email address. + (if (eq major-mode 'message-mode) + (message-position-on-field "X-Debbugs-Cc") + (mail-cc)) + (cond ((car maint) + (insert (format "%s%s <%s>" + (if (looking-back ":[[:blank:]]+?" (point-a= t-bol)) "" ", ") + (car maint) (cdr maint)))) + (t + (insert (format "%s%s" + (if (looking-back ":[[:blank:]]+?" (point-a= t-bol)) "" ", ") + (cdr maint))))))) (rfc822-goto-eoh) (forward-line 1) ;; Move the mail signature to the proper place. --=20 2.11.0 --8<-----------------------------cut here---------------end--------------->= 8--- In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.8) of 2017-03-13 Repository revision: 94b59f7dd1e8611495ff0f4596dc6dec20e268af