all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: Federico Beffa <beffa@ieee.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Emacs load path
Date: Tue, 05 Jan 2016 12:40:47 +0300	[thread overview]
Message-ID: <874mes1i00.fsf@gmail.com> (raw)
In-Reply-To: <CAKrPhPPFOHFQdw6tjEotFZGTxiyEv63s5LAz=c05e5A-9_Oc1Q@mail.gmail.com> (Federico Beffa's message of "Mon, 4 Jan 2016 11:18:52 +0100")

[-- Attachment #1: Type: text/plain, Size: 1891 bytes --]

Federico Beffa (2016-01-04 13:18 +0300) wrote:

> On Sat, Jan 2, 2016 at 3:13 PM, Alex Kost <alezost@gmail.com> wrote:
>> Federico Beffa (2016-01-01 19:53 +0300) wrote:
[...]
>>> there's no 'guix-config.el', but only 'guix-config.el.in'. It would be
>>> great if you could provide a working patch.
>>
>> Hm, OK, so your "proof of concept patch" will have the same problem.
>> Could you please answer
>> <http://lists.gnu.org/archive/html/guix-devel/2016-01/msg00021.html>, as
>> I still don't understand how your suggestion can help Emacs to find
>> packages in "guix.d" dirs of user profile.
>
> That's the easy part. Once we know how to load a minimal version of
> your code, we add it to 'site-start.el'. Emacs automatically loads it.

Ah, now I see what you mean, thanks!  And emacs can be started with
"--no-site-file" so my concerns about avoiding this are fulfilled.  For
simplicity, we can even add "site-start.el" to the guix repo I think.

>> Returning to 'guix-config' problem, we can make a "soft" dependency on
>> 'guix-profiles' (see the attached patch), so the only file needed for
>> finding emacs packages in "guix.d" will be "guix-emacs.el".  And the
>> code that should be loaded by Emacs to find guix emacs packages will be:
>>
>> (when (require 'guix-emacs nil t)
>>   (add-to-list 'load-path (guix-emacs-directory))
>>   (guix-emacs-load-autoloads))
>
> I've done this, but it doesn't load as 'guix-config' is missing. I
> guess it needs your patch which I didn't try.

Yes, it meant to be used with the patch.

So IIUC we need the following patches to make our Emacs find packages in
a user profile:

- patch for stripping "guix-emacs.el" from extra dependencies (attached
  to the previous message);

- patch for adding "site-start.el" (attached to this message);

- modified version of your patch to copy "site-start.el" and
  "guix-emacs.el" to the proper places.


[-- Attachment #2: 0001-emacs-Add-site-start.el.patch --]
[-- Type: text/x-patch, Size: 1340 bytes --]

From dcc0497afa74f5c614d086773a86615b546c0448 Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Tue, 5 Jan 2016 12:29:53 +0300
Subject: [PATCH] emacs: Add "site-start.el".

* emacs/site-start.el: New file.
* emacs.am (ELFILES): Add it.
---
 emacs.am            | 5 +++--
 emacs/site-start.el | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)
 create mode 100644 emacs/site-start.el

diff --git a/emacs.am b/emacs.am
index 85165b9..dcccb44 100644
--- a/emacs.am
+++ b/emacs.am
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
+# Copyright © 2014, 2015, 2016 Alex Kost <alezost@gmail.com>
 #
 # This file is part of GNU Guix.
 #
@@ -47,7 +47,8 @@ ELFILES =					\
   emacs/guix-ui.el				\
   emacs/guix-ui-package.el			\
   emacs/guix-ui-generation.el			\
-  emacs/guix-utils.el
+  emacs/guix-utils.el				\
+  emacs/site-start.el
 
 if HAVE_EMACS
 
diff --git a/emacs/site-start.el b/emacs/site-start.el
new file mode 100644
index 0000000..5242082
--- /dev/null
+++ b/emacs/site-start.el
@@ -0,0 +1,4 @@
+;; Autoload Emacs packages installed in ~/.guix-profile.
+(when (require 'guix-emacs nil t)
+  (add-to-list 'load-path (guix-emacs-directory))
+  (guix-emacs-load-autoloads))
-- 
2.6.3


  reply	other threads:[~2016-01-05  9:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-27 22:16 Emacs load path (was: Re: Multiple versions) Federico Beffa
2015-12-28 22:15 ` Emacs load path Alex Kost
2015-12-29  0:30   ` Taylan Ulrich Bayırlı/Kammer
2015-12-30 12:16   ` Federico Beffa
2015-12-30 18:55     ` Alex Kost
2015-12-30 22:18       ` Federico Beffa
2015-12-31  9:02         ` Alex Kost
2015-12-31  9:27           ` Federico Beffa
2015-12-31 20:45             ` Alex Kost
2015-12-30 16:29 ` Ludovic Courtès
2015-12-30 16:55   ` Federico Beffa
2016-01-01 14:25     ` Federico Beffa
2016-01-01 15:22       ` Ludovic Courtès
2016-01-01 16:28         ` Alex Kost
2016-01-01 16:53           ` Federico Beffa
2016-01-02 14:13             ` Alex Kost
2016-01-04 10:18               ` Federico Beffa
2016-01-05  9:40                 ` Alex Kost [this message]
2016-01-05 13:21                   ` Federico Beffa
2016-01-06 16:56                     ` Alex Kost
2016-01-01 16:28       ` Alex Kost
2015-12-31 22:47   ` Alex Kost
2016-01-01 15:24     ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2015-12-26 23:02 Multiple versions Dmitry Bogatov
2015-12-27 14:11 ` Alex Kost
2015-12-27 16:47   ` Emacs load path (was: Re: Multiple versions) Dmitry Bogatov
2015-12-27 21:42     ` Emacs load path Alex Kost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874mes1i00.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=beffa@ieee.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.