GNU bug report logs - #37548
Implement sanitation of single-file package long description

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Bruno Félix Rezende Ribeiro <oitofelix@HIDDEN>; Keywords: patch; dated Sun, 29 Sep 2019 05:43:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 37548 <at> debbugs.gnu.org:


Received: (at 37548) by debbugs.gnu.org; 14 Nov 2019 11:29:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 14 06:29:21 2019
Received: from localhost ([127.0.0.1]:32794 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iVDJQ-0002Js-So
	for submit <at> debbugs.gnu.org; Thu, 14 Nov 2019 06:29:21 -0500
Received: from eggs.gnu.org ([209.51.188.92]:52983)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iVDJP-0002JV-L0
 for 37548 <at> debbugs.gnu.org; Thu, 14 Nov 2019 06:29:20 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:48667)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iVDJK-00045z-8M; Thu, 14 Nov 2019 06:29:14 -0500
Received: from [176.228.60.248] (port=2751 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iVDJI-0007um-Bi; Thu, 14 Nov 2019 06:29:12 -0500
Date: Thu, 14 Nov 2019 13:28:56 +0200
Message-Id: <83d0du7l3b.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
In-reply-to: <8736eup783.fsf@HIDDEN> (message from Stefan Kangas on Mon,
 11 Nov 2019 20:02:04 +0100)
Subject: Re: bug#37548: Implement sanitation of single-file package long
 description
References: <87eezzwtcx.fsf@HIDDEN>
 <CADwFkm=mHf1BY=d628dJv1vwhTwQWpBq=34VB4LpaSVZrEPgLg@HIDDEN>
 <CADwFkm=hLMKv19N8u=pJXVB00Mki7HqcHWreTQZy756KPJ=8hQ@HIDDEN>
 <87d0f7tyzr.fsf@HIDDEN> <8736eup783.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37548
Cc: oitofelix@HIDDEN, 37548 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Kangas <stefan@HIDDEN>
> Date: Mon, 11 Nov 2019 20:02:04 +0100
> Cc: 37548 <at> debbugs.gnu.org
> 
> Does anyone know if there is a general guideline for when to add your
> name to the "Author" line at the top of the file?

Only when the file is first written, AFAIK.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37548; Package emacs. Full text available.

Message received at 37548 <at> debbugs.gnu.org:


Received: (at 37548) by debbugs.gnu.org; 11 Nov 2019 19:02:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 11 14:02:14 2019
Received: from localhost ([127.0.0.1]:55990 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iUEx3-0006Wy-T4
	for submit <at> debbugs.gnu.org; Mon, 11 Nov 2019 14:02:14 -0500
Received: from host.gofardesign.uk ([208.79.239.190]:46351)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan@HIDDEN>) id 1iUEx2-0006Wj-Fv
 for 37548 <at> debbugs.gnu.org; Mon, 11 Nov 2019 14:02:12 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; 
 s=default;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:
 Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=2RFIvKvhSEhb/aSW35yIn9AptOmTRhhmdLr0KgGu5k8=; b=f/RF4MbVegNnnhLMXH/kCOIhGQ
 Fw9Wjf0E6eEIH35Dk2vsWriPnHDpiK8j9dNAAd+nzQ78s/Gd3LI1D7/2TlkTS6yD35KGz1MW1Y9Z5
 XjreO4X8cWux49qezXEs54d1bcyMDbFgMkuXp3nr6IL8cs2w+0/qL7AKsdhJUQSIlzmg=;
Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:40638
 helo=localhost)
 by host.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)
 (Exim 4.92) (envelope-from <stefan@HIDDEN>)
 id 1iUEww-0008La-76; Mon, 11 Nov 2019 13:02:06 -0600
From: Stefan Kangas <stefan@HIDDEN>
To: Bruno =?utf-8?Q?F=C3=A9lix?= Rezende Ribeiro <oitofelix@HIDDEN>
Subject: Re: bug#37548: Implement sanitation of single-file package long
 description
