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

From: Oleg Pykhalov <[email-masked]>
Date: Thu, 21 Dec 2017 07:48:27 +0300

Hello Alex,

Alex Kost <[email-masked]> writes:

> Oleg Pykhalov (2017-12-20 06:26 +0300) wrote:

>> Yes, because "geiser" differs from most of Emacs packages:
>>
>>     ls
>> /gnu/store/7rl2k8ismmyq9ic6ha6vzv38a3hrrni2-emacs-dash-2.13.0/share/emacs/site-lisp/guix.d/dash-2.13.0/
>>     dash-autoloads.el  dash.el  dash.elc  dash-functional.el  dash-functional.elc
>>
>>     ls /gnu/store/7lh77fmapmjjv3kj2q69dy58kjniw9am-geiser-0.9/share/emacs/site-lisp/
>>     geiser-autodoc.el    geiser-chibi.elc	…
>>
>> Maybe we just need to fix "geiser"?
>
> Sorry, I don't understand what you mean.  What is wrong with geiser and
> why/how should it be fixed?

Elisp files of Geiser are in different place than others Emacs
packages.  There is no 'guix.d/geiser-0.9/'.

(for-each (match-lambda …) …) in 'setup-environment' will failed.

Either we need to handle this case specific for Geiser or just
change where it need to store Elisp files in 'geiser' package recipe.

> Also do other non-"emacs-" packages (magit, emms) have the same problem?

Hm,

    /gnu/store/k9zrrzpdw0mld0lqyackba3kwbw41ipr-emacs-emms-4.3/share/emacs/site-lisp/
    /gnu/store/zihybmvkccjb310fsxc2sad5j0w5vdi1-magit-2.11.0/share/emacs/stie-lisp/

it seems that it will be easier to handle a case without
'guix.d/PACKAGE-VERSION/'.

But I don't see a way to determine is magit an Emacs package, because
there is no "emacs-" prefix in "/gnu/store/…-magit-2.11.0".

'emacs-inputs' will not help.  See below.

>>> I think we shouldn't rely on the assumption that all emacs inputs have
>>> "emacs-" prefix
>>
>> Then, how to determine that a package is Emacs package?
>
> I don't know :-)  'emacs-inputs' is probably the best way.

No :-), it only relies on "emacs-" prefix in store.

emacs-inputs -> emacs-package? -> (string-prefix? "emacs-" name)

>> emacs inputs contain "emacs-minimal" and "source".
>> So we actually need to remove "emacs-minimal" instead "emacs".
>
> or maybe both? since some packages uses 'emacs' instead of
> 'emacs-minimal' (emacs-auctex, emacs-exwm, etc.).

Not both, because 'emacs-inputs' removes all inputs without "emacs-"
prefix, so 'emacs' too.

(emacs-inputs '(("emacs" . "/gnu/store/g1ldcr600kmdf2n1gsphk04hm30jr4bn-emacs-25.3")
                ("emacs-minimal" . "/gnu/store/p4smq1mw13lmpkdbs59d7w827hy7mvgy-emacs-minimal-25.3")))
$3 = (("emacs-minimal" . "/gnu/store/p4smq1mw13lmpkdbs59d7w827hy7mvgy-emacs-minimal-25.3"))

Thanks,
Oleg.