unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: "Bruno Félix Rezende Ribeiro" <oitofelix@gnu.org>
Cc: 37548@debbugs.gnu.org
Subject: bug#37548: Implement sanitation of single-file package long description
Date: Mon, 30 Sep 2019 19:27:14 +0200	[thread overview]
Message-ID: <CADwFkm=mHf1BY=d628dJv1vwhTwQWpBq=34VB4LpaSVZrEPgLg@mail.gmail.com> (raw)
In-Reply-To: <87eezzwtcx.fsf@oitofelix.com>

Bruno Félix Rezende Ribeiro <oitofelix@gnu.org> writes:

> Hello Emacs developers,

Hi Bruno,

And thanks for your patch.

> The inlined patch implements sanitation of single-file package’s long
> description which is derived from the package’s 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’s 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.

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





  reply	other threads:[~2019-09-30 17:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-29  5:42 bug#37548: Implement sanitation of single-file package long description Bruno Félix Rezende Ribeiro
2019-09-30 17:27 ` Stefan Kangas [this message]
2019-09-30 17:39   ` Stefan Kangas
2019-10-08  8:36     ` Bruno Félix Rezende Ribeiro
2019-10-08  8:40       ` Eli Zaretskii
2019-11-11 19:02       ` Stefan Kangas
2019-11-14 11:28         ` Eli Zaretskii
2020-01-23 20:56         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkm=mHf1BY=d628dJv1vwhTwQWpBq=34VB4LpaSVZrEPgLg@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=37548@debbugs.gnu.org \
    --cc=oitofelix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).