In-Reply-To: <87d0f7tyzr.fsf@HIDDEN> ("Bruno =?utf-8?Q?F=C3=A9lix?=
 Rezende Ribeiro"'s message of "Tue, 08 Oct 2019 05:36:40 -0300")
References: <87eezzwtcx.fsf@HIDDEN>
 <CADwFkm=mHf1BY=d628dJv1vwhTwQWpBq=34VB4LpaSVZrEPgLg@HIDDEN>
 <CADwFkm=hLMKv19N8u=pJXVB00Mki7HqcHWreTQZy756KPJ=8hQ@HIDDEN>
 <87d0f7tyzr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
Date: Mon, 11 Nov 2019 20:02:04 +0100
Message-ID: <8736eup783.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-OutGoing-Spam-Status: No, score=-0.3
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - host.gofardesign.uk
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - marxist.se
X-Get-Message-Sender-Via: host.gofardesign.uk: authenticated_id:
 stefan@HIDDEN
X-Authenticated-Sender: host.gofardesign.uk: stefan@HIDDEN
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 37548
Cc: 37548 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

Bruno F=C3=A9lix Rezende Ribeiro <oitofelix@HIDDEN> writes:

>> Stefan Kangas <stefan@HIDDEN> writes:
>>
>> I noticed something else:  There is actually already code duplication
>> in package.el -- there is code to strip the commentary section in both
>> package--get-description and describe-package-1.
>>
>> Perhaps it would make sense to look this all over and see how we can do =
better?
>
> I decided to tackle the problem=E2=80=99s root.  After figuring out that =
every
> function depending on =E2=80=98lm-commentary=E2=80=99 implemented their o=
wn ad-hoc
> sanitation for the same effect, I changed =E2=80=98lm-commentary=E2=80=99=
 to return a
> sanitized string and removed the code/functionality duplication from all
> callers.

Sorry for the late reply here.  I think your approach makes sense.

> I=E2=80=99ve assigned my copyright for work on Emacs to the FSF already.

Great, thanks.

> Please, find it in the patch attached.

I think the patch looks good, but I didn't test it yet.

By the way, it would be very good if you would like to add tests.  I
don't think a lack of tests should stop us from applying your patch.
But it would be a big plus to have them.

> --- a/lisp/emacs-lisp/lisp-mnt.el
> +++ b/lisp/emacs-lisp/lisp-mnt.el
> @@ -4,6 +4,7 @@
>  ;; Inc.
>=20=20
>  ;; Author: Eric S. Raymond <esr@HIDDEN>
> +;;         Bruno F=C3=A9lix Rezende Ribeiro <oitofelix@HIDDEN>
>  ;; Maintainer: emacs-devel@HIDDEN
>  ;; Created: 14 Jul 1992
>  ;; Keywords: docs

> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -4,6 +4,7 @@
>=20=20
>  ;; Author: Tom Tromey <tromey@HIDDEN>
>  ;;         Daniel Hackney <dan@HIDDEN>
> +;;         Bruno F=C3=A9lix Rezende Ribeiro <oitofelix@HIDDEN>
>  ;; Created: 10 Mar 2007
>  ;; Version: 1.1.0
>  ;; Keywords: tools

I think we don't usually add our names as authors in every file we
change.  We have other ways to track that, such as the AUTHORS file.

For this file, for instance, I see only one person in the author
field, but AFAICT there are 16 contributors with 99 commits in total.

Does anyone know if there is a general guideline for when to add your
name to the "Author" line at the top of the file?

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37548; Package emacs. Full text available.
Added tag(s) patch. Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 37548 <at> debbugs.gnu.org:


Received: (at 37548) by debbugs.gnu.org; 8 Oct 2019 08:41:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 08 04:41:20 2019
Received: from localhost ([127.0.0.1]:49449 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHl3X-0001Vs-0N
	for submit <at> debbugs.gnu.org; Tue, 08 Oct 2019 04:41:20 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48002)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iHl3W-0001Vg-0t
 for 37548 <at> debbugs.gnu.org; Tue, 08 Oct 2019 04:41:18 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38013)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iHl3K-000763-SW; Tue, 08 Oct 2019 04:41:06 -0400
Received: from [176.228.60.248] (port=2443 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iHl3B-0005tL-FJ; Tue, 08 Oct 2019 04:41:00 -0400
Date: Tue, 08 Oct 2019 11:40:52 +0300
Message-Id: <83tv8jy6i3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Bruno =?utf-8?Q?F=C3=A9lix?= Rezende Ribeiro <oitofelix@HIDDEN>
In-reply-to: <87d0f7tyzr.fsf@HIDDEN> (message from Bruno
 =?utf-8?Q?F=C3=A9lix?= Rezende
 Ribeiro on Tue, 08 Oct 2019 05:36:40 -0300)
Subject: Re: bug#37548: Implement sanitation of single-file package long
 description
References: <87eezzwtcx.fsf@HIDDEN>
 <CADwFkm=mHf1BY=d628dJv1vwhTwQWpBq=34VB4LpaSVZrEPgLg@HIDDEN>
 <CADwFkm=hLMKv19N8u=pJXVB00Mki7HqcHWreTQZy756KPJ=8hQ@HIDDEN>
 <87d0f7tyzr.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37548
Cc: 37548 <at> debbugs.gnu.org, oitofelix@HIDDEN, stefan@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Bruno Félix Rezende Ribeiro <oitofelix@HIDDEN>
> Date: Tue, 08 Oct 2019 05:36:40 -0300
> Cc: Bruno Félix Rezende Ribeiro <oitofelix@HIDDEN>,
>  37548 <at> debbugs.gnu.org
> 
> > 1. It looks likely that this together with your other patch and your
> > previous contributions will together amount to more than 15 lines of
> > code.  That means that you would have to sign Copyright Assignment
> > papers for GNU Emacs.  I see you're emailing from gnu.org, so I assume
> > there are no surprises for you here; I guess Eli can help you sort
> > that out if it's not already.
> 
> I’ve assigned my copyright for work on Emacs to the FSF already.

Right, Bruno's copyright assignment is on file.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37548; Package emacs. Full text available.

Message received at 37548 <at> debbugs.gnu.org:


Received: (at 37548) by debbugs.gnu.org; 8 Oct 2019 08:37:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 08 04:37:00 2019
Received: from localhost ([127.0.0.1]:49444 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHkzG-0001PM-CQ
	for submit <at> debbugs.gnu.org; Tue, 08 Oct 2019 04:37:00 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47356)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <oitofelix@HIDDEN>) id 1iHkzD-0001P8-8d
 for 37548 <at> debbugs.gnu.org; Tue, 08 Oct 2019 04:36:53 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37892)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <oitofelix@HIDDEN>)
 id 1iHkz7-0000Tj-T5; Tue, 08 Oct 2019 04:36:46 -0400
