From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Emacs load path Date: Tue, 05 Jan 2016 12:40:47 +0300 Message-ID: <874mes1i00.fsf@gmail.com> References: <87io3frjcd.fsf@gnu.org> <87ziwpjpd9.fsf@gnu.org> <87oad51cxj.fsf@gmail.com> <87wprsgjc7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGO6n-00053x-EL for guix-devel@gnu.org; Tue, 05 Jan 2016 04:40:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGO6k-0006T1-38 for guix-devel@gnu.org; Tue, 05 Jan 2016 04:40:53 -0500 In-Reply-To: (Federico Beffa's message of "Mon, 4 Jan 2016 11:18:52 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Federico Beffa Cc: Guix-devel --=-=-= Content-Type: text/plain Federico Beffa (2016-01-04 13:18 +0300) wrote: > On Sat, Jan 2, 2016 at 3:13 PM, Alex Kost 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 >> , 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. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-emacs-Add-site-start.el.patch Content-Transfer-Encoding: quoted-printable >From dcc0497afa74f5c614d086773a86615b546c0448 Mon Sep 17 00:00:00 2001 From: Alex Kost 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 =C2=A9 2014, 2015 Alex Kost +# Copyright =C2=A9 2014, 2015, 2016 Alex Kost # # This file is part of GNU Guix. # @@ -47,7 +47,8 @@ ELFILES =3D \ 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 =20 if HAVE_EMACS =20 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)) --=20 2.6.3 --=-=-=--