From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IAhpKLvnlV9eYgAA0tVLHw (envelope-from ) for ; Sun, 25 Oct 2020 21:01:47 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id aGpFJLvnlV+YAQAA1q6Kng (envelope-from ) for ; Sun, 25 Oct 2020 21:01:47 +0000 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 5362F9401BC for ; Sun, 25 Oct 2020 21:01:47 +0000 (UTC) Received: from localhost ([::1]:44408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWn98-00005F-3m for larch@yhetil.org; Sun, 25 Oct 2020 17:01:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWn8x-000057-Ll for guix-devel@gnu.org; Sun, 25 Oct 2020 17:01:35 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:33856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kWn8v-0000OW-Q0 for guix-devel@gnu.org; Sun, 25 Oct 2020 17:01:35 -0400 Received: by mail-wr1-x435.google.com with SMTP id i1so10246425wro.1 for ; Sun, 25 Oct 2020 14:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xDqumIx2xw+sDn+L/Ohg+59TvmyQEBQ+aSprv6JiQXY=; b=DW/Hf8V3Urig5nhnzJ7ySRiiDoNcYEAMy2vVJbxn+4he7PZKFw1i/3o3l2MXiW06m/ 0eXTsiQu6cCD0w1yt/3NypunFCMcJ6T2+Zv1bnD1MiWpcqL8hWIGHQvnMqb+PLG0kYip RIKw7yPOHsXay9wADYDSgaCFtKEv5A7NvpF1qRgPQs7lce9w7YSLJ6F6gljhifSNsEkd OHTSKfO2+rV3oYJ6pejM+ALD9dq5fZkj6b31xyOW6n4j71HiIgHBM6Dh3QFPFiMCax/P SGxsl47PxCSpjzSg57+Xpdzm/JvEgoi52mxl+b4MBpPzz9L8K1Mh7E6u4lRlyryCs71n 4SDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=xDqumIx2xw+sDn+L/Ohg+59TvmyQEBQ+aSprv6JiQXY=; b=NzNzROV1sN5wonf6uBGEaPdasSan+hiP5aFtJGEcX9Xc1NKn++r3UEcVM4ALFXZAUE BVx3vMnmlBKRfoCxpJ+I+Mxjdxm2ejnm4FhcNt/2MxUVxfe4xcRD6kyV3fJTwFQBi9uw r6EPQHN9md2vZKLRQ03ns0TZssTEPUV+x6Nv154B6a/LXFozzv3EQ574xGyoVIRCSOdc 9X+27h2q0FPv2pQfhVEiVf+aykizJfU87mhDJwFQm0WBnyEiv+TV7ahVx3QYWNVJJ5pC TvoSWhYafq5QNRwgw/Q5XR+wAsx+4ApbPWepBs/jJ0dMqrCiONQjhThTujG4FPSrD1yq gmog== X-Gm-Message-State: AOAM533rePE1j2csE2fFwXS2ZaoQQ0B1Qt9eNlo7McLEMqCldPX6MnNo AzyEOuVee+m9dcvHUpId3jw+k3KGPhY= X-Google-Smtp-Source: ABdhPJzOJF+vtikaSTxyIW5i+zFHEk/egdIderVumnxMgsxKxgBVeGPR9zDfIeS7hFfnAgWpnodEMw== X-Received: by 2002:adf:e443:: with SMTP id t3mr14314640wrm.14.1603659692062; Sun, 25 Oct 2020 14:01:32 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id m12sm18814984wrs.92.2020.10.25.14.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 14:01:31 -0700 (PDT) From: =?utf-8?Q?Miguel_=C3=81ngel_Arruga_Vivas?= To: Maxim Cournoyer Subject: Re: [PATCH] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable. References: <87tuuixjno.fsf@gmail.com> <20201025184228.2460-1-maxim.cournoyer@gmail.com> Date: Sun, 25 Oct 2020 22:01:05 +0100 In-Reply-To: <20201025184228.2460-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Sun, 25 Oct 2020 14:42:28 -0400") Message-ID: <87o8kqowa5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=rosen644835@gmail.com; helo=mail-wr1-x435.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=DW/Hf8V3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -3.81 X-TUID: 9d3W1E5Bh2Ky --=-=-= Content-Type: text/plain Hi! I think that geiser should use something (project.el, wink wink) to fill load-path automatically when that's possible. Nevertheless, I have some comments for this. Maxim Cournoyer writes: > + > + ;; Emacs-Guix > + (eval . (setq guix-directory > + (locate-dominating-file default-directory ".dir-locals.el"))) > + > + ;; Geiser > + ;; This allows automatically setting the `geiser-guile-load-path' > + ;; variable when using various Guix checkouts (e.g., via git worktrees). > + ;; The checkout root directory name should be prefixed by "guix" for it > + ;; to work correctly. > + (eval . (let* ((root-dir (expand-file-name > + (locate-dominating-file > + default-directory ".dir-locals.el"))) > + ;; Workaround for bug https://issues.guix.gnu.org/43818. > + (root-dir* (if (string-suffix-p "/" root-dir) > + (substring root-dir 0 -1) > + root-dir)) This is already implemented by directory-file-name. > + (clean-geiser-guile-load-path > + (seq-remove (lambda (x) > + (string-match "/guix" x)) > + geiser-guile-load-path))) This fails if geiser-guile-load-path does not exist (void-variable). The cleanup removes other guixes, isn't it? I suggest making the variable buffer-local and forget about hard-coded names. :-) > + (setq geiser-guile-load-path > + (cons root-dir* clean-geiser-guile-load-path)))))) This becomes a push with a local variable. Like this: -------------------------------8<------------------------------------- (eval . (setq guix-directory (locate-dominating-file default-directory ".dir-locals.el"))) (eval . (when (boundp 'geiser-guile-load-path) (make-local-variable 'geiser-guile-load-path) (push (directory-file-name (expand-file-name (locate-dominating-file default-directory ".dir-locals.el"))) geiser-guile-load-path)) ------------------------------->8------------------------------------- Happy hacking! Miguel --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEEiIeExBRZrMuD5+hMY0xuiXn6vsIFAl+V55QACgkQY0xuiXn6 vsJfuwv9FXAxpiGLsXpYlfFFr5SI3Rt3cIAcesjiNIn8OjYb6yCjAq9nikCk/iBz IYhMv9H3COJmCaVPIMX+3TwbBIANAEeoebl7BafMvvQsbrhnf9op5ULGf/5qaEd1 /N4QCtCxcuQetKO5wb6rkz/sJwXR0XD+tziP6j7eQcHYBn64THCKR/+aBR5jBa41 uDlhj/yIGZFQ08255ERLE5c5ljwxfli2wT9qNgWwwK+Iu1BJTDVIljlXtYZ2bQlL o3OxX98uQpwXZ8vN+0g5kQXoiAPpU/LrzBF8wOvaSEbbxRKCkPrLQ3h3uHZnYPZo tDa1oOd4GILjvjlvWw2sxy1tGHYvtwdeGZs9rdp9/uLPaq1wANQBr3PrMC3IPSKl c1JW/T8iNNYpoJuCY6KTkYZapl2wgqroAOX8LUjImPP5h/kgEd4R/N+Ao9mvtBP7 ys/xA7dQHgMNiFxb/TxDXDy4e4A9Q9T6sFwBN+rkxyfD6vtUoFkARQsMN9gAm5M5 sZhsJX1W =rB9v -----END PGP SIGNATURE----- --=-=-=--