help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs in multiple profiles


From: Alex Kost
Subject: Re: Emacs in multiple profiles
Date: Sat, 24 Mar 2018 19:07:16 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Konrad Hinsen (2018-03-24 13:14 +0100) wrote:

> Alex Kost <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]