Subject: Re: [bug#28832] [PATCH 1/3] gnu: Add emacs-json-reformat.

From: Alex Kost <[email-masked]>
Date: Tue, 19 Dec 2017 23:57:33 +0300

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