From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Should guix-emacs-autoload-packages use GUIX_ENVIRONMENT? Date: Sat, 22 Jul 2017 21:39:49 -0400 Message-ID: <87zibwlymy.fsf@kyleam.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZ5sB-0000Vj-Eo for guix-devel@gnu.org; Sat, 22 Jul 2017 21:39:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZ5s8-0005eY-Be for guix-devel@gnu.org; Sat, 22 Jul 2017 21:39:55 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:59257 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dZ5s8-0005eK-5W for guix-devel@gnu.org; Sat, 22 Jul 2017 21:39:52 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 41A12AB09E for ; Sat, 22 Jul 2017 21:39:51 -0400 (EDT) Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 3B7A0AB09D for ; Sat, 22 Jul 2017 21:39:51 -0400 (EDT) Received: from localhost (unknown [24.60.167.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id BCD1AAB09C for ; Sat, 22 Jul 2017 21:39:50 -0400 (EDT) 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" To: guix-devel Hello, I noticed that Emacs packages from the user's profile leak into guix environment calls. For example, when I run $ guix environment --pure --ad-hoc emacs -- emacs -q load-path contains the Emacs packages from my main profile. I expected it to use GUIX_ENVIRONMENT instead (something like the patch below, I think). Does guix-emacs-autoload-packages ignore GUIX_ENVIRONMENT by design? I suppose one downside of honoring GUIX_ENVIRONMENT is that, if the --pure flag isn't passed and the package arguments aren't Emacs-related, a user may be surprised that their Emacs packages are no longer available in newly created Emacs instances. Thanks. -- >8 -- diff --git a/gnu/packages/aux-files/emacs/guix-emacs.el b/gnu/packages/aux-files/emacs/guix-emacs.el index 2bbd639ff..2d0d50e11 100644 --- a/gnu/packages/aux-files/emacs/guix-emacs.el +++ b/gnu/packages/aux-files/emacs/guix-emacs.el @@ -87,9 +87,11 @@ (defun guix-emacs-autoload-packages (&rest profiles) (interactive (list (if (fboundp 'guix-read-package-profile) (funcall 'guix-read-package-profile) guix-user-profile))) - (let ((profiles (or profiles - (list "/run/current-system/profile" - guix-user-profile)))) + (let* ((env (getenv "GUIX_ENVIRONMENT")) + (profiles (or profiles + (and env (list env)) + (list "/run/current-system/profile" + guix-user-profile)))) (dolist (profile profiles) (let ((dirs (guix-emacs-directories profile))) (when dirs -- 2.13.3