From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Emacs in multiple profiles Date: Sat, 24 Mar 2018 19:07:16 +0300 Message-ID: <874ll51mq3.fsf@gmail.com> References: <9c395fd0-9458-7894-af8b-9294d212c60b@fastmail.net> <878tajzu03.fsf@gmail.com> <87a7uyd7qy.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezlsM-0005jM-9o for help-guix@gnu.org; Sat, 24 Mar 2018 12:19:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezlhL-0004pN-5p for help-guix@gnu.org; Sat, 24 Mar 2018 12:08:21 -0400 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]:40952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ezlhK-0004op-Ub for help-guix@gnu.org; Sat, 24 Mar 2018 12:07:15 -0400 Received: by mail-lf0-x229.google.com with SMTP id e5-v6so22445011lfb.7 for ; Sat, 24 Mar 2018 09:07:14 -0700 (PDT) In-Reply-To: (Konrad Hinsen's message of "Sat, 24 Mar 2018 13:14:12 +0100") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Konrad Hinsen Cc: help-guix@gnu.org Konrad Hinsen (2018-03-24 13:14 +0100) wrote: > Alex Kost writes: > >> It is completely different: with "-Q", your .emacs file is not loaded at >> all, and with "--no-site-file", only the emacs packages from the guix >> profile are not autoloaded. Isn't that what you wanted? > > Not quite: I want it to autoload the packages from my current Guix > profile, not from my main Guix profile. But what your "current profile" is? How can emacs know about it? It "knows" only about the default (system and user) profiles. So if you wish to load packages from non-standard profiles, you need to do it on your own (as I showed below). >> If you want to autoload emacs packages from a guix environment (or >> similarly from any non-standard guix profile), you can do it like this: >> >> (let ((guix-env (getenv "GUIX_ENVIRONMENT"))) >> (when (and guix-env >> (require 'guix-emacs nil t)) >> (guix-emacs-autoload-packages guix-env))) > > Except that GUIX_ENVIRONMENT is defined only by "guix environment", not > by profiles. Otherwise this would be exactly what I want - and in fact > what I'd expect guix-emacs.el to do, instead of accessing the user's > main profile. Again, I don't understand how emacs could guess in what profile you installed your emacs packages, so it just autoloads whatever is found in the system and user profile. So for your situation, you can just run emacs with --no-site-file option and put a code like this in your emacs config file: (when (require 'guix-emacs nil t) (guix-emacs-autoload-packages "/path/to/your/profile")) -- Alex