GNU bug report logs - #36301
Package-Requires should support multiple lines

Previous Next

Package: emacs;

Reported by: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>

Date: Thu, 20 Jun 2019 02:14:01 UTC

Severity: wishlist

Done: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36301 in the body.
You can then email your comments to 36301 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#36301; Package emacs. (Thu, 20 Jun 2019 02:14:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Fitzsimmons <fitzsim <at> fitzsim.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 20 Jun 2019 02:14:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Package-Requires should support multiple lines
Date: Wed, 19 Jun 2019 21:55:27 -0400
Hi,

The Package-Requires line in my GNU ELPA package, Excorporate, is much
longer than 80 characters and I would like to wrap it.  It would be nice
if package.el allowed Package-Requires to span multiple lines (see
patch).  It's probably too late to change this but I thought I'd file a
bug report anyway.

Thomas

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 46f7c91272..5c9b12732d 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1016,7 +1016,8 @@ package-buffer-info
     (narrow-to-region start (point))
     (require 'lisp-mnt)
     ;; Use some headers we've invented to drive the process.
-    (let* ((requires-str (lm-header "package-requires"))
+    (let* ((requires-str
+            (mapconcat 'identity (lm-header-multiline "package-requires") " "))
            ;; Prefer Package-Version; if defined, the package author
            ;; probably wants us to use it.  Otherwise try Version.
            (pkg-version




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36301; Package emacs. (Thu, 20 Jun 2019 11:37:01 GMT) Full text and rfc822 format available.

Message #8 received at 36301 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Cc: 36301 <at> debbugs.gnu.org
Subject: Re: bug#36301: Package-Requires should support multiple lines
Date: Thu, 20 Jun 2019 07:36:10 -0400
severity 36301 wishlist
quit

Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:

> The Package-Requires line in my GNU ELPA package, Excorporate, is much
> longer than 80 characters and I would like to wrap it.  It would be nice
> if package.el allowed Package-Requires to span multiple lines (see
> patch).  It's probably too late to change this but I thought I'd file a
> bug report anyway.

I don't see a problem with changing it now, except that you won't be
able to actually wrap the Package-Requires line in Excorporate until
that package requires Emacs 27 or later.




Severity set to 'wishlist' from 'normal' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 20 Jun 2019 11:37:02 GMT) Full text and rfc822 format available.

Reply sent to Thomas Fitzsimmons <fitzsim <at> fitzsim.org>:
You have taken responsibility. (Fri, 16 Aug 2019 04:04:01 GMT) Full text and rfc822 format available.

Notification sent to Thomas Fitzsimmons <fitzsim <at> fitzsim.org>:
bug acknowledged by developer. (Fri, 16 Aug 2019 04:04:02 GMT) Full text and rfc822 format available.

Message #15 received at 36301-done <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 36301-done <at> debbugs.gnu.org
Subject: Re: bug#36301: Package-Requires should support multiple lines
Date: Fri, 16 Aug 2019 00:03:40 -0400
Noam Postavsky <npostavs <at> gmail.com> writes:

> severity 36301 wishlist
> quit
>
> Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:
>
>> The Package-Requires line in my GNU ELPA package, Excorporate, is much
>> longer than 80 characters and I would like to wrap it.  It would be nice
>> if package.el allowed Package-Requires to span multiple lines (see
>> patch).  It's probably too late to change this but I thought I'd file a
>> bug report anyway.
>
> I don't see a problem with changing it now, except that you won't be
> able to actually wrap the Package-Requires line in Excorporate until
> that package requires Emacs 27 or later.

OK, I pushed the change to master.

Thanks,
Thomas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36301; Package emacs. (Fri, 16 Aug 2019 16:05:01 GMT) Full text and rfc822 format available.

Message #18 received at 36301 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 36301 <at> debbugs.gnu.org
Cc: fitzsim <at> fitzsim.org
Subject: Re: bug#36301: Package-Requires should support multiple lines
Date: Fri, 16 Aug 2019 12:03:55 -0400
This causes test failures; ref
https://hydra.nixos.org/build/98765298




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36301; Package emacs. (Fri, 16 Aug 2019 16:23:02 GMT) Full text and rfc822 format available.

Message #21 received at 36301 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 36301 <at> debbugs.gnu.org
Subject: Re: bug#36301: Package-Requires should support multiple lines
Date: Fri, 16 Aug 2019 12:22:33 -0400
Glenn Morris <rgm <at> gnu.org> writes:

> This causes test failures; ref
> https://hydra.nixos.org/build/98765298

reopen 36301

OK, thanks for reporting.  I reverted the patch for now.

Thomas




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 16 Aug 2019 16:27:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36301; Package emacs. (Fri, 16 Aug 2019 21:43:01 GMT) Full text and rfc822 format available.

Message #26 received at 36301 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 36301 <at> debbugs.gnu.org
Subject: Re: bug#36301: Package-Requires should support multiple lines
Date: Fri, 16 Aug 2019 17:42:14 -0400
Hi,

Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:

> Glenn Morris <rgm <at> gnu.org> writes:
>
>> This causes test failures; ref
>> https://hydra.nixos.org/build/98765298
>
> OK, thanks for reporting.  I reverted the patch for now.

Here is the updated patch that fixes the test failures the prior one
introduced.  "make check" still fails with and without the patch, but
only on some unrelated Tramp and D-Bus tests.  If this looks OK, I'll
push it to master; in particular I wonder if there's a better way to do
the equivalent of mapconcat but produce nil on a nil input sequence.

Thanks,
Thomas

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index a72522ad8f..b0416cb002 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1028,6 +1028,7 @@ package--prepare-dependencies
               deps))))
 
 (declare-function lm-header "lisp-mnt" (header))
+(declare-function lm-header-multiline "lisp-mnt" (header))
 (declare-function lm-homepage "lisp-mnt" (&optional file))
 (declare-function lm-keywords-list "lisp-mnt" (&optional file))
 (declare-function lm-maintainer "lisp-mnt" (&optional file))
@@ -1054,7 +1055,9 @@ package-buffer-info
     (narrow-to-region start (point))
     (require 'lisp-mnt)
     ;; Use some headers we've invented to drive the process.
-    (let* ((requires-str (lm-header "package-requires"))
+    (let* ((requires-str (lm-header-multiline "package-requires"))
+           (requires-str (when requires-str
+                           (mapconcat 'identity requires-str " ")))
            ;; Prefer Package-Version; if defined, the package author
            ;; probably wants us to use it.  Otherwise try Version.
            (pkg-version




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36301; Package emacs. (Tue, 20 Aug 2019 13:30:02 GMT) Full text and rfc822 format available.

Message #29 received at 36301 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Cc: 36301 <at> debbugs.gnu.org, Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#36301: Package-Requires should support multiple lines
Date: Tue, 20 Aug 2019 09:29:07 -0400
Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:
> I wonder if there's a better way to do the equivalent of mapconcat but
> produce nil on a nil input sequence.

Not exactly, but I think this is good place for and-let*:

--- i/lisp/emacs-lisp/package.el
+++ w/lisp/emacs-lisp/package.el
@@ -1028,6 +1028,7 @@ package--prepare-dependencies
               deps))))
 
 (declare-function lm-header "lisp-mnt" (header))
+(declare-function lm-header-multiline "lisp-mnt" (header))
 (declare-function lm-homepage "lisp-mnt" (&optional file))
 (declare-function lm-keywords-list "lisp-mnt" (&optional file))
 (declare-function lm-maintainer "lisp-mnt" (&optional file))
@@ -1054,8 +1055,7 @@ package-buffer-info
     (narrow-to-region start (point))
     (require 'lisp-mnt)
     ;; Use some headers we've invented to drive the process.
-    (let* ((requires-str (lm-header "package-requires"))
-           ;; Prefer Package-Version; if defined, the package author
+    (let* (;; Prefer Package-Version; if defined, the package author
            ;; probably wants us to use it.  Otherwise try Version.
            (pkg-version
             (or (package-strip-rcs-id (lm-header "package-version"))
@@ -1067,9 +1067,9 @@ package-buffer-info
             "Package lacks a \"Version\" or \"Package-Version\" header"))
       (package-desc-from-define
        file-name pkg-version desc
-       (if requires-str
-           (package--prepare-dependencies
-            (package-read-from-string requires-str)))
+       (and-let* ((require-lines (lm-header-multiline "package-requires")))
+         (package--prepare-dependencies
+          (package-read-from-string (mapconcat #'identity require-lines " "))))
        :kind 'single
        :url homepage
        :keywords keywords





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36301; Package emacs. (Sun, 01 Sep 2019 01:42:01 GMT) Full text and rfc822 format available.

Message #32 received at 36301 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 36301 <at> debbugs.gnu.org, Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#36301: Package-Requires should support multiple lines
Date: Sat, 31 Aug 2019 21:40:57 -0400
Noam Postavsky <npostavs <at> gmail.com> writes:

> Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:
>> I wonder if there's a better way to do the equivalent of mapconcat but
>> produce nil on a nil input sequence.
>
> Not exactly, but I think this is good place for and-let*:

Yes, looks good; "make check" passes on these tests, so I pushed this
new patch.  I'll wait for other test results before closing this.

Thanks,
Thomas




Reply sent to Thomas Fitzsimmons <fitzsim <at> fitzsim.org>:
You have taken responsibility. (Sun, 01 Sep 2019 17:35:02 GMT) Full text and rfc822 format available.

Notification sent to Thomas Fitzsimmons <fitzsim <at> fitzsim.org>:
bug acknowledged by developer. (Sun, 01 Sep 2019 17:35:02 GMT) Full text and rfc822 format available.

Message #37 received at 36301-done <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 36301-done <at> debbugs.gnu.org, Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#36301: Package-Requires should support multiple lines
Date: Sun, 01 Sep 2019 13:34:23 -0400
Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:

> Noam Postavsky <npostavs <at> gmail.com> writes:
>
>> Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:
>>> I wonder if there's a better way to do the equivalent of mapconcat but
>>> produce nil on a nil input sequence.
>>
>> Not exactly, but I think this is good place for and-let*:
>
> Yes, looks good; "make check" passes on these tests, so I pushed this
> new patch.  I'll wait for other test results before closing this.

The Hydra build succeeded too:

https://hydra.nixos.org/build/99577710

so I'm closing this.

Thanks,
Thomas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 30 Sep 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 208 days ago.

Previous Next


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