From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#36301: Package-Requires should support multiple lines Date: Tue, 20 Aug 2019 09:29:07 -0400 Message-ID: <85v9usj78c.fsf@gmail.com> References: <87d0j8wkt1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="122474"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) Cc: 36301@debbugs.gnu.org To: Thomas Fitzsimmons Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 20 15:30:22 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 1i04DN-000Vk2-IZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Aug 2019 15:30:21 +0200 Original-Received: from localhost ([::1]:37516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i04DK-0006CT-F4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Aug 2019 09:30:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44933) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i04D5-0006B7-Q0 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 09:30:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i04D4-0005Ww-N8 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 09:30:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52163) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i04D4-0005WY-Jc for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 09:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i04D4-0005G2-E9 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 09:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Aug 2019 13:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36301 X-GNU-PR-Package: emacs Original-Received: via spool by 36301-submit@debbugs.gnu.org id=B36301.156630775720124 (code B ref 36301); Tue, 20 Aug 2019 13:30:02 +0000 Original-Received: (at 36301) by debbugs.gnu.org; 20 Aug 2019 13:29:17 +0000 Original-Received: from localhost ([127.0.0.1]:60984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i04CK-0005EW-MW for submit@debbugs.gnu.org; Tue, 20 Aug 2019 09:29:16 -0400 Original-Received: from mail-io1-f49.google.com ([209.85.166.49]:41603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i04CJ-0005EH-Kp for 36301@debbugs.gnu.org; Tue, 20 Aug 2019 09:29:16 -0400 Original-Received: by mail-io1-f49.google.com with SMTP id j5so12110521ioj.8 for <36301@debbugs.gnu.org>; Tue, 20 Aug 2019 06:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=CIN2tLnlaHvTCTfcP8ATrHibdcnO6cLL0ZezfdeBOwE=; b=Wif/0zUME20/+a8BkbJa/NdTPuhwfl/3uA/iZTs75YRmHY093aTSMSrToaRC+Bp3/M D/cPZqTc0Khf6kYj3eSKoGWwmEY4KYbfLKYdlUy5WPK3Q+vP9pISsRr+nOLRG8YLLq4D D6SNckljEPOSg15IfIeybbtA0rbNEn6aDTLX60SkdjZcZuRxvdmX1peGND9cPdmmJdSs PCk0lKE73J49/+eIvktQcvxxSPBebk1eQbDTb8Q+bRz8ouDtB5HodrKLkmQwGgmQBMlS ptp4NigTiSboTzHNB+o1qSLyLKM3v7s+gfyBwFr3Qo9MzNImP0wysXWKhgzDhmnr+44k 4gRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=CIN2tLnlaHvTCTfcP8ATrHibdcnO6cLL0ZezfdeBOwE=; b=lKu1sgpxVelYKaIjt0dLoh2S1BX+weQrsoDnCyyOwt5VocvmJoe3m59y8qVuN8qVvS 7pxCKWBy/RyiJvG+ZZ83U7GFFlkvFWvAPMcPXWNEr+1nCIQ8b654TunW4lUCEers5GJ0 DiiVkrnK/M2H9K9EJV77qfJP3QQb5I8cOgsu/9VVi9HV6+ydks8+59mWYXUeoKqw1sE7 MiFrodI7llWr3mOC864mrugMu7yC/S4PGdNSIv1x9NHTQ7rvmIMMpa+Mq7NOY1mDePcE d1TuHhf4HNlmrO/qqgQtzm8RCUYOX4IlHUsUI6FEe/pWxRZ4H/tFuVwR4dXnS7dWR8JS 18GQ== X-Gm-Message-State: APjAAAXRK/h9TWSaaq/oIzBc1dIoEevuNJ3BG6cehOTYX+4tnBRqtVm1 3u5RFnoFRw8pI+HDLyE+r+DXu6ST X-Google-Smtp-Source: APXvYqwyG6lSh9+3g208iLzutqBDxMa9CspmTB5Drl5Dp6wKWwMDf0dYDf1KFwBxhJig0o1CBlhakg== X-Received: by 2002:a5d:8049:: with SMTP id b9mr16155594ior.199.1566307749783; Tue, 20 Aug 2019 06:29:09 -0700 (PDT) Original-Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id q3sm11653522ios.70.2019.08.20.06.29.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Aug 2019 06:29:07 -0700 (PDT) In-Reply-To: (Thomas Fitzsimmons's message of "Fri, 16 Aug 2019 17:42:14 -0400") 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:165410 Archived-At: Thomas Fitzsimmons 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