unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36301: Package-Requires should support multiple lines
@ 2019-06-20  1:55 Thomas Fitzsimmons
  2019-06-20 11:36 ` Noam Postavsky
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Fitzsimmons @ 2019-06-20  1:55 UTC (permalink / raw)
  To: 36301

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





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#36301: Package-Requires should support multiple lines
  2019-06-20  1:55 bug#36301: Package-Requires should support multiple lines Thomas Fitzsimmons
@ 2019-06-20 11:36 ` Noam Postavsky
  2019-08-16  4:03   ` Thomas Fitzsimmons
  0 siblings, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2019-06-20 11:36 UTC (permalink / raw)
  To: Thomas Fitzsimmons; +Cc: 36301

severity 36301 wishlist
quit

Thomas Fitzsimmons <fitzsim@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#36301: Package-Requires should support multiple lines
  2019-06-20 11:36 ` Noam Postavsky
@ 2019-08-16  4:03   ` Thomas Fitzsimmons
  2019-08-16 16:03     ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Fitzsimmons @ 2019-08-16  4:03 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 36301-done

Noam Postavsky <npostavs@gmail.com> writes:

> severity 36301 wishlist
> quit
>
> Thomas Fitzsimmons <fitzsim@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#36301: Package-Requires should support multiple lines
  2019-08-16  4:03   ` Thomas Fitzsimmons
@ 2019-08-16 16:03     ` Glenn Morris
  2019-08-16 16:22       ` Thomas Fitzsimmons
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2019-08-16 16:03 UTC (permalink / raw)
  To: 36301; +Cc: fitzsim


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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#36301: Package-Requires should support multiple lines
  2019-08-16 16:03     ` Glenn Morris
@ 2019-08-16 16:22       ` Thomas Fitzsimmons
  2019-08-16 21:42         ` Thomas Fitzsimmons
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Fitzsimmons @ 2019-08-16 16:22 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 36301

Glenn Morris <rgm@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#36301: Package-Requires should support multiple lines
  2019-08-16 16:22       ` Thomas Fitzsimmons
@ 2019-08-16 21:42         ` Thomas Fitzsimmons
  2019-08-20 13:29           ` Noam Postavsky
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Fitzsimmons @ 2019-08-16 21:42 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 36301

Hi,

Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:

> Glenn Morris <rgm@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





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#36301: Package-Requires should support multiple lines
  2019-08-16 21:42         ` Thomas Fitzsimmons
@ 2019-08-20 13:29           ` Noam Postavsky
  2019-09-01  1:40             ` Thomas Fitzsimmons
  0 siblings, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2019-08-20 13:29 UTC (permalink / raw)
  To: Thomas Fitzsimmons; +Cc: 36301

Thomas Fitzsimmons <fitzsim@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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#36301: Package-Requires should support multiple lines
  2019-08-20 13:29           ` Noam Postavsky
@ 2019-09-01  1:40             ` Thomas Fitzsimmons
  2019-09-01 17:34               ` Thomas Fitzsimmons
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Fitzsimmons @ 2019-09-01  1:40 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 36301

Noam Postavsky <npostavs@gmail.com> writes:

> Thomas Fitzsimmons <fitzsim@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#36301: Package-Requires should support multiple lines
  2019-09-01  1:40             ` Thomas Fitzsimmons
@ 2019-09-01 17:34               ` Thomas Fitzsimmons
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Fitzsimmons @ 2019-09-01 17:34 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 36301-done

Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:

> Noam Postavsky <npostavs@gmail.com> writes:
>
>> Thomas Fitzsimmons <fitzsim@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-09-01 17:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-20  1:55 bug#36301: Package-Requires should support multiple lines Thomas Fitzsimmons
2019-06-20 11:36 ` Noam Postavsky
2019-08-16  4:03   ` Thomas Fitzsimmons
2019-08-16 16:03     ` Glenn Morris
2019-08-16 16:22       ` Thomas Fitzsimmons
2019-08-16 21:42         ` Thomas Fitzsimmons
2019-08-20 13:29           ` Noam Postavsky
2019-09-01  1:40             ` Thomas Fitzsimmons
2019-09-01 17:34               ` Thomas Fitzsimmons

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).