From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#37548: Implement sanitation of single-file package long description Date: Mon, 30 Sep 2019 19:27:14 +0200 Message-ID: References: <87eezzwtcx.fsf@oitofelix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="123103"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37548@debbugs.gnu.org To: Bruno =?UTF-8?Q?F=C3=A9lix?= Rezende Ribeiro Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 30 19:28:19 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEzT8-000VtA-S3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2019 19:28:18 +0200 Original-Received: from localhost ([::1]:55496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEzT7-0001Cw-5t for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2019 13:28:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49949) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEzSx-0001AP-9j for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 13:28:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEzSv-0003nf-9o for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 13:28:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51618) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iEzSr-0003mv-RY for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 13:28:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iEzSr-0000hw-LJ for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 13:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2019 17:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37548 X-GNU-PR-Package: emacs Original-Received: via spool by 37548-submit@debbugs.gnu.org id=B37548.15698644542681 (code B ref 37548); Mon, 30 Sep 2019 17:28:01 +0000 Original-Received: (at 37548) by debbugs.gnu.org; 30 Sep 2019 17:27:34 +0000 Original-Received: from localhost ([127.0.0.1]:60438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEzSQ-0000hB-6h for submit@debbugs.gnu.org; Mon, 30 Sep 2019 13:27:34 -0400 Original-Received: from mail-pf1-f178.google.com ([209.85.210.178]:33290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEzSO-0000gw-8l for 37548@debbugs.gnu.org; Mon, 30 Sep 2019 13:27:32 -0400 Original-Received: by mail-pf1-f178.google.com with SMTP id q10so6005335pfl.0 for <37548@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) In-Reply-To: <87eezzwtcx.fsf@oitofelix.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167933 Archived-At: Bruno F=C3=A9lix Rezende Ribeiro 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