From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eROxg-0008Gq-Rz for guix-patches@gnu.org; Tue, 19 Dec 2017 15:58:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eROxe-0000tF-An for guix-patches@gnu.org; Tue, 19 Dec 2017 15:58:04 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:34037) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eROxe-0000t8-6l for guix-patches@gnu.org; Tue, 19 Dec 2017 15:58:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eROxd-0006yp-Vs for guix-patches@gnu.org; Tue, 19 Dec 2017 15:58:02 -0500 Subject: [bug#28832] [PATCH 1/3] gnu: Add emacs-json-reformat. Resent-Message-ID: From: Alex Kost References: <87lgke3vlz.fsf@gmail.com> <20171014102915.11778-1-go.wigust@gmail.com> <87y3o6uheo.fsf@gnu.org> <87d13yiw6w.fsf@gnu.org> <87609cluzf.fsf@gmail.com> <87zi6os3u3.fsf@gnu.org> <87fu8famhm.fsf@gmail.com> <877etofi3n.fsf@gmail.com> <87vah8hyxs.fsf@gnu.org> <87lghzyoyn.fsf@gmail.com> Date: Tue, 19 Dec 2017 23:57:33 +0300 In-Reply-To: <87lghzyoyn.fsf@gmail.com> (Oleg Pykhalov's message of "Tue, 19 Dec 2017 13:46:56 +0300") Message-ID: <878tdy1lmq.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Oleg Pykhalov Cc: 28832@debbugs.gnu.org Oleg Pykhalov (2017-12-19 13:46 +0300) wrote: [...] > + (for-each (match-lambda > + ((name . input) > + (setenv "EMACSLOADPATH" > + (string-append > + (or (getenv "EMACSLOADPATH") "") > + ":" input %install-suffix "/" > + ((compose (lambda (name version) > + (string-append > + (string-drop name > + (string-length "emacs-")) I would move this code into its own 'string-drop-emacs' function (as you did in the previous patch) and I would make it more robust: there is a problem with this code: (string-drop "geiser" 6) does not return what you mean, and (string-drop "dash" 6) errors! I think we shouldn't rely on the assumption that all emacs inputs have "emacs-" prefix, so I think this procedure should check whether the input name begins with "emacs-" before trying to remove this substring. > + "-" version)) > + name+version) > + input))))) > + (fold alist-delete (emacs-inputs inputs) '("emacs" "source"))) Since you already take only emacs inputs, is it really needed to remove "emacs" and "source"? I mean emacs inputs do not contain "emacs" and "source" anyway, right? -- Alex