diff mbox

gnu: emacs: Install site-start.el in non-versioned directory.

Message ID 87k2geyk7t.fsf@gmail.com
State New
Headers show

Commit Message

Alex Kost July 21, 2016, 5:28 p.m. UTC
Ricardo tested Emacs 25 with this package definition:
<http://paste.lisp.org/display/320941> and noticed that it doesn't find
Emacs packages in ~/.guix-profile.

This happens because "site-start.el" in the inherited package is placed
"/share/emacs/24.5/site-lisp" directory (the version part is wrong).  To
avod this, we can put "site-start.el" into a non-versioned site-lisp
directory.  The patch is attached.

Comments

Ricardo Wurmus July 24, 2016, 5:06 a.m. UTC | #1
Alex Kost <alezost@gmail.com> writes:

> Ricardo tested Emacs 25 with this package definition:
> <http://paste.lisp.org/display/320941> and noticed that it doesn't find
> Emacs packages in ~/.guix-profile.
>
> This happens because "site-start.el" in the inherited package is placed
> "/share/emacs/24.5/site-lisp" directory (the version part is wrong).  To
> avod this, we can put "site-start.el" into a non-versioned site-lisp
> directory.  The patch is attached.

Thank you, Alex.

As far as I understand, the generated “site-start.el” file is
version-agnostic, so I think this is the right approach.

(I haven’t yet found the time to actually test your patch with my Emacs
25 package.)

~~ Ricardo
Alex Kost July 24, 2016, 6:16 a.m. UTC | #2
Ricardo Wurmus (2016-07-24 08:06 +0300) wrote:

> Alex Kost <alezost@gmail.com> writes:
>
>> Ricardo tested Emacs 25 with this package definition:
>> <http://paste.lisp.org/display/320941> and noticed that it doesn't find
>> Emacs packages in ~/.guix-profile.
>>
>> This happens because "site-start.el" in the inherited package is placed
>> "/share/emacs/24.5/site-lisp" directory (the version part is wrong).  To
>> avod this, we can put "site-start.el" into a non-versioned site-lisp
>> directory.  The patch is attached.
>
> Thank you, Alex.
>
> As far as I understand, the generated “site-start.el” file is
> version-agnostic, so I think this is the right approach.

Yes, the code to find guix packages doesn't care about Emacs version.

> (I haven’t yet found the time to actually test your patch with my Emacs
> 25 package.)

I tested it :-)  So I'm going to commit it soon.
Alex Kost July 25, 2016, 2:24 p.m. UTC | #3
Alex Kost (2016-07-24 09:16 +0300) wrote:

> Ricardo Wurmus (2016-07-24 08:06 +0300) wrote:
>
>> Alex Kost <alezost@gmail.com> writes:
>>
>>> Ricardo tested Emacs 25 with this package definition:
>>> <http://paste.lisp.org/display/320941> and noticed that it doesn't find
>>> Emacs packages in ~/.guix-profile.
>>>
>>> This happens because "site-start.el" in the inherited package is placed
>>> "/share/emacs/24.5/site-lisp" directory (the version part is wrong).  To
>>> avod this, we can put "site-start.el" into a non-versioned site-lisp
>>> directory.  The patch is attached.
>>
>> Thank you, Alex.
>>
>> As far as I understand, the generated “site-start.el” file is
>> version-agnostic, so I think this is the right approach.
>
> Yes, the code to find guix packages doesn't care about Emacs version.
>
>> (I haven’t yet found the time to actually test your patch with my Emacs
>> 25 package.)
>
> I tested it :-)  So I'm going to commit it soon.

Committed as c48899e.
diff mbox

Patch

From 5907c4768bdba861e1c30b1cb5f0a73fe33f9600 Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Thu, 21 Jul 2016 20:13:27 +0300
Subject: [PATCH] gnu: emacs: Install site-start.el in non-versioned directory.

Reported by Ricardo Wurmus on #guix.

* gnu/packages/emacs.scm (emacs)[arguments]: Put "site-start.el" in
"/share/emacs/site-lisp" instead of "/share/emacs/<version>/site-lisp"
to let inherited package with another version find it.
---
 gnu/packages/emacs.scm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 3fcf121..eed64f4 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -125,9 +125,7 @@ 
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((guix-src (assoc-ref inputs "guix-src"))
                     (out      (assoc-ref outputs "out"))
-                    (lisp-dir (string-append out "/share/emacs/"
-                                             ,(version-major+minor version)
-                                             "/site-lisp"))
+                    (lisp-dir (string-append out "/share/emacs/site-lisp"))
                     (unpack   (assoc-ref %standard-phases 'unpack)))
                (mkdir "guix")
                (with-directory-excursion "guix"
-- 
2.8.3