From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Emacs load path Date: Fri, 01 Jan 2016 19:28:50 +0300 Message-ID: <87poxl1cxp.fsf@gmail.com> References: <87io3frjcd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aF2ZS-0007Ec-N5 for guix-devel@gnu.org; Fri, 01 Jan 2016 11:28:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aF2ZO-0000FI-0x for guix-devel@gnu.org; Fri, 01 Jan 2016 11:28:54 -0500 In-Reply-To: (Federico Beffa's message of "Fri, 1 Jan 2016 15:25:27 +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 , KAction@gnu.org Federico Beffa (2016-01-01 17:25 +0300) wrote: > On Wed, Dec 30, 2015 at 5:55 PM, Federico Beffa wrote: >> On Wed, Dec 30, 2015 at 5:29 PM, Ludovic Court=C3=A8s wro= te: >>> Federico Beffa 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=E2=80=99t see how to make that happen automatically on foreign di= stros. >>> Any ideas? >>> >>> We still have the option of making it more prominent in the >>> documentation, for example by mentioning specifically Emacs under >>> . >>> >>> Thoughts? >> >> If we make an 'emacs-guix' package and make it an input to emacs it shou= ld work. > > Attached is a proof of concept patch showing one way to do it. > > If you don't want to add the full 'guix.el', then we should definitely > add code in a similar way to instruct emacs to look in the right > places (".../guix.d") for our emacs packages out of the box. As > Dmitry rightfully points out, having emacs packages which do not work > out of the box is just a bug. Not for me! As a user, I always want to have pure upstream packages if possible, without unnecessary modifications made by package maintainers. Such modifications have an intention to make users life easier, but in fact they are often a pain that I'd like to get rid of. I only talk about my own experience (most of the times I'm for simplicity and against "full-feature"-ness). [...] > @@ -78,14 +79,32 @@ > (patches (list (search-patch "emacs-exec-path.patch"))))) > (build-system glib-or-gtk-build-system) > (arguments > - '(#:phases (alist-cons-before > - 'configure 'fix-/bin/pwd > - (lambda _ > - ;; Use `pwd', not `/bin/pwd'. > - (substitute* (find-files "." "^Makefile\\.in$") > - (("/bin/pwd") > - "pwd"))) > - %standard-phases))) > + `(#:modules ((guix build glib-or-gtk-build-system) > + (guix build utils) > + (srfi srfi-26)) > + #:phases > + (modify-phases %standard-phases > + (add-before 'configure 'fix-/bin/pwd > + (lambda _ > + ;; Use `pwd', not `/bin/pwd'. > + (substitute* (find-files "." "^Makefile\\.in$") > + (("/bin/pwd") > + "pwd")))) > + (add-after 'install 'install-guix-el > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let* ((guix-src (assoc-ref inputs "guix-src")) > + (out (assoc-ref outputs "out")) > + (site-lisp (string-append out "/share/emacs/" > + ,(version-major+minor ve= rsion) > + "/site-lisp")) > + (unpack (assoc-ref %standard-phases 'unpack))) > + (mkdir "guix") > + (with-directory-excursion "guix" > + (apply unpack (list #:source guix-src)) > + ;; FIXME: configure and byte-compile guix.el before i= nstalling > + (for-each (cut install-file <> site-lisp) > + (find-files "emacs" "\\.el"))) > + #t)))))) Sorry, I didn't try it, but IIUC this just adds guix elisp files to a site-lisp directory, right? But a user still have to use (require 'guix-init), so this shouldn't work out of the box, or do I miss anything? --=20 Alex