Ludovic Courtès (2015-12-30 19:29 +0300) wrote:

> Federico Beffa <be...@ieee.org> skribis:
>
>> If you install guix in the default prefix (/usr/local) you should find a
>> file called 'guix.el' in /usr/local/share/emacs/site-lisp/.  With that
>> you can include the following commands in your .emacs file and you
>> should be all set:
>>
>> 1. (setq load-path (append '("/usr/local/share/emacs/site-lisp/") load-path))
>> 2. (require 'guix-init nil t)
>>
>> On some host distros step 1. may not even be needed.
>
> I don’t see how to make that happen automatically on foreign distros.
> Any ideas?

No ideas.

> We still have the option of making it more prominent in the
> documentation, for example by mentioning specifically Emacs under
> <https://www.gnu.org/software/guix/manual/html_node/Application-Setup.html>.

I also think we should mention Emacs packages in the manual.  What about
the attached patch?

>From 938e45e104b55b32d6c2423543c18efc7dc9365a Mon Sep 17 00:00:00 2001
From: Alex Kost <alez...@gmail.com>
Date: Fri, 1 Jan 2016 01:37:45 +0300
Subject: [PATCH] doc: Describe how to configure Emacs packages.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Suggested by Ludovic Courtès <l...@gnu.org>.

* doc/guix.texi (Application Setup)[Emacs Packages]: New subsection.
---
 doc/guix.texi | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index c45f1c8..a8cdac8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -1035,6 +1035,31 @@ for Chinese languages:
 guix package -i font-adobe-source-han-sans:cn
 @end example
 
+@subsection Emacs Packages
+
+When you install Emacs packages with Guix, the elisp files may be placed
+either in @file{$HOME/.guix-profile/share/emacs/site-lisp/} or in
+sub-directories of
+@file{$HOME/.guix-profile/share/emacs/site-lisp/guix.d/}.  The latter
+directory exists because potentially there may exist thousands of Emacs
+packages and storing all their files in a single directory may be not
+reliable (because of name conflicts).  So we think using a separate
+directory for each package is a good idea.  It is very similar to how
+Emacs package system organizes the file structure (@pxref{Package
+Files,,, emacs, The GNU Emacs Manual}).
+
+So, to let Emacs ``know'' where these package are placed (i.e., to add
+required directories to @code{load-path} and to load
+@file{@dots{}-autoloads.el} files), you can set up the elisp code that
+comes with Guix.  It should look like this:
+
+@example
+(add-to-list 'load-path "/path/to/guix-emacs-directory")
+(require 'guix-init nil t)
+@end example
+
+@xref{Emacs Initial Setup}, for more information.
+
 @c TODO What else?
 
 @c *********************************************************************
-- 
2.6.3

Reply via email to