From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +PDpJ8v5MWMI4QAAbAwnHQ (envelope-from ) for ; Mon, 26 Sep 2022 21:13:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id ME3nJ8v5MWPQZAAA9RJhRA (envelope-from ) for ; Mon, 26 Sep 2022 21:13:15 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3BEBF7B3 for ; Mon, 26 Sep 2022 21:13:15 +0200 (CEST) Received: from localhost ([::1]:40988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1octXW-0001f7-FM for larch@yhetil.org; Mon, 26 Sep 2022 15:13:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocssR-0002vk-17 for guix-devel@gnu.org; Mon, 26 Sep 2022 14:30:52 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:54787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocssN-0001wU-Np for guix-devel@gnu.org; Mon, 26 Sep 2022 14:30:45 -0400 Received: from localhost (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 28QIUSSF031942; Mon, 26 Sep 2022 14:30:33 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 28QIUSSF031942 To: "Thompson, David" , guix-devel Subject: Re: Emacs integration for 'guix shell' In-Reply-To: References: Date: Mon, 26 Sep 2022 14:30:28 -0400 Message-ID: <87czbiugxn.fsf@laura> MIME-Version: 1.0 Content-Type: text/plain X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Mon, 26 Sep 2022 18:30:28 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list 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+larch=yhetil.org@gnu.org Sender: "Guix-devel" Reply-to: Olivier Dion From: Olivier Dion via "Development of GNU Guix and the GNU System distribution." X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664219595; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=WsJa6ygXuOXAy+iCEIW3O6KAMHXgGxnrtby1tTEM6CE=; b=d4D7C69tnUQOalhwzE45XNSS/5oK1SSOHnaWTf/OZxy8+xebIA+sX2giG57WAO+B/e/vVz L3IZhQ+nUFLUVNIYzybGwo62vcjBfJt9DiRgGB0EB51ncsl7wiaRtB/d2b3R775m0iXW+k qbbQarM9JnBW8sNB1XmvMnLuRx0hBg9ls9OXcWCxlVzFenk796lqT40X2GijgJHfvG6ENq 2IZUporxNpZvFcMrwr1u2zLrMO+nhtrJ2HpO3zYXzKWkiuELRnaiIDBPS7W1YJmElCkhBs yBnYAzEX20T3U5Flo8y+WSVRz0+g6EQDNYNxO1wOc+aya7Q+3tFNsbcW3sMAoA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664219595; a=rsa-sha256; cv=none; b=noHHNu64Zo+B4Fk7aEFtBBWRqJErE1Wyo4AC25nRFpqSX7uIgzKUEF4l19zVTSbjnwmqV7 IuZXKi/GRe+pCqFQ2IJUY5pMys3rYzhk2yL/uI608BOWYlSENq3wThuFc9l43pmztF+F8b f2fkuvu9SST4/caD0VaRK7pVtcBrDyIiqbnRIHCJ0DKLKjxvecVFE5OLOOGL2gptBSCwjp LOdJqQRH/m5ER4dMr/LIP+3Lhl8mmMvUBF9LYVUIfvm5qO/st52hv+e53Sg+IHIbMlIOXs 88VePTgpw4V1Tou9gBmOxDb40fREYV0FhFN40Cu5pLj3hLlfcoqYX4WY1uO1KQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.35 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3BEBF7B3 X-Spam-Score: -1.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: 8zsFdCH+j/fB On Mon, 26 Sep 2022, "Thompson, David" wrote: > Hello all, > > I recently wrote a little blog post titled "Guix for development" [0] > and in it I mentioned using a tool called direnv and emacs-direnv as a > way to integrate 'guix shell' with Emacs. This integration has vastly > improved my Emacs experience. I can open a shell buffer and the > environment variables are automatically configured the way I want. I > can run M-x compile and simply enter 'make' as the command instead of > 'guix shell -D -f guix.scm -- make'. > > It's very cool that it works, and I should have done this years ago, > but direnv is an unnecessary middleman for me because I don't use it > for any other purpose. It would be *even cooler* if Emacs could call > 'guix shell --search-paths' directly, parse the result, and update the > buffer environment. Furthemore, it could integrate with project.el > (thus requiring Emacs 28) so that per-project search paths "just > work." The emacs-guix-shell [1] project attempts to do this. Interesting I'll have a look at it! > I'm not an experienced elisp programmer so I'm sure there's stuff to > fix, and there are no customizable variables yet, but the essentials > seem to work OK for me. If you'd like to try it out, eval > guix-shell.el and then M-x guix-shell-global-mode to enable it > everywhere, or M-x guix-shell-mode to enable it just for the current > buffer. I have the following in my .dir-locals.el for my library libpatch. The idea is the same, but without direnv: --8<---------------cut here---------------start------------->8--- ((nil . ((eval . (let ((root (locate-dominating-file default-directory ".dir-locals.el"))) (when root (let ((real-root (directory-file-name (expand-file-name root)))) (setq-local geiser-guile-binary (concat real-root "/.geiser-guile")) (setq-local projectile-project-compilation-cmd (concat real-root "/.projectile-compile")) (setq-local projectile-project-test-cmd (concat real-root "/.projectile-test"))))))))) --8<---------------cut here---------------end--------------->8--- .projectile-compile: --8<---------------cut here---------------start------------->8--- #!/bin/sh ./dev-env make -j $(nproc) --8<---------------cut here---------------end--------------->8--- .projectile-test: --8<---------------cut here---------------start------------->8--- #!/bin/sh ./dev-env make -j $(nproc) check-nocolor --8<---------------cut here---------------end--------------->8--- .geiser-guile: --8<---------------cut here---------------start------------->8--- #!/bin/sh here=$(pwd) ./dev-env guile -L "$here" -x "$here" $@ --8<---------------cut here---------------end--------------->8--- dev-env: --8<---------------cut here---------------start------------->8--- #!/bin/sh guix shell \ --pure \ dyninst \ gdb \ git \ guix \ lcov \ guile-quickcheck \ perf \ lttng-ust \ lttng-tools \ --development libpatch \ -- $@ --8<---------------cut here---------------end--------------->8--- Note the latest script where I have development packages for libpatch, but also other utitilies that are good to have for developer. Regards, old -- Olivier Dion oldiob.dev