From mboxrd@z Thu Jan 1 00:00:00 1970 From: Federico Beffa Subject: Re: Emacs load path Date: Mon, 4 Jan 2016 11:18:52 +0100 Message-ID: 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=001a11426040a08d0f05287f72b6 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aG2E3-0003LC-29 for guix-devel@gnu.org; Mon, 04 Jan 2016 05:18:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aG2E1-0001Tw-A9 for guix-devel@gnu.org; Mon, 04 Jan 2016 05:18:55 -0500 In-Reply-To: <87wprsgjc7.fsf@gmail.com> 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: Alex Kost Cc: Guix-devel , KAction@gnu.org --001a11426040a08d0f05287f72b6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Jan 2, 2016 at 3:13 PM, Alex Kost wrote: > Federico Beffa (2016-01-01 19:53 +0300) wrote: > >> On Fri, Jan 1, 2016 at 5:28 PM, Alex Kost wrote: >>> Ludovic Court=C3=A8s (2016-01-01 18:22 +0300) wrote: >>> >>>>> 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. >>>> >>>> Yeah. Alex, any idea how to add the guix.d subdirectories to the sear= ch >>>> path without duplicating all of guix.el in the =E2=80=98emacs=E2=80=99= package? >>> >>> Yeah, no need to duplicate all of the guix elisp files. Only >>> "guix-emacs.el" (and its dependencies: "guix-profiles.el" and >>> "guix-config.el") is needed. And instead of (require 'guix-init) the >>> following code should be used to "activate" our .guix.d directories: >> >> 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. > 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. Fede --001a11426040a08d0f05287f72b6 Content-Type: text/x-diff; charset=US-ASCII; name="0001-gnu-emacs-Add-guix.d-directories-to-load-path.patch" Content-Disposition: attachment; filename="0001-gnu-emacs-Add-guix.d-directories-to-load-path.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iizt5tbd1 RnJvbSA1ZDFhZGE5OThiZGI4NzU1ODQ1OTE0ZDI4NzU3ZDE0MmVkOGRlOGJmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBGZWRlcmljbyBCZWZmYSA8YmVmZmFAZmJlbmdpbmVlcmluZy5j aD4KRGF0ZTogRnJpLCAxIEphbiAyMDE2IDE1OjEyOjQwICswMTAwClN1YmplY3Q6IFtQQVRDSF0g Z251OiBlbWFjczogQWRkICdndWl4LmQnIGRpcmVjdG9yaWVzIHRvICdsb2FkLXBhdGgnLgoKKiBn bnUvcGFja2FnZXMvZW1hY3Muc2NtIChlbWFjcyk6IENvbnZlcnQgdG8gJ21vZGlmeS1waGFzZXMn IHN5bnRheC4gIEFkZAogICdndWl4LXNyYycgaW5wdX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XJlICdmaXgtL2Jp bi9wd2QKLSAgICAgICAgICAgICAgICAgKGxhbWJkYSBfCi0gICAgICAgICAgICAgICAgICAgOzsg VXNlIGBwd2QnLCBub3QgYC9iaW4vcHdkJy4KLSAgICAgICAgICAgICAgICAgICAoc3Vic3RpdHV0 ZSogKGZpbmQtZmlsZXMgIi4iICJeTWFrZWZpbGVcXC5pbiQiKQotICAgICAgICAgICAgICAgICAg ICAgKCgiL2Jpbi9wd2QiKQotICAgICAgICAgICAgICAgICAgICAgICJwd2QiKSkpCi0gICAgICAg ICAgICAgICAgICVzdGFuZGFyZC1waGFzZXMpKSkKKyAgICAgYCgjOm1vZHVsZXMgKChndWl4IGJ1 aWxkIGdsaWItb3ItZ3RrLWJ1aWxkLXN5c3RlbSkKKyAgICAgICAgICAgICAgICAgIChndWl4IGJ1 aWxkIHV0aWxzKQorICAgICAgICAgICAgICAgICAgKHNyZmkgc3JmaS0yNikpCisgICAgICAgIzpw aGFzZXMKKyAgICAgICAobW9kaWZ5LXBoYXNlcyAlc3RhbmRhcmQtcGhhc2VzCisgICAgICAgICAo YWRkLWJlZm9yZSAnY29uZmlndXJlICdmaXgtL2Jpbi9wd2QKKyAgICAgICAgICAgKGxhbWJkYSBf CisgICAgICAgICAgICAgOzsgVXNlIGBwd2QnLCBub3QgYC9iaW4vcHdkJy4KKyAgICAgICAgICAg ICAoc3Vic3RpdHV0ZSogKGZpbmQtZmlsZXMgIi4iICJeTWFrZWZpbGVcXC5pbiQiKQorICAgICAg ICAgICAgICAgKCgiL2Jpbi9wd2QiKQorICAgICAgICAgICAgICAgICJwd2QiKSkpKQorICAgICAg ICAgKGFkZC1hZnRlciAnaW5zdGFsbCAnaW5zdGFsbC1ndWl4LWVtYWNzCisgICAgICAgICAgICAg KGxhbWJkYSogKCM6a2V5IGlucHV0cyBvdXRwdXRzICM6YWxsb3ctb3RoZXIta2V5cykKKyAgICAg ICAgICAgICAgIChsZXQqICgoZ3VpeC1zcmMgKGFzc29jLXJlZiBpbnB1dHMgImd1aXgtc3JjIikp CisgICAgICAgICAgICAgICAgICAgICAgKG91dCAoYXNzb2MtcmVmIG91dHB1dHMgIm91dCIpKQor ICAgICAgICAgICAgICAgICAgICAgIChzaXRlLWxpc3AgKHN0cmluZy1hcHBlbmQgb3V0ICIvc2hh cmUvZW1hY3MvIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLCh2ZXJzaW9uLW1ham9yK21pbm9yIHZlcnNpb24pCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAiL3NpdGUtbGlzcCIpKQorICAgICAgICAgICAgICAg ICAgICAgICh1bnBhY2sgKGFzc29jLXJlZiAlc3RhbmRhcmQtcGhhc2VzICd1bnBhY2spKSkKKyAg ICAgICAgICAgICAgICAgKG1rZGlyICJndWl4IikKKyAgICAgICAgICAgICAgICAgKHdpdGgtZGly ZWN0b3J5LWV4Y3Vyc2lvbiAiZ3VpeCIKKyAgICAgICAgICAgICAgICAgICAoYXBwbHkgdW5wYWNr IChsaXN0ICM6c291cmNlIGd1aXgtc3JjKSkKKyAgICAgICAgICAgICAgICAgICA7OyBGSVhNRTog bWlzcyBjbC1saWIKKyAgICAgICAgICAgICAgICAgICAoaW5zdGFsbC1maWxlICJlbWFjcy9ndWl4 LWVtYWNzLmVsIiBzaXRlLWxpc3ApKQorICAgICAgICAgICAgICAgICAod2l0aC1kaXJlY3Rvcnkt ZXhjdXJzaW9uIHNpdGUtbGlzcAorICAgICAgICAgICAgICAgICAgICh3aXRoLW91dHB1dC10by1m aWxlICJzaXRlLXN0YXJ0LmVsIgorICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoKQorICAg ICAgICAgICAgICAgICAgICAgICAoZGlzcGxheSAiKHdoZW4gKHJlcXVpcmUgJ2d1aXgtZW1hY3Mg bmlsIHQpCisgIChhZGQtdG8tbGlzdCAnbG9hZC1wYXRoIChndWl4LWVtYWNzLWRpcmVjdG9yeSkp CisgIChndWl4LWVtYWNzLWxvYWQtYXV0b2xvYWRzKSkiKSkpKQorICAgICAgICAgICAgICAgICAo emVybz8KKyAgICAgICAgICAgICAgICAgIChsZXQgKChleHByIGAoYnl0ZS1yZWNvbXBpbGUtZGly ZWN0b3J5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmaWxlLW5hbWUtYXMtZGly ZWN0b3J5ICxzaXRlLWxpc3ApIDApKSkKKyAgICAgICAgICAgICAgICAgICAgKHN5c3RlbSoKKyAg ICAgICAgICAgICAgICAgICAgIChzdHJpbmctYXBwZW5kIG91dCAiL2Jpbi9lbWFjcyIpICItLXF1 aWNrIiAiLS1iYXRjaCIKKyAgICAgICAgICAgICAgICAgICAgIChmb3JtYXQgI2YgIi0tZXZhbD1+ UyIgZXhwcikpKSkpKSkpKSkKICAgICAoaW5wdXRzCiAgICAgIGAoKCJnbnV0bHMiICxnbnV0bHMp CiAgICAgICAgKCJuY3Vyc2VzIiAsbmN1cnNlcykKQEAgLTExMCw3ICsxMzksOCBAQAogICAgICAg ICgibGliaWNlIiAsbGliaWNlKQogICAgICAgICgibGlic20iICxsaWJzbSkKICAgICAgICAoImFs c2EtbGliIiAsYWxzYS1saWIpCi0gICAgICAgKCJkYnVzIiAsZGJ1cykpKQorICAgICAgICgiZGJ1 cyIgLGRidXMpCisgICAgICAgKCJndWl4LXNyYyIgLChwYWNrYWdlLXNvdXJjZSBndWl4KSkpKQog ICAgIChuYXRpdmUtaW5wdXRzCiAgICAgIGAoKCJwa2ctY29uZmlnIiAscGtnLWNvbmZpZykKICAg ICAgICAoInRleGluZm8iICx0ZXhpbmZvKSkpCi0tIAoyLjYuMwoK --001a11426040a08d0f05287f72b6--