Received: from [189.15.97.184] (port=49772 helo=felix-laptop)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <oitofelix@HIDDEN>)
 id 1iHkz5-0005KU-Sk; Tue, 08 Oct 2019 04:36:44 -0400
From: Bruno =?utf-8?Q?F=C3=A9lix?= Rezende Ribeiro <oitofelix@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
Subject: Re: bug#37548: Implement sanitation of single-file package long
 description
References: <87eezzwtcx.fsf@HIDDEN>
 <CADwFkm=mHf1BY=d628dJv1vwhTwQWpBq=34VB4LpaSVZrEPgLg@HIDDEN>
 <CADwFkm=hLMKv19N8u=pJXVB00Mki7HqcHWreTQZy756KPJ=8hQ@HIDDEN>
X-Face: %,T7Hsg=SK$Zh)wiU4Qdv9-fZ26Pf5*+}Ld,{LeV'Cq-1?=kA"hc,'i""S85]g;
 _W+{nZfx
 2GnAMS1K\E_E&:{h[wQd+Tqj5#PtH:W&8^crA0>i?nmD7hOL$K".`@An_8.7gaObQLlMy0\%%I0Jp.
 Lue$J0B
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACcElEQVRYw93YzXHCQAwF4G0h
 Fw4caYEW0oJbSAtuwa1AldGg8PKQtP+GMHkHxkDG/qLVrtek6x65UCZPleYdH485HA4zrHHQ4R5F
 cPSTl4L0qigJDoxpoFRpUmMGKzR1sbpB3DTLsnzd83nL+XyeNHWDoBHEeg9YQlQWCtZrSmOa1YVN
 ktDkiz0FwmDJVbd7CizTUhcXLByDINXIiGyUQqnkL8Nm8iCY5CD1lkf+9UYQFykEhb7UqEGFeLwK
 Q6YgnXTovEtDZkHGZFpbR21nkLlhlUFqWig63XYGyevxeGSQXFjXG4lclSnyyekW/Ur+jFfzWRD6
 31RoeQxAnxQB6cErQBKsywDpW6Yo93UgFAMg3DqgMaCqaRzEc4pBPh50fdxk9oF4zvPCCBDml6fo
 sIagnClVNTmQn/BAmOXxn4LMXQan45vrJCg07QPC/JI8BeT3BjidLNkGpOu1anSNbgd5U6qWx4Ak
 DOL1RotkTLMV8ouEWYc8yNzezcBNVchv5MIK8VKEHjKrM0D+malvyFoqxG2kLBHIMCmo3EAjFfLl
 MSAeNSzZoeZZIH/SHAim3I1MMwvC7syAeBuEyV++s3aA2suDHkI7nyi6UUTCHwLGKxSCsFjzzpV3
 ZNUihc+s9QqF7YwtEW88zAMQt5Ec7AkKx4uvWjChwaujFoAay+PLUHhQ5LQXKeVu7y2a0GRY/LZq
 +gG1jBROap4Sy0XyX1VNyf8Ekav8lom5dqFyocn0k62QOenWkBC05uNNDyCv2fpj2mUtxve7vGZB
 21CqI1X1BaBhTfiz1QDL9tAMaN70C8L8ei/Q32rYlN6hgdj0DS+u5+J4AqFYAAAAAElFTkSuQmCC
Date: Tue, 08 Oct 2019 05:36:40 -0300
In-Reply-To: <CADwFkm=hLMKv19N8u=pJXVB00Mki7HqcHWreTQZy756KPJ=8hQ@HIDDEN>
 (Stefan Kangas's message of "Mon, 30 Sep 2019 19:39:26 +0200")
Message-ID: <87d0f7tyzr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37548
Cc: Bruno =?utf-8?Q?F=C3=A9lix?= Rezende Ribeiro <oitofelix@HIDDEN>,
 37548 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

> Stefan Kangas <stefan@HIDDEN> writes:
>
> I noticed something else:  There is actually already code duplication
> in package.el -- there is code to strip the commentary section in both
> package--get-description and describe-package-1.
>
> Perhaps it would make sense to look this all over and see how we can do b=
etter?

I decided to tackle the problem=E2=80=99s root.  After figuring out that ev=
ery
function depending on =E2=80=98lm-commentary=E2=80=99 implemented their own=
 ad-hoc
sanitation for the same effect, I changed =E2=80=98lm-commentary=E2=80=99 t=
o return a
sanitized string and removed the code/functionality duplication from all
callers.


> I also have two general questions, which are applicable to both your
> recent patches:
>
> 1. It looks likely that this together with your other patch and your
> previous contributions will together amount to more than 15 lines of
> code.  That means that you would have to sign Copyright Assignment
> papers for GNU Emacs.  I see you're emailing from gnu.org, so I assume
> there are no surprises for you here; I guess Eli can help you sort
> that out if it's not already.

I=E2=80=99ve assigned my copyright for work on Emacs to the FSF already.


> 2. Could you please provide a commit message formatted as a changelog
> entry?  Details on this are in the CONTRIBUTE file in the repository.

Please, find it in the patch attached.



--=-=-=
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
 filename=0001-Globally-sanitize-single-file-package-long-descripti.patch
Content-Transfer-Encoding: quoted-printable

From d3e3983fc6cb74900bfa99f0bfcf2497ab396d67 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?Bruno=3D20F=3DC3=3DA9lix=3D20Rezende=3D20Ribeiro?=3D <oit=
ofelix@HIDDEN>
Date: Tue, 8 Oct 2019 04:32:18 -0300
Subject: [PATCH] Globally sanitize single-file package long descriptions
 (Bug#37548)
MIME-Version: 1.0
Content-Type: text/plain; charset=3DUTF-8
Content-Transfer-Encoding: 8bit

Consistent with multi-file package descriptions which don=E2=80=99t have
commentary sections nor double semicolon prefixes.
* lisp/emacs-lisp/lisp-mnt.el (lm-commentary): Remove commentary
header, double semicolon prefixes of each line, trailing new-lines and
trailing white-space from commentary.
* lisp/emacs-lisp/package.el (package--get-description)
(describe-package-1):
* lisp/finder.el (finder-commentary):
* lisp/info.el (Info-finder-find-node): remove ad-hoc sanitation.
---
 lisp/emacs-lisp/lisp-mnt.el | 14 +++++++++++++-
 lisp/emacs-lisp/package.el  | 30 ++++++++----------------------
 lisp/finder.el              |  8 +-------
 lisp/info.el                | 16 ++--------------
 4 files changed, 24 insertions(+), 44 deletions(-)

diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index 91c7615..dda7895 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -4,6 +4,7 @@
 ;; Inc.
=20
 ;; Author: Eric S. Raymond <esr@HIDDEN>
+;;         Bruno F=C3=A9lix Rezende Ribeiro <oitofelix@HIDDEN>
 ;; Maintainer: emacs-devel@HIDDEN
 ;; Created: 14 Jul 1992
 ;; Keywords: docs
@@ -485,7 +486,18 @@ absent, return nil."
   (lm-with-file file
     (let ((start (lm-commentary-start)))
       (when start
-        (buffer-substring-no-properties start (lm-commentary-end))))))
+        (replace-regexp-in-string       ; Get rid of...
+         "[[:blank:]]*$" ""             ; trailing white-space
+         (replace-regexp-in-string
+          (format "%s\\|%s\\|%s"
+                  ;; commentary header
+                  (concat "^;;;[[:blank:]]*\\("
+                          lm-commentary-header
+                          "\\):[[:blank:]\n]*")
+                  "^;;[[:blank:]]*"     ; double semicolon prefix
+                  "[[:blank:]\n]*\\'")  ; trailing new-lines
+          "" (buffer-substring-no-properties
+              start (lm-commentary-end))))))))
=20
 (defun lm-homepage (&optional file)
   "Return the homepage in file FILE, or current buffer if FILE is nil."
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index ab1fb8b..f65559d 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -4,6 +4,7 @@
=20
 ;; Author: Tom Tromey <tromey@HIDDEN>
 ;;         Daniel Hackney <dan@HIDDEN>
+;;         Bruno F=C3=A9lix Rezende Ribeiro <oitofelix@HIDDEN>
 ;; Created: 10 Mar 2007
 ;; Version: 1.1.0
 ;; Keywords: tools
@@ -2349,18 +2350,9 @@ The description is read from the installed package f=
iles."
      result
=20
      ;; Look for Commentary header.
-     (let ((mainsrcfile (expand-file-name (format "%s.el" (package-desc-na=
me desc))
-                                          srcdir)))
-       (when (file-readable-p mainsrcfile)
-         (with-temp-buffer
-           (insert (or (lm-commentary mainsrcfile) ""))
-           (goto-char (point-min))
-           (when (re-search-forward "^;;; Commentary:\n" nil t)
-             (replace-match ""))
-           (while (re-search-forward "^\\(;+ ?\\)" nil t)
-             (replace-match ""))
-           (buffer-string))))
-     )))
+     (or (lm-commentary (expand-file-name
+                         (format "%s.el" (package-desc-name desc)) srcdir))
+         ""))))
=20
 (defun describe-package-1 (pkg)
   "Insert the package description for PKG.
@@ -2555,16 +2547,10 @@ Helper function for `describe-package'."
       (if built-in
           ;; For built-in packages, get the description from the
           ;; Commentary header.
-          (let ((fn (locate-file (format "%s.el" name) load-path
-                                 load-file-rep-suffixes))
-                (opoint (point)))
-            (insert (or (lm-commentary fn) ""))
-            (save-excursion
-              (goto-char opoint)
-              (when (re-search-forward "^;;; Commentary:\n" nil t)
-                (replace-match ""))
-              (while (re-search-forward "^\\(;+ ?\\)" nil t)
-                (replace-match ""))))
+          (insert (or (lm-commentary (locate-file (format "%s.el" name)
+                                                  load-path
+                                                  load-file-rep-suffixes))
+                      ""))
=20
         (if (package-installed-p desc)
             ;; For installed packages, get the description from the
diff --git a/lisp/finder.el b/lisp/finder.el
index 89706cf..02d25ec 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -4,6 +4,7 @@
 ;; Inc.
=20
 ;; Author: Eric S. Raymond <esr@HIDDEN>
+;;         Bruno F=C3=A9lix Rezende Ribeiro <oitofelix@HIDDEN>
 ;; Created: 16 Jun 1992
 ;; Version: 1.0
 ;; Keywords: help
@@ -394,13 +395,6 @@ FILE should be in a form suitable for passing to `loca=
te-library'."
     (erase-buffer)
     (insert str)
     (goto-char (point-min))
-    (delete-blank-lines)
-    (goto-char (point-max))
-    (delete-blank-lines)
-    (goto-char (point-min))
-    (while (re-search-forward "^;+ ?" nil t)
-      (replace-match "" nil nil))
-    (goto-char (point-min))
     (while (re-search-forward "\\<\\([-[:alnum:]]+\\.el\\)\\>" nil t)
       (if (locate-library (match-string 1))
           (make-text-button (match-beginning 1) (match-end 1)
diff --git a/lisp/info.el b/lisp/info.el
index 02f3ea5..4262219 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3780,20 +3780,8 @@ Build a menu of the possible matches."
     ;; there is no "nxml.el" (it's nxml-mode.el).
     ;; But package.el makes the same assumption.
     ;; I think nxml is the only exception - maybe it should be just be ren=
amed.
-    (let ((str (ignore-errors (lm-commentary (find-library-name nodename))=
)))
-      (if (null str)
-	  (insert "Can=E2=80=99t find package description.\n\n")
-	(insert
-	 (with-temp-buffer
-	   (insert str)
-	   (goto-char (point-min))
-	   (delete-blank-lines)
-	   (goto-char (point-max))
-	   (delete-blank-lines)
-	   (goto-char (point-min))
-	   (while (re-search-forward "^;+ ?" nil t)
-	     (replace-match "" nil nil))
-	   (buffer-string))))))))
+    (insert (or (ignore-errors (lm-commentary (find-library-name nodename)=
))
+                (insert "Can=E2=80=99t find package description.\n\n"))))))
=20
 ;;;###autoload
 (defun info-finder (&optional keywords)
--=20
2.7.4


--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


--=20
Bruno F=C3=A9lix Rezende Ribeiro (oitofelix) [0x28D618AF]
<http://oitofelix.freeshell.org/>

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37548; Package emacs. Full text available.

Message received at 37548 <at> debbugs.gnu.org:


Received: (at 37548) by debbugs.gnu.org; 30 Sep 2019 17:39:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 30 13:39:47 2019
Received: from localhost ([127.0.0.1]:60455 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iEzeE-0000zx-Iz
	for submit <at> debbugs.gnu.org; Mon, 30 Sep 2019 13:39:46 -0400
Received: from mail-pl1-f177.google.com ([209.85.214.177]:33735)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1iEzeC-0000zf-Sf
 for 37548 <at> debbugs.gnu.org; Mon, 30 Sep 2019 13:39:45 -0400
Received: by mail-pl1-f177.google.com with SMTP id d22so4189391pls.0
 for <37548 <at> debbugs.gnu.org>; Mon, 30 Sep 2019 10:39:44 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=sfQTMkONf+nWiQLQsX46lCA2nUpKi8uzLWs85WBW45Q=;
 b=hUKpkVI4k4cyeiBpmXot7fexlIDHT1H1DNJlJrZq7/x+d+jO/ffHO0Hjxmxvt/04o5
 VLDZWkp89MBKGh64DCNPzNUiSYNitJfQsgSP3hnEkOENtvwYtP2swA8ycA6J5DOq9AGJ
 i4oEf6W+P/Jbj8lQhg+2uBcviP2CRjCvTxh1HfQ36LVQDwoNAbuzsi5fnJGljdqGRkIs
 dvMdkRANExGqeKB7Eo00uHy8nQ8FfLdJXKNJbGOf89HMWo2c0bN3MyzUBiP3z+ZU/ygX
 XRBcBUbcpZ1vJowvnMKmZewr7talNmbt94lEkAStmORnCFRTtmaN5rtx2FphCjt1x/0h
 48gg==
X-Gm-Message-State: APjAAAUilGGXnqzHhaK/XtLyhq86csLHCsfC7nQWgeg3p+hhPz6cAnrH
 Up8uoHfWRT+OHdRWtR+x5DrihHgtGZmo+XLudI4=
X-Google-Smtp-Source: APXvYqwONYpNKJK1Lip7xVWvUxQIB/9wJCBcOoAWSwv/0P+CatocdbsLeSdhC3slVCRhNoCI5a9sBHlFCBGM6uM/F5c=
X-Received: by 2002:a17:902:d88f:: with SMTP id
 b15mr20472300plz.251.1569865178033; 
 Mon, 30 Sep 2019 10:39:38 -0700 (PDT)
MIME-Version: 1.0
References: <87eezzwtcx.fsf@HIDDEN>
 <CADwFkm=mHf1BY=d628dJv1vwhTwQWpBq=34VB4LpaSVZrEPgLg@HIDDEN>
In-Reply-To: <CADwFkm=mHf1BY=d628dJv1vwhTwQWpBq=34VB4LpaSVZrEPgLg@HIDDEN>
From: Stefan Kangas <stefan@HIDDEN>
Date: Mon, 30 Sep 2019 19:39:26 +0200
Message-ID: <CADwFkm=hLMKv19N8u=pJXVB00Mki7HqcHWreTQZy756KPJ=8hQ@HIDDEN>
Subject: Re: bug#37548: Implement sanitation of single-file package long
 description
To: =?UTF-8?Q?Bruno_F=C3=A9lix_Rezende_Ribeiro?= <oitofelix@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 37548
Cc: 37548 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Stefan Kangas <stefan@HIDDEN> writes:

> Maybe it would make more sense to create a new function in package.el
> that takes care of this?  That way we don't have the same
> functionality in two places.

I noticed something else:  There is actually already code duplication
in package.el -- there is code to strip the commentary section in both
package--get-description and describe-package-1.

Perhaps it would make sense to look this all over and see how we can do better?

I also have two general questions, which are applicable to both your
recent patches:

1. It looks likely that this together with your other patch and your
previous contributions will together amount to more than 15 lines of
code.  That means that you would have to sign Copyright Assignment
papers for GNU Emacs.  I see you're emailing from gnu.org, so I assume
there are no surprises for you here; I guess Eli can help you sort
that out if it's not already.

2. Could you please provide a commit message formatted as a changelog
entry?  Details on this are in the CONTRIBUTE file in the repository.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37548; Package emacs. Full text available.

Message received at 37548 <at> debbugs.gnu.org:


Received: (at 37548) by debbugs.gnu.org; 30 Sep 2019 17:27:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 30 13:27:34 2019
Received: from localhost ([127.0.0.1]:60438 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iEzSQ-0000hB-6h
	for submit <at> debbugs.gnu.org; Mon, 30 Sep 2019 13:27:34 -0400
Received: from mail-pf1-f178.google.com ([209.85.210.178]:33290)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1iEzSO-0000gw-8l
 for 37548 <at> debbugs.gnu.org; Mon, 30 Sep 2019 13:27:32 -0400
Received: by mail-pf1-f178.google.com with SMTP id q10so6005335pfl.0
 for <37548 <at> debbugs.gnu.org>; Mon, 30 Sep 2019 10:27:32 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=MvqhGO3E3D6r9Dn6aX5xJ7HLTexONCDXkskfKXH0xK0=;
 b=P6bPu9EWqHp8xssOHcne6mM93wbmY9wtxYjrDEKLrEL/8hiFt5ALcwtlNu14taOfSh
 kyDiFLENnVue0osPS5xRg3ZnVEYSBGfuM4nQcstm6GCAurMj0YMv5s9UE8C/ALwQuxJY
 c2s+biQATBC39AUXfnEDJE5u2zuzMW8OKsH1lzrM3e12cUn41bQZssxcJ1xhRW3Sialq
 XrHq5CQ4eEfsZXJd5nyS+eBmSbM7a4h7bNDFzfCZP/CCPBBIF/vlhgV0e9BSMKv37lPf
 JM+Oc8rudaLCXsj/oNHCorqwHjVrFQ/wBAlKTYLqv+5oXuv/WCWwhK1XFhXFQHyPhRgm
 u5+Q==
X-Gm-Message-State: APjAAAWDgwRjZX3jiQuhegacdFj2pcUjCJRKMNk7zX6NkwP3YRbaSWdj
 /YA8ftd58FM00cI8gZGwxRQCB5KsE/ZpdSwmchyKzrt9u+A=
X-Google-Smtp-Source: APXvYqxnhNNqpE7X6G4ldW0r+hwyXqeJqipWPfom4ce70uyoCc4bRpxu4FiJ9YU/BW4PGxkD1FXKDfjrp8hcn+meKOo=
X-Received: by 2002:a17:90b:8d1:: with SMTP id
 ds17mr374922pjb.106.1569864445405; 
 Mon, 30 Sep 2019 10:27:25 -0700 (PDT)
MIME-Version: 1.0
References: <87eezzwtcx.fsf@HIDDEN>
In-Reply-To: <87eezzwtcx.fsf@HIDDEN>
From: Stefan Kangas <stefan@HIDDEN>
Date: Mon, 30 Sep 2019 19:27:14 +0200
Message-ID: <CADwFkm=mHf1BY=d628dJv1vwhTwQWpBq=34VB4LpaSVZrEPgLg@HIDDEN>
Subject: Re: bug#37548: Implement sanitation of single-file package long
 description
To: =?UTF-8?Q?Bruno_F=C3=A9lix_Rezende_Ribeiro?= <oitofelix@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 37548
Cc: 37548 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Bruno F=C3=A9lix Rezende Ribeiro <oitofelix@HIDDEN> writes:

> Hello Emacs developers,

Hi Bruno,

And thanks for your patch.

> The inlined patch implements sanitation of single-file package=E2=80=99s =
long
> description which is derived from the package=E2=80=99s commentary header
> section.  It removes the commentary header, the double semicolon prefix
> of each line, trailing new-lines and trailing white-space.  I think this
> is the usual practice for packages in GNU ELPA and MELPA repositories.
> Furthermore it=E2=80=99s aligned with the intended behavior for multi-fil=
e
> packages which is to read the long description from a README file[1] ---
> which presumably does not have commentary sections nor double semicolon
> prefixes.

I agree with the change.  However, there seems to be code duplication
here, since the same is done in package.el:

          ;; For built-in packages, get the description from the
          ;; Commentary header.
          (let ((fn (locate-file (format "%s.el" name) load-path
                                 load-file-rep-suffixes))
                (opoint (point)))
            (insert (or (lm-commentary fn) ""))
            (save-excursion
              (goto-char opoint)
              (when (re-search-forward "^;;; Commentary:\n" nil t)
                (replace-match ""))
              (while (re-search-forward "^\\(;+ ?\\)" nil t)
                (replace-match ""))))

Maybe it would make more sense to create a new function in package.el
that takes care of this?  That way we don't have the same
functionality in two places.

FWIW, I would probably prefer to base it on the code already in
package.el, since I find it a bit easier to read when the regular
expressions are split up.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37548; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Sep 2019 05:43:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 29 01:43:01 2019
Received: from localhost ([127.0.0.1]:52048 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iERz3-0005qb-Ku
	for submit <at> debbugs.gnu.org; Sun, 29 Sep 2019 01:43:01 -0400
Received: from lists.gnu.org ([209.51.188.17]:42237)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <oitofelix@HIDDEN>) id 1iERz1-0005qT-HJ
 for submit <at> debbugs.gnu.org; Sun, 29 Sep 2019 01:43:00 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:47860)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <oitofelix@HIDDEN>) id 1iERz0-0006T8-3U
 for bug-gnu-emacs@HIDDEN; Sun, 29 Sep 2019 01:42:59 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44594)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <oitofelix@HIDDEN>) id 1iERyz-0008CU-UZ
 for bug-gnu-emacs@HIDDEN; Sun, 29 Sep 2019 01:42:58 -0400
