From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: Re: Guix and Emacs Integration for Polyglot Development Date: Wed, 29 Aug 2018 20:41:29 +0200 Message-ID: <87wos9rp5y.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]:51865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fv5PM-0001ws-Iy for help-guix@gnu.org; Wed, 29 Aug 2018 14:41:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fv5PL-00077W-P4 for help-guix@gnu.org; Wed, 29 Aug 2018 14:41:36 -0400 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: help-guix@gnu.org Hi! Just subscribed to help-guix because of a request on IRC, so hoping that OP is subscribed here, or someone can notify them. I have an ugly hack to switch emacs to a profile or environment. It parses the /etc/profile script...using MANIFEST or `--search-paths' would be much nicer... Anyway, I'm using some named profiles, eg ~/.config/guix/mes and when starting work on mes i do M-x guix-switch-profile RET ~/.config/guix/mes RET similar for other projects I work on. A real solution would be nice... HTH, janneke --8<---------------cut here---------------start------------->8--- (defun guix-switch-profile (&optional profile) "reset Emacs' environment by snarfing PROFILE/etc/profile" (defun matches-in-string (regexp string) "return a list of matches of REGEXP in STRING." (let ((matches)) (save-match-data (string-match "^" "") (while (string-match regexp string (match-end 0)) (push (or (match-string 1 string) (match-string 0 string)) matche= s))) matches)) (interactive "fprofile: ") (let* ((output (shell-command-to-string (concat "GUIX_PROFILE=3D /bin/sh = -x " profile "/etc/profile"))) (exports (matches-in-string "^[+] export \\(.*\\)" output))) (mapcar (lambda (line) (apply #'setenv (split-string line "=3D"))) expo= rts ))) --8<---------------cut here---------------end--------------->8--- --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com