Received: from [189.15.124.78] (port=49010 helo=felix-laptop)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <oitofelix@HIDDEN>) id 1iERyz-0006pg-8E
 for bug-gnu-emacs@HIDDEN; Sun, 29 Sep 2019 01:42:57 -0400
From: Bruno =?utf-8?Q?F=C3=A9lix?= Rezende Ribeiro <oitofelix@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Implement sanitation of single-file package long description
X-Face: %,T7Hsg=SK$Zh)wiU4Qdv9-fZ26Pf5*+}Ld,{LeV'Cq-1?=kA"hc,'i""S85]g;
 _W+{nZfx
 2GnAMS1K\E_E&:{h[wQd+Tqj5#PtH:W&8^crA0>i?nmD7hOL$K".`@An_8.7gaObQLlMy0\%%I0Jp.
 Lue$J0B
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACcElEQVRYw93YzXHCQAwF4G0h
 Fw4caYEW0oJbSAtuwa1AldGg8PKQtP+GMHkHxkDG/qLVrtek6x65UCZPleYdH485HA4zrHHQ4R5F
 cPSTl4L0qigJDoxpoFRpUmMGKzR1sbpB3DTLsnzd83nL+XyeNHWDoBHEeg9YQlQWCtZrSmOa1YVN
 ktDkiz0FwmDJVbd7CizTUhcXLByDINXIiGyUQqnkL8Nm8iCY5CD1lkf+9UYQFykEhb7UqEGFeLwK
 Q6YgnXTovEtDZkHGZFpbR21nkLlhlUFqWig63XYGyevxeGSQXFjXG4lclSnyyekW/Ur+jFfzWRD6
 31RoeQxAnxQB6cErQBKsywDpW6Yo93UgFAMg3DqgMaCqaRzEc4pBPh50fdxk9oF4zvPCCBDml6fo
 sIagnClVNTmQn/BAmOXxn4LMXQan45vrJCg07QPC/JI8BeT3BjidLNkGpOu1anSNbgd5U6qWx4Ak
 DOL1RotkTLMV8ouEWYc8yNzezcBNVchv5MIK8VKEHjKrM0D+malvyFoqxG2kLBHIMCmo3EAjFfLl
 MSAeNSzZoeZZIH/SHAim3I1MMwvC7syAeBuEyV++s3aA2suDHkI7nyi6UUTCHwLGKxSCsFjzzpV3
 ZNUihc+s9QqF7YwtEW88zAMQt5Ec7AkKx4uvWjChwaujFoAay+PLUHhQ5LQXKeVu7y2a0GRY/LZq
 +gG1jBROap4Sy0XyX1VNyf8Ekav8lom5dqFyocn0k62QOenWkBC05uNNDyCv2fpj2mUtxve7vGZB
 21CqI1X1BaBhTfiz1QDL9tAMaN70C8L8ei/Q32rYlN6hgdj0DS+u5+J4AqFYAAAAAElFTkSuQmCC
Date: Sun, 29 Sep 2019 02:42:54 -0300
Message-ID: <87eezzwtcx.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello Emacs developers,

The inlined patch implements sanitation of single-file package=E2=80=99s lo=
ng
description which is derived from the package=E2=80=99s commentary header
section.  It removes the commentary header, the double semicolon prefix
of each line, trailing new-lines and trailing white-space.  I think this
is the usual practice for packages in GNU ELPA and MELPA repositories.
Furthermore it=E2=80=99s aligned with the intended behavior for multi-file
packages which is to read the long description from a README file[1] ---
which presumably does not have commentary sections nor double semicolon
prefixes.


Please, let me know of any changes required.
Thanks!


PS: For some reason I was not able to use a single regexp within a
single invocation of =E2=80=98replace-regexp-in-string=E2=80=99, as would b=
e natural.
It simply didn=E2=80=99t work as expected.  It=E2=80=99s working fine now w=
ith nested
calls.



--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=package-x-single-file-package-long-description-sanitization.patch

diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el
index 2815be3..7fe6f6d 100644
--- a/lisp/emacs-lisp/package-x.el
+++ b/lisp/emacs-lisp/package-x.el
@@ -159,6 +159,7 @@ DESCRIPTION is the text of the news item."
 
 (declare-function lm-commentary "lisp-mnt" (&optional file))
 (defvar tar-data-buffer)
+(defvar lm-commentary-header)
 
 (defun package-upload-buffer-internal (pkg-desc extension &optional archive-url)
   "Upload a package whose contents are in the current buffer.
@@ -204,7 +205,17 @@ if it exists."
 	       (split-version (package-desc-version pkg-desc))
 	       (commentary
                 (pcase file-type
-                  ('single (lm-commentary))
+                  ('single (replace-regexp-in-string ; Get rid of...
+                            "[[:blank:]]*$" "" ; trailing white-space
+                            (replace-regexp-in-string
+                             (format "%s\\|%s\\|%s"
+                                     ;; commentary header
+                                     (concat "^;;;[[:blank:]]*\\("
+                                             lm-commentary-header
+                                             "\\):[[:blank:]\n]*")
+                                     "^;;[[:blank:]]*" ; double semicolon prefix
+                                     "[[:blank:]\n]*\\'") ; trailing new-lines
+                             "" (lm-commentary))))
                   ('tar nil))) ;; FIXME: Get it from the README file.
                (extras (package-desc-extras pkg-desc))
 	       (pkg-version (package-version-join split-version))

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable



Footnotes:=20
[1]  I=E2=80=99ve implemented that in bug#37546.

--=20
 88888  FFFFF Bruno F=C3=A9lix Rezende Ribeiro (oitofelix) [0x28D618AF]
 8   8  F     http://oitofelix.freeshell.org/
 88888  FFFF  mailto:oitofelix@HIDDEN
 8   8  F     irc://chat.freenode.org/oitofelix
 88888  F     xmpp://oitofelix@HIDDEN


--=-=-=--




Acknowledgement sent to Bruno Félix Rezende Ribeiro <oitofelix@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#37548; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.